/* Site header (markup: functions/includes/site_header.php, behaviour: themes/js/site-header.js).
   Navy like the footer: the logo's wordmark is white, so it needs the dark background.
   Layout: desktop (992px+) = slim strip, main bar (logo, search, account, cart), nav row - the strip scrolls away
   and the rest sticks. Below 992px = menu button, logo, account, cart; then a full-width search row; menus move
   into the slide-in drawer. */

:root {
  --sh-navy: var(--bg-navyblue, #252b61);
  --sh-navy-dark: #1d2250;
  --sh-accent: #c008b7;
  --sh-accent-soft: #f08ae9;
  --sh-strip-h: 34px;
  --sh-sticky-h: 112px; /* main bar + nav row: what stays on screen while scrolling */
}
@media (max-width: 991.98px) {
  :root { --sh-strip-h: 0px; --sh-sticky-h: 116px; }
}

/* Anchored sections and the cart summary must not hide under the sticky header */
html { scroll-padding-top: calc(var(--sh-sticky-h) + 12px); }
@media (min-width: 992px) {
  .cart-summary { top: calc(var(--sh-sticky-h) + 16px) !important; }
}

.sh-header {
  position: sticky;
  top: calc(-1 * var(--sh-strip-h));
  z-index: 1000;
  background: var(--sh-navy);
  color: #fff;
  font-size: 14px;
  transition: box-shadow 0.2s;
}
.sh-header.is-stuck { box-shadow: 0 6px 18px rgba(16, 20, 60, 0.28); }
.sh-header ul { list-style: none; margin: 0; padding: 0; }
.sh-header a { color: inherit; text-decoration: none; }
.sh-header a:hover { color: #fff; }
.sh-header :focus-visible,
.sh-drawer :focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 6px; }
.sh-suggest :focus-visible, .sh-menu :focus-visible, .sh-panel :focus-visible,
.sh-search :focus-visible, .sh-drawer-body :focus-visible, .sh-drawer-contact :focus-visible { outline-color: var(--sh-navy); outline-offset: -2px; }
.sh-header button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.sh-wrap { padding-left: 20px; padding-right: 20px; }
.sh-chev { font-size: 16px; margin-left: 2px; transition: transform 0.15s; }
[aria-expanded="true"] > .sh-chev { transform: rotate(180deg); }

/* ---------- Slim strip (desktop only) */
.sh-strip { background: var(--sh-navy-dark); font-size: 12.5px; color: rgba(255, 255, 255, 0.8); }
.sh-strip-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--sh-strip-h); }
.sh-points, .sh-strip-links { display: flex; gap: 22px; white-space: nowrap; }
.sh-points li, .sh-strip-links a { display: inline-flex; align-items: center; gap: 6px; }
.sh-points .mdi, .sh-strip-links .mdi { font-size: 15px; color: var(--sh-accent-soft); }
.sh-strip-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 1199.98px) { .sh-points li:nth-child(3) { display: none; } }
@media (max-width: 991.98px) { .sh-strip { display: none; } }

/* ---------- Main bar */
.sh-main-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "logo search actions";
  align-items: center;
  gap: 12px 28px;
  min-height: 66px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.sh-logo { grid-area: logo; display: inline-flex; align-items: center; flex: none; }
.sh-logo img { height: 40px; width: auto; display: block; }
.sh-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 26px;
}
.sh-icon-btn:hover { background: rgba(255, 255, 255, 0.12); }
.sh-main-row .sh-menu-btn { grid-area: menu; display: none; } /* the drawer's button: below 992px only */

/* Search pill: [input][magnifier][Ask AI] */
.sh-search {
  grid-area: search;
  position: relative;
  display: flex;
  align-items: center;
  max-width: 760px;
  width: 100%;
  justify-self: center;
  background: #fff;
  border-radius: 999px;
  padding: 4px 4px 4px 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.sh-search:focus-within { box-shadow: 0 0 0 3px rgba(240, 138, 233, 0.55); }
.sh-search-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 38px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #1f2233;
  font-size: 15px;
}
.sh-search-input::placeholder { color: #8a8fa0; }
.sh-search .sh-search-input:focus-visible { outline: none; } /* the pill's :focus-within ring shows focus */
.sh-search-input::-webkit-search-cancel-button { cursor: pointer; }
.sh-header .sh-search-go {
  flex: none;
  width: 40px;
  height: 38px;
  color: #4a4f63;
  font-size: 22px;
  border-radius: 50%;
}
.sh-header .sh-search-go:hover { color: var(--sh-navy); background: #f1f2f7; }
.sh-header .sh-ai {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #c008b7, #7b2ff7);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}
.sh-header .sh-ai:hover { filter: brightness(1.08); }
.sh-ai .mdi { font-size: 18px; }

/* Account + cart */
.sh-actions { grid-area: actions; display: flex; align-items: center; gap: 6px; }
.sh-header .sh-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 42px;
  padding: 0 12px;
  border-radius: 999px;
  white-space: nowrap;
  font-weight: 600;
}
.sh-header .sh-action:hover,
.sh-header .sh-action[aria-expanded="true"] { background: rgba(255, 255, 255, 0.12); }
.sh-action > .mdi:first-child, .sh-cart .mdi { font-size: 24px; line-height: 1; }
.sh-cart .cart-icon-wrap { display: inline-flex; }
.sh-cart[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--sh-accent-soft); border-radius: 0; }
.sh-action-text { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Search suggestions */
.sh-suggest {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: min(70vh, 560px);
  overflow-y: auto;
  background: #fff;
  color: #1f2233;
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(16, 20, 60, 0.25);
  padding: 6px;
  text-align: left;
}
.sh-sg-head { margin: 8px 10px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #8a8fa0; }
.sh-header .sh-sg-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 10px;
  border-radius: 10px;
  color: #1f2233;
}
.sh-header .sh-sg-item:hover,
.sh-header .sh-sg-item.is-active { background: #f1f2f7; color: #1f2233; }
.sh-sg-img { flex: none; width: 44px; height: 44px; border-radius: 8px; background: #f4f5f9; object-fit: contain; }
.sh-sg-noimg { display: inline-flex; align-items: center; justify-content: center; font-size: 22px; color: #b4b8c6; }
.sh-sg-text { min-width: 0; flex: 1 1 auto; }
.sh-sg-title { display: block; font-size: 14px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-sg-title mark { background: none; color: inherit; font-weight: 700; padding: 0; }
.sh-sg-meta { display: block; font-size: 13px; color: #6b7080; }
.sh-sg-price { color: #0b7a31; font-weight: 700; }
.sh-sg-was { text-decoration: line-through; margin-left: 6px; }
.sh-sg-out { color: #d62d4b; margin-left: 6px; }
.sh-sg-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 10px 8px; }
.sh-header .sh-sg-chip {
  padding: 5px 12px;
  border-radius: 999px;
  background: #f1f2f7;
  color: #1f2233;
  font-size: 13px;
}
.sh-header .sh-sg-chip:hover,
.sh-header .sh-sg-chip.is-active { background: var(--sh-navy); color: #fff; }
.sh-sg-actions { border-top: 1px solid #e9ebf1; margin-top: 6px; padding-top: 6px; }
.sh-sg-actions .mdi { flex: none; width: 44px; text-align: center; font-size: 20px; color: var(--sh-navy); }
.sh-sg-actions .sh-sg-ai .mdi { color: var(--sh-accent); }
.sh-sg-empty { padding: 10px; color: #6b7080; font-size: 14px; }

/* ---------- Nav row (desktop) */
.sh-nav { border-top: 1px solid rgba(255, 255, 255, 0.12); }
.sh-nav-row { display: flex; align-items: center; gap: 8px; height: 46px; }
.sh-links { display: flex; align-items: center; gap: 2px; min-width: 0; overflow: hidden; }
.sh-links-end { margin-left: auto !important; overflow: visible; flex: none; }
.sh-links > li > a,
.sh-header .sh-link-btn {
  display: inline-flex;
  align-items: center;
  height: 46px;
  padding: 0 12px;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 500;
}
.sh-links > li > a:hover,
.sh-header .sh-link-btn:hover,
.sh-header .sh-link-btn[aria-expanded="true"] { color: #fff; background: rgba(255, 255, 255, 0.08); }
.sh-links > li > a[aria-current="page"],
.sh-header .sh-link-btn.is-active { color: #fff; box-shadow: inset 0 -3px 0 var(--sh-accent-soft); }
.sh-header .sh-cats-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  margin-right: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}
.sh-header .sh-cats-btn:hover,
.sh-header .sh-cats-btn[aria-expanded="true"] { background: #fff; color: var(--sh-navy); }
.sh-cats-btn .mdi:first-child { font-size: 18px; }
@media (max-width: 991.98px) { .sh-nav { display: none; } }

/* Dropdown menus (About, Help, account) */
.sh-dd { position: relative; }
.sh-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  min-width: 210px;
  padding: 6px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(16, 20, 60, 0.25);
}
.sh-menu-end { left: auto; right: 0; }
.sh-header .sh-menu a { display: block; padding: 9px 12px; border-radius: 8px; color: #1f2233; white-space: nowrap; }
.sh-header .sh-menu a:hover { background: #f1f2f7; color: #1f2233; }
.sh-header .sh-menu a[aria-current="page"] { color: var(--sh-accent); font-weight: 600; }

/* All categories panel */
.sh-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  width: min(880px, calc(100vw - 40px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 24px;
  padding: 20px;
  background: #fff;
  color: #1f2233;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(16, 20, 60, 0.3);
}
.sh-panel[hidden] { display: none; }
.sh-panel-head { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #8a8fa0; }
.sh-panel-cats ul { columns: 3 170px; column-gap: 18px; }
.sh-panel-cats li { break-inside: avoid; }
.sh-header .sh-panel-cats a {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  color: #1f2233;
}
.sh-header .sh-panel-cats a:hover { background: #f1f2f7; color: var(--sh-navy); }
.sh-header .sh-panel-cats a[aria-current="page"] { color: var(--sh-accent); font-weight: 600; }
.sh-count { color: #8a8fa0; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.sh-panel-side { border-left: 1px solid #e9ebf1; padding-left: 22px; display: flex; flex-direction: column; }
.sh-brands { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.sh-header .sh-brands a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  padding: 6px;
  border: 1px solid #e9ebf1;
  border-radius: 10px;
  background: #fff;
}
.sh-header .sh-brands a:hover { border-color: var(--sh-navy); }
.sh-brands img { max-width: 100%; max-height: 40px; object-fit: contain; }
.sh-header .sh-panel-all {
  margin-top: auto;
  padding-top: 16px;
  color: var(--sh-navy);
  font-weight: 700;
}
.sh-header .sh-panel-all:hover { color: var(--sh-accent); }

/* ---------- Below 992px: menu button + logo + actions, then the search row */
@media (max-width: 991.98px) {
  .sh-main-row {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      "menu logo . actions"
      "search search search search";
    gap: 8px 6px;
    padding-top: 6px;
    padding-bottom: 10px;
    min-height: 0;
  }
  .sh-wrap { padding-left: 12px; padding-right: 12px; }
  .sh-main-row .sh-menu-btn { display: inline-flex; }
  .sh-logo img { height: 32px; }
  .sh-search { max-width: none; }
  .sh-header .sh-action { padding: 0 9px; }
  .sh-actions .sh-action-text { display: none; }
}
@media (max-width: 575.98px) {
  .sh-header .sh-ai { padding: 0 12px; }
  .sh-search { padding-left: 14px; }
  .sh-search-input { font-size: 16px; } /* 16px stops iOS zooming into the field */
}
@media (max-width: 379.98px) {
  .sh-ai-text { display: none; }
  .sh-logo img { height: 28px; }
}

/* ---------- Drawer (below 992px) - outside <header> so it sits above the WhatsApp button */
.sh-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000001;
  background: rgba(10, 12, 35, 0.5);
  animation: sh-fade 0.2s ease;
}
.sh-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1000002;
  width: min(86vw, 340px);
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #1f2233;
  font-size: 15px;
  box-shadow: 8px 0 30px rgba(0, 0, 0, 0.25);
  animation: sh-slide 0.22s ease;
}
.sh-drawer[hidden], .sh-backdrop[hidden] { display: none; }
.sh-drawer a { color: #1f2233; text-decoration: none; }
.sh-drawer ul { list-style: none; margin: 0; padding: 0; }
.sh-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px 10px 16px;
  background: var(--sh-navy);
}
.sh-drawer-head .sh-logo img { height: 32px; }
.sh-drawer .sh-drawer-close { color: #fff; background: none; border: 0; cursor: pointer; }
.sh-drawer-contact { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 16px; border-bottom: 1px solid #e9ebf1; }
.sh-drawer-contact a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  border-radius: 10px;
  background: #f1f2f7;
  font-weight: 600;
}
.sh-drawer-contact .mdi-whatsapp { color: #128c7e; }
.sh-drawer-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 6px 0 24px; }
.sh-drawer-link { display: flex; align-items: center; gap: 12px; padding: 12px 18px; font-weight: 600; }
.sh-drawer-link .mdi { font-size: 20px; color: var(--sh-navy); }
.sh-drawer-group { border-top: 1px solid #e9ebf1; }
.sh-drawer-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.sh-drawer-group summary::-webkit-details-marker { display: none; }
.sh-drawer-group summary::after { content: "\F0140"; font: normal normal normal 22px/1 "Material Design Icons"; color: #8a8fa0; transition: transform 0.15s; }
.sh-drawer-group[open] summary::after { transform: rotate(180deg); }
.sh-drawer-group li a { display: flex; justify-content: space-between; gap: 8px; padding: 10px 18px 10px 30px; }
.sh-drawer-group li a:active, .sh-drawer-group li a:hover { background: #f1f2f7; }
.sh-drawer-group a[aria-current="page"] { color: var(--sh-accent); font-weight: 600; }
body.sh-no-scroll { overflow: hidden; }

@keyframes sh-slide { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes sh-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .sh-header, .sh-chev, .sh-drawer, .sh-backdrop { transition: none; animation: none; }
}
