/**
 * HalalEco Categories
 * Ported out of the page/theme custom CSS so the plugin owns its own UI.
 */

.hcb-cats {
	--hlc-green: #5d8a1f;
	--hlc-ink: #1c1c1c;
	--hlc-line: #ececec;
	max-width: 1180px;
	margin: 0 auto;
	padding: 6px 0 10px;
}

.hcb-cats-title {
	margin: 0 0 10px !important;
	color: #141414;
	font-size: clamp(26px, 2.6vw, 34px);
	font-weight: 800;
	text-align: center;
}

.hcb-cats-rule {
	width: 150px;
	height: 20px;
	margin: 0 auto 26px;
	background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 24"><g fill="none" stroke="%23b9b9b9" stroke-width="1.4"><path d="M4 12h50M86 12h50"/><path d="M70 5l7 7-7 7-7-7z"/></g></svg>') center center / contain no-repeat;
}

.hcb-cats-notice {
	max-width: 760px;
	margin: 0 auto 20px;
	padding: 14px 18px;
	border-radius: 10px;
	background: #fff8e5;
	color: #5c4b00;
	font-size: 14px;
	text-align: center;
}

/* ---------- Accordion ---------- */

.hcb-cat {
	margin: 0 0 18px;
	padding: 16px 22px;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 8px 26px rgba(20, 20, 20, 0.07);
}

.hcb-cat-sum {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 8px 0;
	list-style: none;
	cursor: pointer;
	user-select: none;
}

.hcb-cat-sum::-webkit-details-marker { display: none; }
.hcb-cat-sum::marker { content: ''; }

.hcb-cat-badge {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--hlc-green);
	overflow: hidden;
}

.hcb-cat-badge svg {
	display: block;
	width: 30px;
	height: 30px;
}

.hcb-cat-badge--image { background: #f4f5f2; }

.hcb-cat-badge-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

.hcb-cat-title {
	color: var(--hlc-green);
	font-size: 19px;
	font-weight: 800;
	letter-spacing: 0.07em;
	text-transform: uppercase;
}

.hcb-cat-panel {
	display: grid;
	grid-template-columns: 238px minmax(0, 1fr);
	align-items: start;
	padding-top: 2px;
}

/* ---------- Sub-category bullets ---------- */

.hcb-cat-bullets {
	grid-column: 1;
	padding: 2px 22px 8px 6px;
}

.hcb-cat-all {
	margin: 0 0 7px !important;
	padding: 0;
	list-style: none;
}

.hcb-cat-all li { margin: 0; }

.hcb-cat-bullets a {
	position: relative;
	display: block;
	padding: 0 0 0 17px;
	color: #333;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.55;
	text-decoration: none;
	cursor: pointer;
}

.hcb-cat-bullets a::before {
	content: '';
	position: absolute;
	top: 0.62em;
	left: 2px;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--hlc-green);
}

.hcb-cat-bullets a:hover,
.hcb-cat-bullets a.is-active { color: var(--hlc-green); }

.hcb-cat-bullets a.is-active { font-weight: 800; }

/* ---------- Product tiles ---------- */

.hcb-cat-tiles {
	grid-column: 2;
	min-height: 56px;
	padding: 4px 0 4px 26px;
	border-left: 1px solid var(--hlc-line);
	transition: opacity 0.15s ease;
}

.hcb-cat-tiles.is-loading { opacity: 0.45; }

.hcb-cat-tiles .woocommerce { margin: 0; }

.hcb-cat-tiles ul.products {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(162px, 1fr));
	gap: 14px;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none;
}

.hcb-cat-tiles ul.products::before,
.hcb-cat-tiles ul.products::after {
	content: none !important;
	display: none !important;
}

.hcb-cat-tiles li.product {
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	float: none !important;
	clear: none !important;
	list-style: none;
	overflow: hidden;
	border: 1px solid #ededed;
	border-radius: 10px;
	background: #fff;
	transition: box-shadow 0.18s, transform 0.18s;
}

.hcb-cat-tiles li.product:hover {
	box-shadow: 0 10px 22px rgba(20, 20, 20, 0.12);
	transform: translateY(-2px);
}

.hcb-cat-tiles li.product > a img,
.hcb-cat-tiles li.product img.wp-post-image {
	display: block;
	width: 100%;
	height: auto;
	margin: 0 !important;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 0;
}

.hcb-cat-tiles li.product img[src*='woocommerce-placeholder'] {
	padding: 24%;
	background: #f4f6ef;
	object-fit: contain;
	opacity: 0.22;
}

.hcb-cat-tiles li.product .product-content { padding: 9px 10px 12px; text-align: center; }

.hcb-cat-tiles li.product .woocommerce-loop-product__title,
.hcb-cat-tiles li.product .product_title {
	margin: 0 0 5px !important;
	padding: 0 !important;
	font-size: 13.5px !important;
	font-weight: 700 !important;
	line-height: 1.3 !important;
	text-align: center;
}

.hcb-cat-tiles li.product .woocommerce-loop-product__title a,
.hcb-cat-tiles li.product .product_title a {
	color: var(--hlc-ink) !important;
	text-decoration: none;
}

.hcb-cat-tiles li.product .price {
	display: block;
	margin: 0 !important;
	font-size: 13.5px !important;
	font-weight: 800 !important;
	text-align: center;
}

.hcb-cat-tiles li.product .price del {
	font-size: 12px;
	font-weight: 600;
	opacity: 0.6;
}

.hcb-cat-tiles li.product .button,
.hcb-cat-tiles li.product .added_to_cart {
	margin-top: 8px !important;
	padding: 7px 12px !important;
	font-size: 12.5px !important;
}

.hcb-cat-tiles li.product .edit-button { display: none !important; }

.hcb-cat-tiles mark.count { display: none !important; }

/* Theme-specific product footer (kept so existing cards still line up). */
.hcb-cat-tiles li.product .hlc-foot {
	flex-direction: column !important;
	align-items: center !important;
	gap: 8px !important;
	padding: 10px 8px 12px !important;
}

.hcb-cat-tiles li.product .hlc-foot__info { width: 100% !important; text-align: center; }

.hcb-cat-tiles li.product .hlc-foot__title {
	display: block;
	color: var(--hlc-ink) !important;
	font-size: 13.5px !important;
	font-weight: 700 !important;
	line-height: 1.3 !important;
	text-decoration: none;
}

.hcb-cat-tiles li.product .hlc-foot__price {
	display: block;
	margin-top: 4px;
	font-size: 13.5px !important;
	font-weight: 800 !important;
}

.hcb-cat-tiles li.product .hlc-cartwrap { flex: 0 0 auto; }
.hcb-cat-tiles li.product .hlc-cart { width: 38px !important; height: 38px !important; }

/* ---------- Empty state ---------- */

.hcb-cat-soon {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 34px 20px;
	border-radius: 10px;
	background: #f4f5f2;
	color: #3a3a3a;
	font-size: 15px;
	font-weight: 600;
	text-align: center;
}

.hcb-cat-soon-ico svg {
	display: block;
	width: 26px;
	height: 26px;
}

.hcb-cat-empty {
	display: none;
	margin: 14px 0 0 !important;
	color: #666;
	font-size: 14px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
	.hcb-cat { padding: 14px 16px; }
	.hcb-cat-panel { grid-template-columns: 200px minmax(0, 1fr); }
	.hcb-cat-tiles { padding-left: 18px; }
	.hcb-cat-tiles ul.products { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
}

@media (max-width: 680px) {
	.hcb-cat { padding: 14px; }
	.hcb-cat-panel { grid-template-columns: minmax(0, 1fr); }
	.hcb-cat-bullets { grid-column: 1; padding: 4px 0 12px; }
	.hcb-cat-tiles {
		grid-column: 1;
		padding: 14px 0 4px;
		border-left: 0;
		border-top: 1px solid var(--hlc-line);
	}
	.hcb-cat-tiles ul.products { grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 10px; }
	.hcb-cat-badge { width: 46px; height: 46px; }
	.hcb-cat-badge svg { width: 25px; height: 25px; }
	.hcb-cat-title { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
	.hcb-cat-tiles li.product { transition: none; }
	.hcb-cat-tiles li.product:hover { transform: none; }
}
