/* =========================================================================
   Pukka Header + Basket drawer
   Wireframe-stage styling: neutral surfaces, token-driven accents.
   Re-uses --pk-* variables from custom.css; all have safe fallbacks so
   the header renders even if custom.css hasn't loaded yet.
   ========================================================================= */

:root {
	--pk-header-h:        76px;   /* main bar height (desktop) */
	--pk-header-h-mobile: 60px;
	--pk-header-max:      1320px; /* content max-width */
	--pk-z-header:        900;
	--pk-z-drawer:        1000;
}

/* Skip link + screen-reader-only helper ----------------------------------- */
.pk-skip {
	position: absolute; left: 12px; top: -60px;
	z-index: calc(var(--pk-z-drawer) + 10);
	background: var(--pk-ink, #0F172A); color: #fff;
	padding: 10px 16px; border-radius: 8px; font-weight: 600;
	transition: top .15s ease;
}
.pk-skip:focus { top: 12px; }
.pk-sr-only {
	position: absolute !important; width: 1px; height: 1px;
	padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* =========================================================================
   Header shell
   ========================================================================= */
.pk-header {
	position: relative;
	z-index: var(--pk-z-header);
	background: #fff;
	border-bottom: 1px solid var(--pk-line, #E5E7EB);
	font-family: inherit;
	color: var(--pk-ink, #0F172A);
}
.pk-header * { box-sizing: border-box; }

/* Inner widths ------------------------------------------------------------ */
.pk-header__util-inner,
.pk-header__main-inner,
.pk-nav__inner {
	max-width: var(--pk-header-max);
	margin: 0 auto;
	padding: 0 24px;
	width: 100%;
}

/* ── Utility bar ─────────────────────────────────────────────────────── */
.pk-header__util {
	background: var(--pk-ink, #0F172A);
	color: #fff;
	font-size: 13px;
}
.pk-header__util-inner {
	display: flex; align-items: center; justify-content: space-between;
	min-height: 38px;
}
.pk-util__msg { margin: 0; display: inline-flex; align-items: center; gap: 8px; }
.pk-util__msg svg { width: 17px; height: 17px; opacity: .85; }
.pk-util__links { display: flex; align-items: center; gap: 22px; }
.pk-util__links a { color: rgba(255,255,255,.82); text-decoration: none; transition: color .15s ease; }
.pk-util__links a:hover { color: #fff; }
.pk-util__phone { font-weight: 600; }

/* ── Main bar ────────────────────────────────────────────────────────── */
.pk-header__main-inner {
	display: flex; align-items: center; gap: 20px;
	min-height: var(--pk-header-h);
}

/* Burger (mobile only) */
.pk-burger {
	display: none;
	width: 44px; height: 44px;
	align-items: center; justify-content: center;
	background: none; border: 0; cursor: pointer; padding: 0;
	color: var(--pk-ink, #0F172A); flex-shrink: 0;
}
.pk-burger__box { display: inline-flex; flex-direction: column; gap: 5px; width: 24px; }
.pk-burger__line { display: block; height: 2px; width: 100%; background: currentColor; border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }

/* Logo */
.pk-header__logo { flex-shrink: 0; display: inline-flex; align-items: center; }
.pk-header__logo img { height: 44px; width: auto; display: block; }

/* Search slot (grows to fill) */
.pk-header__search { flex: 1 1 auto; min-width: 0; max-width: 560px; }

/* Right actions */
.pk-header__actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-shrink: 0; }

/* Shared action button (account + basket) */
.pk-action {
	display: inline-flex; align-items: center; gap: 10px;
	background: none; border: 0; cursor: pointer;
	padding: 8px 12px; border-radius: var(--pk-radius-sm, 10px);
	color: var(--pk-ink, #0F172A); text-decoration: none;
	transition: background .15s ease;
	font: inherit;
}
.pk-action:hover { background: var(--pk-soft, #F3F4F6); }
.pk-action svg { width: 24px; height: 24px; flex-shrink: 0; }
.pk-action__label { display: inline-flex; flex-direction: column; line-height: 1.15; text-align: left; }
.pk-action__label small { font-size: 11px; color: var(--pk-mute, #6B7280); }
.pk-action__label strong { font-size: 14px; font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Account dropdown ────────────────────────────────────────────────── */
.pk-account { position: relative; }
.pk-account__menu {
	position: absolute; right: 0; top: calc(100% + 8px);
	min-width: 240px;
	background: #fff; border: 1px solid var(--pk-line, #E5E7EB);
	border-radius: var(--pk-radius, 16px);
	box-shadow: 0 16px 40px rgba(15,23,42,.12);
	padding: 8px; z-index: 5;
}
.pk-account__menu[hidden] { display: none; }
.pk-account__menu a {
	display: block; padding: 11px 14px; border-radius: var(--pk-radius-sm, 10px);
	color: var(--pk-ink, #0F172A); text-decoration: none; font-size: 14.5px;
	transition: background .12s ease;
}
.pk-account__menu a:hover { background: var(--pk-soft, #F3F4F6); }
.pk-account__cta { font-weight: 600; text-align: center; background: var(--pk-teal, #0E6B6B); color: #fff !important; margin-bottom: 6px; }
.pk-account__cta:hover { background: var(--pk-teal-dark, #0A5454) !important; }
.pk-account__cta--ghost { background: transparent; color: var(--pk-teal, #0E6B6B) !important; border: 1px solid var(--pk-line, #E5E7EB); }
.pk-account__cta--ghost:hover { background: var(--pk-soft, #F3F4F6) !important; }
.pk-account__rule { border: 0; border-top: 1px solid var(--pk-line, #E5E7EB); margin: 8px 4px; }

/* ── Basket button + badge ───────────────────────────────────────────── */
.pk-basket__icon { position: relative; display: inline-flex; }
.pk-basket__count {
	position: absolute; top: -7px; right: -8px;
	min-width: 19px; height: 19px; padding: 0 5px;
	display: inline-flex; align-items: center; justify-content: center;
	background: var(--pk-red, #EF4444); color: #fff;
	font-size: 11px; font-weight: 700; line-height: 1;
	border-radius: 999px; border: 2px solid #fff;
}
.pk-basket__count.is-empty { display: none; }

/* ── Primary nav (desktop) ───────────────────────────────────────────── */
.pk-nav { border-top: 1px solid var(--pk-line, #E5E7EB); background: #fff; }
.pk-nav__list { display: flex; align-items: stretch; gap: 4px; list-style: none; margin: 0; padding: 0; }
.pk-nav__item { position: relative; }
.pk-nav__link {
	display: inline-flex; align-items: center; gap: 5px;
	padding: 14px 14px; font-size: 15px; font-weight: 500;
	color: var(--pk-ink, #0F172A); text-decoration: none;
	border-bottom: 2px solid transparent; transition: color .15s ease, border-color .15s ease;
}
.pk-nav__link:hover,
.pk-nav__item.is-active > .pk-nav__link { color: var(--pk-teal, #0E6B6B); }
.pk-nav__item.is-active > .pk-nav__link { border-bottom-color: var(--pk-teal, #0E6B6B); }
.pk-nav__caret { width: 15px; height: 15px; transition: transform .2s ease; }
.pk-nav__item--offers .pk-nav__link { color: var(--pk-red, #EF4444); font-weight: 600; }

/* Dropdown panel */
.pk-nav__panel {
	position: absolute; left: 0; top: 100%;
	min-width: 240px;
	background: #fff; border: 1px solid var(--pk-line, #E5E7EB);
	border-radius: 0 0 var(--pk-radius, 16px) var(--pk-radius, 16px);
	box-shadow: 0 18px 44px rgba(15,23,42,.13);
	padding: 10px; z-index: 6;
	opacity: 0; visibility: hidden; transform: translateY(6px);
	transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.pk-nav__item.has-children:hover > .pk-nav__panel,
.pk-nav__item.has-children:focus-within > .pk-nav__panel,
.pk-nav__panel.is-open {
	opacity: 1; visibility: visible; transform: translateY(0);
}
.pk-nav__item.has-children:hover > .pk-nav__link .pk-nav__caret { transform: rotate(180deg); }
.pk-nav__sublist { list-style: none; margin: 0; padding: 0; }
.pk-nav__subitem a {
	display: block; padding: 9px 12px; border-radius: var(--pk-radius-sm, 10px);
	font-size: 14.5px; color: var(--pk-ink, #0F172A); text-decoration: none;
	transition: background .12s ease, color .12s ease;
}
.pk-nav__subitem a:hover { background: var(--pk-soft, #F3F4F6); color: var(--pk-teal, #0E6B6B); }
.pk-nav__subitem.is-active a { color: var(--pk-teal, #0E6B6B); font-weight: 600; }
.pk-nav__subitem--all a { font-weight: 600; color: var(--pk-teal, #0E6B6B); }
.pk-nav--empty .pk-nav__inner { padding: 12px 24px; font-size: 13px; color: var(--pk-mute, #6B7280); }

/* ── Sticky / condensed on scroll ────────────────────────────────────── */
.pk-header[data-sticky="yes"].is-stuck {
	position: sticky; top: 0;
	box-shadow: 0 6px 24px rgba(15,23,42,.08);
}
.pk-header.is-stuck .pk-header__util { display: none; }
.pk-header.is-stuck .pk-header__main-inner { min-height: 64px; }
.pk-header.is-stuck .pk-header__logo img { height: 38px; }

/* =========================================================================
   Basket drawer
   ========================================================================= */
.pk-cart { position: fixed; inset: 0; z-index: var(--pk-z-drawer); }
.pk-cart[hidden] { display: none; }
.pk-cart__backdrop {
	position: absolute; inset: 0; background: rgba(15,23,42,.45);
	opacity: 0; transition: opacity .25s ease;
}
.pk-cart.is-open .pk-cart__backdrop { opacity: 1; }
.pk-cart__panel {
	position: absolute; top: 0; right: 0; height: 100%;
	width: min(420px, 92vw);
	background: #fff; display: flex; flex-direction: column;
	transform: translateX(100%); transition: transform .28s cubic-bezier(.4,0,.2,1);
	box-shadow: -10px 0 40px rgba(15,23,42,.15);
}
.pk-cart.is-open .pk-cart__panel { transform: translateX(0); }

.pk-cart__head {
	display: flex; align-items: center; justify-content: space-between;
	padding: 18px 20px; border-bottom: 1px solid var(--pk-line, #E5E7EB);
}
.pk-cart__title { margin: 0; font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.pk-cart__head-count {
	font-size: 12px; font-weight: 700; background: var(--pk-soft, #F3F4F6);
	color: var(--pk-mute, #6B7280); padding: 2px 9px; border-radius: 999px;
}
.pk-cart__close {
	width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
	background: var(--pk-soft, #F3F4F6); border: 0; border-radius: 50%; cursor: pointer;
	color: var(--pk-ink, #0F172A);
}
.pk-cart__close svg { width: 18px; height: 18px; }
.pk-cart__close:hover { background: #e7e9ee; }

.pk-cart__body { flex: 1 1 auto; overflow-y: auto; padding: 18px 20px; }

/* Free-delivery progress */
.pk-cart__ship { margin-bottom: 18px; }
.pk-cart__ship-msg { margin: 0 0 8px; font-size: 13.5px; color: var(--pk-ink, #0F172A); }
.pk-cart__ship-msg strong { color: var(--pk-teal, #0E6B6B); }
.pk-cart__ship-msg--won strong { color: var(--pk-green, #10B981); }
.pk-cart__ship-bar { height: 7px; background: var(--pk-soft, #F3F4F6); border-radius: 999px; overflow: hidden; }
.pk-cart__ship-bar span { display: block; height: 100%; background: var(--pk-teal, #0E6B6B); border-radius: 999px; transition: width .4s ease; }

/* Line items */
.pk-cart__items { list-style: none; margin: 0; padding: 0; }
.pk-cart__item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--pk-line, #E5E7EB); position: relative; }
.pk-cart__thumb { flex-shrink: 0; width: 64px; height: 64px; border-radius: var(--pk-radius-sm, 10px); overflow: hidden; background: var(--pk-soft, #F3F4F6); }
.pk-cart__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pk-cart__detail { flex: 1 1 auto; min-width: 0; padding-right: 24px; }
.pk-cart__name { display: block; font-size: 14px; font-weight: 600; color: var(--pk-ink, #0F172A); text-decoration: none; line-height: 1.3; }
.pk-cart__name:hover { color: var(--pk-teal, #0E6B6B); }
.pk-cart__meta {
	margin: 3px 0 0;
	font-size: 12px;
	line-height: 1.4;
	color: var(--pk-teal, #0E6B6B);
	font-weight: 600;
}
.pk-cart__meta dl,
.pk-cart__meta p { margin: 0; }
.pk-cart__meta dt { font-weight: 600; display: inline; }
.pk-cart__meta dd { display: inline; margin: 0 0 0 4px; font-weight: 500; color: var(--pk-mute, #6B7280); }
.pk-cart__price { font-size: 13px; color: var(--pk-mute, #6B7280); margin: 5px 0 8px; }
.pk-cart__qty { display: inline-flex; align-items: center; border: 1px solid var(--pk-line, #E5E7EB); border-radius: 999px; overflow: hidden; }
.pk-cart__qty-btn { width: 28px; height: 28px; border: 0; background: #fff; cursor: pointer; font-size: 15px; color: var(--pk-ink, #0F172A); line-height: 1; }
.pk-cart__qty-btn:hover { background: var(--pk-soft, #F3F4F6); }
.pk-cart__qty-val { min-width: 30px; text-align: center; font-size: 13.5px; font-weight: 600; }
.pk-cart__change {
	display: inline-block;
	margin-top: 8px;
	font-size: 12px;
	font-weight: 600;
	color: var(--pk-teal, #0E6B6B);
	text-decoration: none;
	border-bottom: 1px solid transparent;
}
.pk-cart__change:hover { border-bottom-color: currentColor; }
.pk-cart.is-loading { cursor: progress; }
.pk-cart.is-loading .pk-cart__body { opacity: .6; pointer-events: none; transition: opacity .15s ease; }

.pk-cart__remove { position: absolute; top: 14px; right: 0; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; cursor: pointer; color: var(--pk-mute, #6B7280); border-radius: 6px; }
.pk-cart__remove:hover { color: var(--pk-red, #EF4444); background: var(--pk-soft, #F3F4F6); }
.pk-cart__remove svg { width: 16px; height: 16px; }

/* Empty state */
.pk-cart__empty { text-align: center; padding: 50px 20px; color: var(--pk-mute, #6B7280); }
.pk-cart__empty svg { width: 52px; height: 52px; opacity: .4; margin-bottom: 14px; }
.pk-cart__empty p { margin: 0 0 18px; font-size: 15px; }
.pk-cart__shop { display: inline-block; background: var(--pk-teal, #0E6B6B); color: #fff; text-decoration: none; padding: 11px 22px; border-radius: var(--pk-radius-sm, 10px); font-weight: 600; }
.pk-cart__shop:hover { background: var(--pk-teal-dark, #0A5454); }

/* Drawer footer */
.pk-cart__foot:empty { display: none; }
.pk-cart__foot { padding: 18px 20px; border-top: 1px solid var(--pk-line, #E5E7EB); background: #fff; }
.pk-cart__summary-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 16px; }
.pk-cart__summary-row strong { font-size: 19px; font-weight: 800; }
.pk-cart__summary-note { margin: 4px 0 14px; font-size: 12px; color: var(--pk-mute, #6B7280); }
.pk-cart__cta { display: flex; gap: 10px; }
.pk-cart__btn { flex: 1 1 50%; text-align: center; padding: 13px 16px; border-radius: var(--pk-radius-sm, 10px); font-weight: 600; text-decoration: none; font-size: 14.5px; transition: background .15s ease; }
.pk-cart__btn--ghost { background: var(--pk-soft, #F3F4F6); color: var(--pk-ink, #0F172A); }
.pk-cart__btn--ghost:hover { background: #e7e9ee; }
.pk-cart__btn--primary { background: var(--pk-teal, #0E6B6B); color: #fff; }
.pk-cart__btn--primary:hover { background: var(--pk-teal-dark, #0A5454); }

/* =========================================================================
   Responsive — tablet & mobile
   ========================================================================= */
@media (max-width: 1024px) {
	.pk-header__util-inner { padding: 0 16px; }
	.pk-header__main-inner,
	.pk-nav__inner { padding: 0 16px; }
	.pk-account__label,
	.pk-action__label { display: none; }   /* icons-only actions to save room */
	.pk-action { padding: 8px; }
}

@media (max-width: 860px) {
	/* Switch to mobile header: burger + logo + search-icon + basket. */
	.pk-burger { display: inline-flex; }
	.pk-nav { display: none; }                  /* full nav lives in the drawer */
	.pk-header__util { display: none; }         /* keep mobile chrome tight */
	.pk-account { display: none; }              /* sign-in lives in the drawer */
	.pk-header__main-inner { min-height: var(--pk-header-h-mobile); gap: 10px; }
	.pk-header__logo { margin-right: auto; }
	.pk-header__logo img { height: 36px; }

	/* Search collapses to an icon that expands to a full-width overlay.
	   header-search.css already provides the .pk-search mobile behaviour;
	   here we just let it sit inline as an icon, not flex-grow. */
	.pk-header__search { flex: 0 0 auto; max-width: none; }
}

@media (max-width: 380px) {
	.pk-header__main-inner { gap: 4px; }
	.pk-header__logo img { height: 32px; }
}

/* Reduced-motion: kill transitions for users who ask. */
@media (prefers-reduced-motion: reduce) {
	.pk-cart__panel, .pk-cart__backdrop, .pk-nav__panel, .pk-cart__ship-bar span { transition: none !important; }
}
