/*
 * Baraka shop listing — Figma 03_Shop-Listing_Desktop (1440 wide).
 * Loaded after home.css (tokens, nav, footer, product card).
 */

.bh-shop { width: min(var(--bh-wrap), 100% - 2 * var(--bh-gutter)); margin-inline: auto; padding: 116px 0 92px; }
.admin-bar .bh-shop { padding-top: 116px; }

/* ----------------------------------------------------------- masthead */
.bh-mh { position: relative; margin-bottom: 34px; color: var(--bh-coffee); }
.bh-mh--banner { display: flex; align-items: flex-end; min-height: 220px; overflow: hidden; border-radius: 22px; background: var(--bh-walnut); color: #fff; isolation: isolate; }
.bh-mh__img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100% !important; object-fit: cover; }
.bh-mh__shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(var(--bh-shade), .82) 0%, rgba(var(--bh-shade), .5) 45%, rgba(var(--bh-shade), .05) 85%); }
[dir="rtl"] .bh-mh__shade { background: linear-gradient(270deg, rgba(var(--bh-shade), .82) 0%, rgba(var(--bh-shade), .5) 45%, rgba(var(--bh-shade), .05) 85%); }
.bh-mh--banner .bh-mh__body { padding: 40px; max-width: 640px; }
.bh-mh--title, .bh-mh--search { padding-bottom: 26px; border-bottom: 1px solid var(--bh-line); }
.bh-crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; font-size: 11.5px; letter-spacing: 1.84px; text-transform: uppercase; color: var(--bh-kicker); }
.bh-mh--banner .bh-crumbs { color: rgba(255, 255, 255, .85); }
.bh .bh-crumbs a { color: inherit; }
.bh .bh-crumbs a:hover { text-decoration: underline; }
.bh-mh__title { font-size: clamp(34px, 3.4vw, 46px); font-weight: 500 !important; line-height: 1.05; letter-spacing: -.02em; }
.bh-mh--banner .bh-mh__title { font-size: clamp(36px, 3.6vw, 52px); color: #fff; }
.bh-mh__sub { margin-top: 12px; max-width: 520px; font-size: 16px; font-weight: 300 !important; line-height: 1.6; color: var(--bh-body); }
.bh-mh--banner .bh-mh__sub { color: #eadcd2; }
.bh-dym { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; font-size: 13px; color: var(--bh-muted); }
.bh .bh-dym a { padding: 6px 14px; border: 1px solid var(--bh-line-2); border-radius: 999px; color: var(--bh-ink); }
.bh .bh-dym a:hover { border-color: var(--bh-coffee); }

/* ----------------------------------------------------------- layout */
.bh-shop__layout { display: grid; grid-template-columns: 288px minmax(0, 1fr); gap: 40px; align-items: start; }

/* ------------------------------------------------------ filter sidebar */
.bh-filters {
	position: sticky;
	top: calc(116px + var(--wp-admin--admin-bar--height, 0px));
	max-height: calc(100vh - 136px - var(--wp-admin--admin-bar--height, 0px));
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--bh-cream);
	border: 1px solid var(--bh-line);
	border-radius: 18px;
	scrollbar-width: thin;
}
.bh-filters__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--bh-line); }
.bh-filters__title { font-size: 11.5px; letter-spacing: 1.84px; text-transform: uppercase; color: var(--bh-kicker); }
.bh .bh-filters__clear { margin-inline-start: auto; font-size: 13px; color: var(--bh-coffee); text-decoration: underline; text-underline-offset: 3px; }
.bh .bh-filters__close, .bh-filters__apply, .bh .bh-filters__open { display: none; }
.bh-filters__chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 16px 20px; border-bottom: 1px solid var(--bh-line); }
.bh .bh-chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border: 1px solid var(--bh-line-2); border-radius: 999px; background: #fff; font-size: 13px; color: var(--bh-ink); }
.bh .bh-chip span { font-size: 11px; color: var(--bh-muted); }
.bh .bh-chip:hover { border-color: var(--bh-coffee); }
.bh-fgroup { padding: 18px 20px; border-bottom: 1px solid var(--bh-line); }
.bh-fgroup summary { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 500 !important; color: var(--bh-ink); }
.bh-fgroup summary::-webkit-details-marker { display: none; }
.bh-fgroup summary::after { content: "▾"; font-size: 10px; color: var(--bh-muted); transform: rotate(180deg); transition: transform .2s; }
.bh-fgroup:not([open]) summary { margin-bottom: 0; }
.bh-fgroup:not([open]) summary::after { transform: none; }
.bh-fgroup ul { display: flex; flex-direction: column; gap: 10px; }
.bh-fgroup--toggle .bh-check__label { font-weight: 500 !important; }
.bh .bh-fgroup__sub { margin: 2px 0 2px 8px; padding-inline-start: 16px; border-inline-start: 1px solid var(--bh-line-2); }
[dir="rtl"] .bh .bh-fgroup__sub { margin: 2px 8px 2px 0; }
.bh .bh-check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--bh-ink); }
.bh-check__box { flex: none; position: relative; width: 18px; height: 18px; border: 1px solid var(--bh-khaki); border-radius: 5px; background: #fff; transition: background-color .15s; }
.bh-check--sub .bh-check__box { width: 16px; height: 16px; }
.bh-check[aria-checked="true"] .bh-check__box { background: var(--bh-coffee); border-color: var(--bh-coffee); }
.bh-check[aria-checked="true"] .bh-check__box::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; line-height: 1; color: #fff; }
.bh-check__label { flex: 1 1 auto; min-width: 0; }
.bh-check--sub { font-size: 13.5px; }
.bh-check__n { font-size: 12.5px; font-weight: 300 !important; color: var(--bh-muted); }
.bh .bh-check:hover .bh-check__box { border-color: var(--bh-coffee); }
.bh-filters__note { padding: 16px 20px 20px; font-size: 12px; font-weight: 300 !important; line-height: 1.5; color: var(--bh-muted); }
.bh-shop.is-loading .bh-results { opacity: .5; pointer-events: none; transition: opacity .15s; }

/* ---------------------------------------------------------- result bar */
.bh-resultbar { display: flex; align-items: center; gap: 16px; padding-bottom: 18px; margin-bottom: 22px; border-bottom: 1px solid var(--bh-line); }
.bh-resultbar__count { flex: 1 1 auto; font-size: 14.5px; font-weight: 300 !important; color: var(--bh-muted); }
.bh-sort { position: relative; display: flex; align-items: center; gap: 12px; }
.bh-sort__label { font-size: 13px; color: var(--bh-muted); }
.bh .bh-sort__btn { display: inline-flex; align-items: center; gap: 22px; height: 42px; padding: 0 16px; border: 1px solid var(--bh-line-2); border-radius: 999px; background: #fff; font-size: 14px; color: var(--bh-ink); }
.bh .bh-sort__btn span:last-child { font-size: 9px; color: var(--bh-muted); }
.bh-sort__menu { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 20; min-width: 230px; overflow: hidden; background: #fff; border: 1px solid var(--bh-line); border-radius: 18px; box-shadow: 0 34px 74px -18px rgba(74, 58, 50, .34); }
.bh .bh-sort__menu a { display: block; padding: 13px 18px; font-size: 14.5px; color: var(--bh-ink); }
.bh .bh-sort__menu a:hover { background: var(--bh-cream); }
.bh .bh-sort__menu [aria-selected="true"] a { background: var(--bh-pill); color: var(--bh-coffee); font-weight: 500 !important; }

/* ---------------------------------------------------- packing-type row */
.bh-types { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-bottom: 18px; margin-bottom: 22px; border-bottom: 1px solid var(--bh-line); }
.bh-types__label { margin-inline-end: 32px; font-size: 11.5px; letter-spacing: 1.84px; text-transform: uppercase; color: var(--bh-kicker); }
.bh .bh-type { display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border: 1px solid var(--bh-line-2); border-radius: 999px; font-size: 14px; color: var(--bh-ink); }
.bh .bh-type.is-on { background: var(--bh-coffee); border-color: var(--bh-coffee); color: #fff; }

/* -------------------------------------------------------------- grid */
.bh-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.bh-more-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 40px; }
.bh .bh-loadmore { display: inline-flex; align-items: center; height: 46px; padding: 0 30px; border: 1px solid var(--bh-line-2); border-radius: 999px; font-size: 13px; letter-spacing: 1.3px; text-transform: uppercase; color: var(--bh-coffee); }
.bh .bh-loadmore:hover { border-color: var(--bh-coffee); }
.bh .bh-loadmore.is-loading { opacity: .5; pointer-events: none; }
.bh-more-wrap__count { font-size: 12.5px; font-weight: 300 !important; color: var(--bh-muted); }

/* -------------------------------------------------------------- empty */
.bh-empty { padding: 48px 54px 54px; background: var(--bh-cream); border: 1px solid var(--bh-line); border-radius: 22px; }
.bh-empty__title { font-size: 24px; font-weight: 500 !important; color: var(--bh-coffee); }
.bh-empty__text { margin-top: 10px; font-size: 15.5px; font-weight: 300 !important; color: var(--bh-body); }
.bh-empty__actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 26px 0 34px; }
.bh-empty .bh-btn--dark { padding: 15px 26px; font-size: 13px; }
.bh .bh-btn--ghost { padding: 15px 26px; border: 1px solid var(--bh-line-2); background: #fff; color: var(--bh-coffee); font-size: 13px; letter-spacing: 1.3px; }
.bh .bh-btn--ghost:hover { border-color: var(--bh-coffee); color: var(--bh-coffee); }
.bh-empty .bh-mm__title { padding-inline: 0; }

/* --------------------------------------------------------- responsive */
@media (max-width: 1180px) {
	.bh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
	.bh-shop { padding-top: 96px; }
	.bh-shop__layout { grid-template-columns: minmax(0, 1fr); }
	/* Filters become a bottom sheet. */
	.bh .bh-filters__open { display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border: 1px solid var(--bh-line-2); border-radius: 999px; background: #fff; font-size: 14px; color: var(--bh-ink); }
	.bh-filters {
		position: fixed;
		inset: auto 0 0 0;
		top: auto;
		z-index: 1100;
		max-height: 86vh;
		border-radius: 22px 22px 0 0;
		transform: translateY(105%);
		transition: transform .25s ease;
		box-shadow: 0 -20px 60px rgba(58, 44, 38, .25);
	}
	.bh-filters.is-open { transform: none; }
	.bh .bh-filters__close { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 999px; }
	.bh-filters__apply { display: block; position: sticky; bottom: 0; padding: 14px 20px 20px; background: var(--bh-cream); border-top: 1px solid var(--bh-line); }
	.bh-filters__apply .bh-btn { width: 100%; }
	.bh-sheet-backdrop { position: fixed; inset: 0; z-index: 1090; background: rgba(58, 44, 38, .45); }
	.bh-resultbar { flex-wrap: wrap; }
	.bh-resultbar__count { order: 3; flex-basis: 100%; }
	.bh-sort { margin-inline-start: auto; }
	.bh-sort__label { display: none; }
}
@media (max-width: 780px) {
	.bh-shop { padding-top: 84px; padding-bottom: 64px; }
	.bh-mh--banner { min-height: 180px; border-radius: 18px; }
	.bh-mh--banner .bh-mh__body { padding: 24px; }
	.bh-grid { gap: 12px; }
	.bh-grid .bh-card__img { height: 180px; padding: 14px; }
	.bh-grid .bh-card__img img { max-height: 150px; }
	.bh-grid .bh-card__body { padding: 12px; }
	.bh-grid .bh-card__name { font-size: 14px; line-height: 1.3; min-height: 36px; }
	.bh-grid .bh-card__price { margin: 10px 0 12px; font-size: 15px; }
	.bh .bh-grid .bh-card__add { height: 38px; font-size: 11px; letter-spacing: .6px; }
	.bh-empty { padding: 28px 20px; }
	.bh-types__label { flex-basis: 100%; margin: 0 0 4px; }
}

/* =========================================================================
 * Audit against Figma 03_Shop-Listing (desktop 1:3187, mobile 8:5772/8:6332).
 * ====================================================================== */

/* Filter rows: checked label 500 coffee (1:4405); counts #a18a7c; sub-categories without counts. */
.bh .bh-check[aria-checked="true"] .bh-check__label { font-weight: 500 !important; color: var(--bh-coffee); }
.bh .bh-check__n { color: var(--bh-kicker); }
.bh .bh-check--sub .bh-check__n { display: none; }
.bh .bh-resultbar__count { color: var(--bh-body); }

/* Sort menu (1:4333); the phone-only "Sort by" header and "Sort ·" prefix are hidden on desktop. */
.bh .bh-sort__menu { width: 240px; border-radius: 16px; box-shadow: 0 24px 54px -16px rgba(74, 58, 50, .3); }
.bh-sort__head, .bh-sort__m { display: none; }

/* Load more (1:4738). */
.bh .bh-loadmore { height: 50px; padding-inline: 34px; border-color: #d8c7bb; }
.bh .bh-more-wrap__count { font-size: 13px; color: var(--bh-kicker); }

/* Search masthead title 38px (1:4258); "Did you mean" chips (1:4266). */
.bh .bh-mh--search .bh-mh__title { font-size: 38px; letter-spacing: -.57px; }
.bh .bh-dym > span { font-size: 13.5px; font-weight: 300 !important; color: var(--bh-muted); }
.bh .bh-dym a { display: inline-flex; align-items: center; height: 34px; padding-inline: 14px; border: 0; border-radius: 999px; background: var(--bh-pill); font-size: 13px; color: var(--bh-coffee); }
.bh .bh-dym a:hover { background: #ecdfd5; }

/* Banner masthead breadcrumb (1:4221). */
.bh .bh-mh--banner .bh-crumbs, .bh .bh-mh--banner .bh-crumbs a { font-size: 12px; letter-spacing: 1.92px; color: #dcc9bb; }

/* Empty state (1:4749). */
.bh .bh-empty { border-radius: 18px; }
.bh .bh-empty__title { font-size: 22px; }
.bh .bh-empty__actions .bh-btn { height: 48px; font-size: 12.5px; font-weight: 400 !important; letter-spacing: 1px; }
.bh .bh-empty__actions .bh-btn--ghost { background: var(--bh-cream); }

/* Cards: OOS badge and button tone (1:4660); weight note (1:4697). */
.bh .bh-badge--oos { background: #8a756a; }
.bh .bh-card.is-oos .bh-card__add--outline { border-color: #e3d4c8; color: #8a756a; }
.bh .bh-card__note { font-size: 11.5px; color: var(--bh-kicker); }

/* Phone sheet footer: Clear + Show (8:6945). */
.bh-filters__clear-m { display: none; }

@media (max-width: 1080px) {
	/* Toolbar (8:6661): Filters pill with a count badge, "Sort · Relevance" pill; no count line. */
	.bh .bh-resultbar { flex-wrap: nowrap; gap: 12px; margin-inline: -20px; padding: 10px 20px; border-bottom: 1px solid var(--bh-line); }
	.bh .bh-resultbar__count { display: none; }
	.bh .bh-filters__open, .bh .bh-sort__btn { flex: 1 1 0; justify-content: center; gap: 8px; height: 44px; font-size: 13.5px; }
	.bh .bh-sort { flex: 1 1 0; display: flex; }
	.bh .bh-sort__btn { width: 100%; }
	.bh .bh-sort__m { display: inline; }
	.bh .bh-filters__n { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding-inline: 5px; border-radius: 999px; background: var(--bh-coffee); font-size: 11px; color: #fff; }
	.bh .bh-sort__btn { white-space: nowrap; }
	/* Sort panel (8:6701): full width under the toolbar, with a header. */
	.bh .bh-resultbar { position: relative; }
	.bh .bh-sort { position: static; }
	.bh .bh-sort__menu { inset-inline: 20px; top: calc(100% + 6px); width: auto; }
	.bh .bh-sort__head { display: block; padding: 12px 16px 10px; border-bottom: 1px solid var(--bh-line); font-size: 16px; font-weight: 500 !important; color: var(--bh-coffee); }
	/* Filter sheet (8:6746): white, "Filters" title, 44px close, Clear + Show footer. */
	.bh .bh-filters, .bh .bh-filters__apply { background: #fff; }
	.bh .bh-filters__title { font-size: 17px; font-weight: 500 !important; letter-spacing: 0; text-transform: none; color: var(--bh-coffee); }
	.bh .bh-filters__head .bh-filters__clear { display: none; }
	.bh .bh-filters__close { width: 44px; height: 44px; }
	.bh .bh-filters__apply { display: flex; gap: 10px; }
	.bh .bh-filters__apply .bh-btn { display: inline-flex; align-items: center; justify-content: center; flex: 1; height: 50px; padding: 0 16px; border-radius: 999px; font-size: 12.5px; font-weight: 500 !important; letter-spacing: 1px; text-transform: uppercase; }
	.bh .bh-filters__apply .bh-btn--dark { flex: 1.6; background: var(--bh-coffee); color: #fff; }
	.bh .bh-filters__apply .bh-filters__clear-m { display: inline-flex; border: 1px solid #d8c7bb; background: #fff; color: var(--bh-coffee); }
}

@media (max-width: 780px) {
	/* Mobile cards (8:5802). */
	.bh .bh-grid { gap: 15px; }
	.bh .bh-grid .bh-card__img { height: 133px; }
	.bh .bh-grid .bh-card__img img { max-height: 110px; }
	.bh .bh-grid .bh-card__name { font-size: 13.5px; }
	.bh .bh-grid .bh-card__add { height: 40px; }
	/* Empty state on phones (8:6088): only "Clear filters" when filters are on. */
	.bh .bh-empty__all.is-secondary { display: none; }
}
