/**
 * Habesha Market - Category landing pages, equal-height cards, product page
 * Part of the site CSS moved from Customizer > Additional CSS on 2026-11-15 (original lines 612-719).
 * Files 01-08 load in number order; the order matters (later rules win), so keep it.
 */

/* === HM CATEGORY PAGE (2026-09-19): hero, toolbar and product cards on the six category pages === */
:root { --hm-hero-h: clamp(300px, 24vw, 380px); }
.hm-cat-hero { position: relative; overflow: hidden; display: flex; align-items: center; min-height: var(--hm-hero-h); background-color: var(--global-palette8); }
.hm-cat-hero > .wp-block-group__inner-container { width: 100%; }
.hm-cat-hero-media { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
.hm-cat-hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 85% center; display: block; }
.hm-cat-hero-media::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: linear-gradient(90deg, var(--global-palette8) 0%, rgba(251,249,247,0.9) 28%, rgba(251,249,247,0) 62%); }
.hm-cat-hero-content { position: relative; z-index: 1; padding-top: var(--hm-gap-sm); padding-bottom: var(--hm-gap-sm); }
.hm-cat-hero-content > * { max-width: 34rem; }
.hm-cat-hero-content h1 { margin: 0 0 var(--hm-space-1); }
.hm-cat-hero .hm-lead { margin: 0; }
.hm-cat-grid:not(:has(ul.products)) .hm-cat-tools { display: none; }
.hm-cat-grid ul.products { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--hm-space-3); margin: 0; padding: 0; list-style: none; }
/* category-page card visuals: moved to wp-content/hm-assets/css/product-cards.css (2026-11-15) */
.hm-cat-grid .woocommerce ul.products.woo-archive-action-on-hover li.product .product-action-wrap, .hm-cat-grid ul.products li.product .product-action-wrap { position: static; opacity: 1; visibility: visible; transform: none; margin-top: auto; padding: 0; width: auto; }
.hm-cat-grid ul.products li.product a.button { display: flex; align-items: center; justify-content: center; gap: var(--hm-space-1); width: 100%; margin: 0; padding: 12px var(--hm-space-2); box-sizing: border-box; }
/* Kadence adds its own result count, sort and view toggle to [products]; the page has its own search and sort row instead. */
.hm-cat-grid .kadence-shop-top-row, .hm-cat-grid .woocommerce-result-count, .hm-cat-grid .woocommerce-ordering, .hm-cat-grid .kadence-shop-view-toggle { display: none !important; }
.hm-cat-back { display: inline-flex; align-items: center; gap: var(--hm-space-1); margin: 0; font-size: 0.875rem; color: var(--global-palette4); text-decoration: none; }
.hm-cat-back:hover { color: var(--global-palette2); text-decoration: underline; text-underline-offset: 3px; }
/* cart icon on listing buttons: moved to wp-content/hm-assets/css/product-cards.css (2026-11-15) */
.hm-cat-grid .woocommerce-pagination { margin-top: var(--hm-space-4); }
@media (max-width: 1100px) { .hm-cat-grid ul.products { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 767px) {
	.hm-cat-hero-media::after { background: linear-gradient(180deg, rgba(251,249,247,0.94) 0%, rgba(251,249,247,0.7) 100%); }
	.hm-cat-grid ul.products { grid-template-columns: repeat(2, 1fr); gap: var(--hm-space-2); }
}
/* Categories without a designed wide hero image: the photo sits in a panel on the right instead of being stretched across the whole band. */
.hm-cat-hero--side .hm-cat-hero-media { left: 60%; }
.hm-cat-hero--side .hm-cat-hero-media img { object-position: center 40%; }
.hm-cat-hero--side .hm-cat-hero-media::after { background: linear-gradient(90deg, var(--global-palette8) 0%, rgba(251,249,247,0) 40%); }
@media (max-width: 767px) { .hm-cat-hero--side .hm-cat-hero-media { left: 0; } .hm-cat-hero--side .hm-cat-hero-media::after { background: linear-gradient(180deg, rgba(251,249,247,0.94) 0%, rgba(251,249,247,0.7) 100%); } }
/* Toolbar row above the product grid: heading, search and sort on one centred line, rule underneath. */
.hm-cat-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--hm-space-2) var(--hm-space-4); margin: 0 0 var(--hm-space-4); padding-bottom: var(--hm-space-3); border-bottom: 1px solid var(--hm-border); }
.hm-cat-tools h2 { flex: 1 1 auto; margin: 0; line-height: 1.1; }
.hm-cat-search { display: flex; align-items: center; margin: 0; }
.entry-content .hm-cat-tools form { margin: 0; }
.hm-cat-search input[type=search] { box-sizing: border-box; width: min(320px, 100%); height: 44px; margin: 0; padding: 0 var(--hm-space-2) 0 44px; border: 1px solid var(--hm-border); border-radius: 6px; background: var(--global-palette9) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23545934' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 16px center / 18px; font: inherit; font-size: 0.875rem; line-height: 1.2; color: var(--global-palette3); }
.hm-cat-sort { display: flex; align-items: center; gap: 4px; height: 44px; padding-left: var(--hm-space-4); border-left: 1px solid var(--hm-border); }
.hm-cat-sort label { margin: 0; font-weight: 700; font-size: 0.875rem; line-height: 1; color: var(--global-palette5); white-space: nowrap; }
.hm-cat-sort select { box-sizing: border-box; height: 44px; margin: 0; padding: 0 40px 0 var(--hm-space-2); border: 1px solid var(--hm-border); border-radius: 6px; background-color: var(--global-palette9); font: inherit; font-size: 0.875rem; line-height: 1.2; color: var(--global-palette3); }
@media (max-width: 767px) { .hm-cat-tools h2 { flex-basis: 100%; } .hm-cat-search { flex: 1 1 100%; } .hm-cat-sort { flex: 1 1 100%; height: auto; padding-left: 0; border-left: 0; } .hm-cat-sort select { flex: 1 1 auto; min-width: 0; } .hm-cat-search input[type=search] { width: 100%; } }
/* === /HM CATEGORY PAGE === */


/* Category pages: tighter space around the Tilbage link */
.entry-content-wrap:has(.hm-cat-crumb) { padding-top: 0; }
.entry-content .hm-cat-crumb { margin-block: 0 !important; padding-block: var(--hm-space-2) !important; }
.entry-content .hm-cat-crumb + .hm-cat-hero { margin-block-start: 0 !important; }


/* Even section rhythm: a tinted band's margin + inner padding together equal one --hm-gap, so content-to-content spacing matches plain sections */
.entry-content > .wp-block-group:not(.has-background):not(.site-hero-banner) + div.has-background.hm-section { margin-top: calc(var(--hm-gap) * 0.25) !important; }
.entry-content > div.has-background.hm-section + .hm-section:not(.has-background) { margin-top: calc(var(--hm-gap) * 0.25) !important; }
.entry-content div.has-background.hm-section.hm-section { padding-top: calc(var(--hm-gap) * 0.75) !important; padding-bottom: calc(var(--hm-gap) * 0.75) !important; }

@media (min-width: 768px) {
	.entry-content > div.site-hero-banner { padding-bottom: calc(var(--hm-gap) * 0.75) !important; }
	.entry-content > div.site-hero-banner + .hm-section { margin-top: calc(var(--hm-gap) * 0.25) !important; }
}

.entry-content > div.has-background.hm-section + .kb-row-layout-wrap, .entry-content > .kb-row-layout-wrap + div.has-background.hm-section { margin-top: calc(var(--hm-gap) * 0.25) !important; }


/* === HM EQUAL CARDS (added 2026-09-19): product cards share height, button pinned to the bottom (landing page + Shop) === */
.woocommerce ul.products li.product { display: flex; flex-direction: column; }
.woocommerce ul.products li.product .entry-content-wrap { display: flex; flex-direction: column; flex: 1 1 auto; }
.woocommerce ul.products li.product .product-action-wrap { margin-top: auto; }
/* === /HM EQUAL CARDS === */


/* === HM HERO SEPARATION (added 2026-09-19): warmer cream fade + hairline so the category hero reads as its own band against the white page === */
.hm-cat-hero { background-color: #F4F1EA; border-top: 1px solid var(--hm-border); border-bottom: 1px solid var(--hm-border); }
.hm-cat-hero-media::after { background: linear-gradient(90deg, #F4F1EA 0%, rgba(244,241,234,0.9) 28%, rgba(244,241,234,0) 62%); }
.hm-cat-hero--side .hm-cat-hero-media::after { background: linear-gradient(90deg, #F4F1EA 0%, rgba(244,241,234,0) 40%); }
@media (max-width: 767px) {
	.hm-cat-hero-media::after, .hm-cat-hero--side .hm-cat-hero-media::after { background: linear-gradient(180deg, rgba(244,241,234,0.94) 0%, rgba(244,241,234,0.7) 100%); }
}
/* === /HM HERO SEPARATION === */


/* === HM PRODUCT PAGE (added 2026-09-19): single product layout - vertical thumbnails, refined summary, wide add-to-cart === */
.single-product div.product .summary .product_title { font-size: clamp(1.75rem, 2.4vw, 2.125rem); line-height: 1.2; margin: 0 0 .5rem; }
.single-product div.product .summary .price { font-size: 1.25rem; font-weight: 500; color: var(--global-palette3); margin: 0 0 1rem; }
.single-product div.product .summary .woocommerce-product-details__short-description { color: var(--global-palette4); margin-bottom: 1rem; }
.single-product div.product .summary .stock { display: flex; align-items: center; gap: .5rem; font-size: .9375rem; margin: 0 0 1.25rem; }
.single-product div.product .summary .stock::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: 0 0 9px; }
.single-product div.product .summary .stock.in-stock { color: #545934; }
.single-product div.product .summary form.cart:not(.variations_form):not(.grouped_form) { display: flex; align-items: stretch; gap: 12px; margin: 0 0 12px; }
.single-product div.product .summary form.cart .quantity { margin: 0; }
.single-product div.product .summary form.cart .quantity .qty { height: 48px; width: 72px; border: 1px solid var(--hm-border, #e4e0d6); border-radius: 6px; background: #fff; text-align: center; }
.single-product div.product .summary form.cart .single_add_to_cart_button { flex: 1 1 auto; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; margin: 0; }
.single-product div.product .summary form.cart .single_add_to_cart_button::before { content: ''; width: 16px; height: 16px; background-color: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4h2l2.4 11h10.2L20 7H6.2'/%3E%3Ccircle cx='9' cy='19.5' r='1.3'/%3E%3Ccircle cx='17' cy='19.5' r='1.3'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4h2l2.4 11h10.2L20 7H6.2'/%3E%3Ccircle cx='9' cy='19.5' r='1.3'/%3E%3Ccircle cx='17' cy='19.5' r='1.3'/%3E%3C/svg%3E") center/contain no-repeat; }
.single-product div.product .summary .product_meta { border-top: 1px solid var(--hm-border, #e4e0d6); margin-top: 1.5rem; padding-top: 1rem; font-size: .8125rem; color: var(--global-palette5); }
.single-product div.product .summary .product_meta > span { display: block; margin-bottom: .35rem; }
.single-product div.product .summary .product_meta a { font-weight: 400; }
.single-product div.product .woocommerce-product-gallery .flex-viewport { border-radius: 8px; }
.single-product div.product .woocommerce-product-gallery .flex-control-thumbs img { border-radius: 6px; border: 1px solid var(--hm-border, #e4e0d6); opacity: 1; }
.single-product div.product .woocommerce-product-gallery .flex-control-thumbs img.flex-active { border-color: #545934; box-shadow: 0 0 0 1px #545934; }
@media (min-width: 768px) {
	.single-product div.product .woocommerce-product-gallery.gallery-has-thumbnails { display: flex; flex-direction: row-reverse; align-items: flex-start; gap: 16px; }
	.single-product div.product .woocommerce-product-gallery.gallery-has-thumbnails .flex-viewport { flex: 1 1 auto; min-width: 0; }
	.single-product div.product .woocommerce-product-gallery.gallery-has-thumbnails .flex-control-thumbs { position: static; transform: none; left: auto; flex: 0 0 76px; width: 76px; max-width: 76px; margin: 0; padding: 0; display: flex; flex-direction: column; flex-wrap: nowrap; gap: 12px; overflow: visible; }
	.single-product div.product .woocommerce-product-gallery.gallery-has-thumbnails .flex-control-thumbs li { width: 100%; margin: 0; padding: 0; float: none; }
}
/* === /HM PRODUCT PAGE === */


