/* talha/header — desktop shell from D-Home, phone header from Home. */

/* ---------- Desktop: utility bar ---------- */
.util { background: #0B2E2F; color: #fff; font-size: 14px; }
.util .wrap { height: 44px; display: flex; align-items: center; gap: 32px; }
.util-i { display: flex; align-items: center; gap: 8px; opacity: .92; white-space: nowrap; }
.util-sp { flex-grow: 1; }
/* INTERACTIONS §3: utility links on dark rest at 85% opacity (the spec wins over the board's 100%). */
.util-a { min-height: 44px; display: flex; align-items: center; text-decoration: none; font-weight: 600; white-space: nowrap; opacity: .85; }
/* Full opacity while focused, so the Sunflower ring isn't dimmed with the link. The inset ring sits in 6px of
   padding (cancelled by the negative margin, so nothing moves), clear of the first and last letters. Only while
   focused, so the resting box stays the board's. */
.util-a:focus-visible { outline-offset: -3px; opacity: 1; padding-inline: 6px; margin-inline: -6px; }

/* ---------- Desktop: header row ---------- */
.hdr { background: #0F3D3E; color: #fff; }
.hdr .wrap { height: 88px; display: flex; align-items: center; gap: 32px; }
.hdr .logo { display: flex; align-items: center; gap: 12px; text-decoration: none; border-radius: 8px; flex-shrink: 0; position: relative; }
/* The logo is ONE image (End phase): the plug mark and the outlined "Talha Tariq Store" wordmark
   (brand/lockup.py). Each size keeps the boards' box to the pixel: desktop 62x52 mark + 20px/800 name,
   phone 48x40 mark + 16px/800 name, 12px apart. */
.logo-img { display: block; flex-shrink: 0; max-width: none; }
.logo-img--lg { width: 283.16px; height: 52px; }
.logo-img--sm { width: 227.33px; height: 40px; }
/* Forced colours: the band may turn white, and the lockup is white; keep it on its own Petrol. */
@media (forced-colors: active) { .logo-img { forced-color-adjust: none; background: #0F3D3E; border-radius: 4px; } }
/* Hover and press (INTERACTIONS §3): the name's underline, now a bar under the wordmark only, 4px below
   its baseline (where the text underline sat). Desktop: wordmark x 74, baseline 33 in the 52px link. */
.hdr .logo::after, .mhd .logo::after {
	content: ""; position: absolute; left: 74px; top: 37px; width: 209.16px; height: 2px; border-radius: 1px;
	background: currentColor; opacity: 0; pointer-events: none;
}
.dsearch {
	flex-grow: 1; min-width: 0; height: 52px; margin: 0; box-sizing: border-box; position: relative;
	background: #fff; border-radius: 12px; display: flex; align-items: center; gap: 12px;
	padding: 0 4px 0 16px; color: #3D4A49; font-size: 16px; cursor: text;
	transition: box-shadow var(--wp--custom--motion, 120ms) ease-out;
}
/* The field's <label> covers the whole white box (its text stays screen-reader only), so a tap
   anywhere in the box, icon and padding included, focuses the field: the target is the full
   48/52px box, not just the input strip. The input and button sit above it. */
.search-lbl { position: absolute; inset: 0; border-radius: inherit; cursor: text; }
.dsearch-in, .search-in, .dsearch-btn, .search-go { position: relative; }
/* padding-bottom 2px lifts the text 1px, onto the board's placeholder baseline (measured). */
.dsearch-in, .search-in {
	flex-grow: 1; min-width: 0; margin: 0; padding: 0 0 2px; border: 0; border-radius: 6px;
	background: transparent; color: #101A1A; font: inherit; font-size: 16px; line-height: 22px;
	-webkit-appearance: none; appearance: none;
}
.dsearch-in { height: 40px; }
.dsearch-in::placeholder, .search-in::placeholder { color: #3D4A49; opacity: 1; }
/* Chrome and Safari draw their own small blue "x" in a search field with text (on hover or focus):
   off-palette, under 44px and without the spec's states. Search pages have the theme's 44px
   "Clear search" (.clear) instead; other pages need none. */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.dsearch-btn {
	flex-shrink: 0; height: 44px; padding: 0 20px; border: 0; border-radius: 8px; background: #101A1A; color: #FFC23C;
	display: flex; align-items: center; gap: 8px; font: inherit; font-weight: 800; font-size: var(--wp--preset--font-size--sm-plus); cursor: pointer;
}
.hdr-a {
	white-space: nowrap; height: 48px; padding: 0 12px; border-radius: 12px; display: flex; align-items: center; gap: 8px;
	text-decoration: none; font-weight: 700; font-size: var(--wp--preset--font-size--sm-plus); position: relative; flex-shrink: 0;
}
.hdr-cart-t { margin-left: 8px; }
.hdr .badge, .mhd .badge {
	position: absolute; top: 2px; background: #FFC23C; color: #101A1A; font-size: 12px; font-weight: 800;
	border-radius: 10px; min-width: 20px; height: 20px; padding: 0 6px; box-sizing: border-box;
	display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #0F3D3E;
}
.hdr .badge { left: 26px; }
.hdr .badge[hidden], .mhd .badge[hidden] { display: none; }
/* Badge bump (§1, §2): 1 -> 1.25 -> 1 over 150ms when the count changes. The cart store (Task 5)
   updates the count, then sets data-bump on .badge (remove it and force a reflow first to replay).
   Reduced motion: the global rule in interactions.css turns the animation off. */
.hdr .badge[data-bump], .mhd .badge[data-bump] { animation: ts-badge-bump 150ms ease-out; }
@keyframes ts-badge-bump { 50% { transform: scale(1.25); } }

/* ---------- Phone header ---------- */
/* Own stacking layer: the search box's focus halo and the submit button's ring reach past the
   header's bottom edge, and <main> would otherwise paint over them. */
.mhd { background: #0F3D3E; color: #fff; position: relative; z-index: 1; }
.mhd-row { padding: 8px 6px 0 14px; display: flex; align-items: center; gap: 12px; }
.mhd .logo { display: flex; align-items: center; gap: 12px; flex-grow: 1; min-height: 44px; text-decoration: none; border-radius: 8px; position: relative; }
/* Phone: wordmark x 60, baseline 27 in the 44px link (the 40px image sits 2px down). */
.mhd .logo::after { left: 60px; top: 31px; width: 167.33px; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; position: relative; flex-shrink: 0; }
.mhd .badge { right: 0; }
.msearch { padding: 12px 16px 0; }
form.search {
	height: 48px; margin: 0; box-sizing: border-box; background: #fff; border-radius: 12px;
	display: flex; align-items: center; gap: 12px; padding: 0 4px 0 16px; color: #3D4A49; font-size: 16px; cursor: text;
	position: relative; transition: box-shadow var(--wp--custom--motion, 120ms) ease-out;
}
.search-in { height: 36px; }
/* 44px tap target around the board's 40px square. */
.search-go {
	flex-shrink: 0; width: 44px; height: 44px; margin: 0 -2px; padding: 0; border: 0; border-radius: 10px;
	background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.search-btn { width: 40px; height: 40px; border-radius: 8px; background: #101A1A; display: flex; align-items: center; justify-content: center; }

/* Listing pages (Category and Search boards): back, a 44px search field and the cart; the Search board's
   field is 48px with a clear button and no cart. INTERACTIONS §9: a real search form with a submit
   button (the boards draw none here; the spec wins), Home's dark square at the field's right end. */
.mhd--back .mhd-row { padding: 8px 4px; gap: 4px; }
.mhd--search .mhd-row { padding: 8px 16px 8px 4px; }
form.search--bar { flex-grow: 1; min-width: 0; height: 44px; gap: 8px; padding: 0 12px; }
.mhd--search form.search--bar { height: 48px; padding: 0 2px 0 12px; }
form.search--bar .search-in { height: 40px; }
/* 44px button in the 44px field: a 36px square, 4px of white round it. */
form.search--bar .search-go { margin: 0 -12px 0 0; }
.mhd--search form.search--bar .search-go { margin: 0; }
form.search--bar .search-btn { width: 36px; height: 36px; }
.mhd--search form.search--bar .search-btn { width: 40px; height: 40px; }
.clear {
	flex-shrink: 0; width: 44px; height: 44px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
	position: relative; color: #101A1A; text-decoration: none;
}
.clear[hidden] { display: none; }
.mhd--back .icon-btn { color: #fff; }

/* ---------- States (INTERACTIONS §2–3) ---------- */
@media (hover: hover) and (pointer: fine) {
	.util-a:hover { text-decoration: underline; text-underline-offset: 3px; opacity: 1; }
	/* Field hover (D-Home/Home boards: 2px Sunflower on the whole box). Not while the pointer is on the box's
	   own buttons (Search, Clear search): those show their own hover only. :where() keeps this below the
	   focus halo's specificity, so hover never thins the 3px focus halo. */
	.dsearch:hover:where(:not(:has(.dsearch-btn:hover, .clear:hover))),
	form.search:hover:where(:not(:has(.search-go:hover, .clear:hover))) { box-shadow: 0 0 0 2px #FFC23C; }
	.hdr-a:hover, .icon-btn:hover { background: #134A4B; }
	.hdr .logo:hover::after, .mhd .logo:hover::after { opacity: 1; }
	.dsearch-btn:hover, .search-go:hover .search-btn { background: #1E2B2B; }
	.clear:hover { background: #E3EBE6; }
}
.clear:active { background: #E3EBE6; transform: scale(.97); }
/* ONE focus indication for the search box: its 3px Sunflower halo whenever the input has focus (mouse, tap
   or keyboard) and while the keyboard is on the Search or Clear button inside it (:focus-visible only, so a
   mouse press or tap on a button leaves nothing, §1). Nothing inside the box draws the global Ink outline:
   on the Ink Search button it read as a doubled black box (review p2-product-r1). The focused button shows
   its own cue instead: Search gets a 2px Sunflower line inside its Ink face, Clear the pale hover fill with
   a 2px Ink line inside it. The outlines stay, transparent, for forced-colours mode. */
.dsearch-in:focus-visible, .search-in:focus-visible, .dsearch-in:focus, .search-in:focus { outline: none; }
.dsearch:has(.dsearch-in:focus), form.search:has(.search-in:focus),
.dsearch:has(:focus-visible), form.search:has(:focus-visible) { box-shadow: 0 0 0 3px #FFC23C; }
.clear:focus-visible { outline-color: transparent; outline-offset: -3px; background: #E3EBE6; box-shadow: inset 0 0 0 2px #101A1A; }
.util-a:active { text-decoration: underline; text-underline-offset: 3px; opacity: 1; }
.hdr .logo:active::after, .mhd .logo:active::after { opacity: 1; }
.hdr .logo:active, .mhd .logo:active { transform: scale(.97); }
.hdr-a:active, .icon-btn:active { background: #134A4B; transform: scale(.97); }
.dsearch-btn:active { background: #000; transform: scale(.97); }
.search-go:active { transform: scale(.97); }
.search-go:active .search-btn { background: #000; }
.icon-btn:focus-visible { outline-offset: -3px; }
/* Search button keyboard focus: the Sunflower line sits on the Ink face (desktop button, phone square), so it
   reads as the button's own state, not a second box. Offsets only place the forced-colours outline. */
.dsearch-btn:focus-visible { outline-color: transparent; outline-offset: -3px; box-shadow: inset 0 0 0 2px #FFC23C; }
.search-go:focus-visible { outline-color: transparent; outline-offset: -1px; }
form.search--bar .search-go:focus-visible { outline-offset: -3px; }
.mhd--search form.search--bar .search-go:focus-visible { outline-offset: -1px; }
.search-go:focus-visible .search-btn { box-shadow: inset 0 0 0 2px #FFC23C; }

/* Narrower desktops (no board at this width): give the search field room for its
   placeholder. Kept last so it overrides the base rules above. */
@media (max-width: 1199.98px) {
	.hdr .wrap { gap: 16px; }
	.hdr-a { padding: 0 8px; }
	.dsearch-btn { padding: 0 16px; }
}

/* ---------- Search suggestions (script module talha-store/search; INTERACTIONS §0, §9) ---------- */
/* Desktop: a white panel the field's width, 8px under it, above the category nav (z 5) and the mega
   menu. Phone: full width under the header (.mhd), scrolling when tall; the script caps its height
   above the fixed bottom nav. Rows are 44px+ links (role=option). One highlight at a time: the arrow keys
   and the mouse both move the active row (aria-selected, Tint fill and a Petrol inner bar). */
.sugg {
	position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 30; box-sizing: border-box;
	margin: 0; padding: 6px; background: #fff; color: #101A1A; border-radius: 12px;
	box-shadow: 0 0 0 1px #D5DCD6, 0 12px 32px rgba(16, 26, 26, .28);
	overflow-y: auto; overscroll-behavior: contain; cursor: default; text-align: left;
	font-size: 15px; line-height: 20px; font-weight: 400;
}
.sugg[hidden] { display: none; }
/* Phone: flush under the header's petrol band, edge to edge. */
.sugg--full { top: 100%; border-radius: 0 0 12px 12px; padding: 6px 8px 8px; box-shadow: 0 12px 24px rgba(16, 26, 26, .28); }
/* Lift the open phone header (and its panel) over the page below it; still under the bottom nav (50). */
.mhd.has-sugg { z-index: 40; }
.sugg-g + .sugg-g { margin-top: 4px; padding-top: 4px; box-shadow: inset 0 1px 0 #D5DCD6; }
.sugg-h { padding: 8px 10px 4px; font-size: 13px; line-height: 16px; font-weight: 800; color: #3D4A49; }
.sugg-o {
	display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 4px 10px; box-sizing: border-box;
	border-radius: 8px; color: #101A1A; text-decoration: none; cursor: pointer; outline: none;
}
.sugg-o[aria-selected="true"] { background: #E3EBE6; box-shadow: inset 3px 0 0 #0F3D3E; }
.sugg-o:active { background: #D5DCD6; }
.sugg-m {
	width: 40px; height: 40px; flex-shrink: 0; border-radius: 6px; overflow: hidden; background: #F3F1EA;
	display: flex; align-items: center; justify-content: center;
}
.sugg-m img { width: 40px; height: 40px; object-fit: contain; display: block; }
.sugg-t {
	flex: 1 1 auto; min-width: 0; overflow: hidden;
	display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
}
.sugg-t small { font-size: 13px; color: #3D4A49; }
.sugg-pr { flex-shrink: 0; font-weight: 800; white-space: nowrap; }
.sugg-pr small { font-size: 13px; font-weight: 600; color: #3D4A49; }
.sugg-all { margin-top: 4px; font-weight: 700; }
.sugg-g + .sugg-all { box-shadow: inset 0 1px 0 #D5DCD6; border-radius: 0 0 8px 8px; }
.sugg-g + .sugg-all[aria-selected="true"] { box-shadow: inset 3px 0 0 #0F3D3E, inset 0 1px 0 #D5DCD6; }
.sugg-all .sugg-t { text-decoration: underline; text-underline-offset: 3px; }
.sugg-none { padding: 10px; }
.sugg-none .sugg-t { display: flex; flex-direction: column; gap: 2px; }
.sugg-wa { display: flex; align-items: center; gap: 6px; align-self: flex-start; color: #0E7A3F; font-weight: 700; }
.sugg-wa svg { flex-shrink: 0; }
.sugg-wa-t { text-decoration: underline; text-underline-offset: 3px; }
