/* ═══════════════════════════════════════════════════════════
   KIDDIE KOUTURE — kk-upgrade.css
   Header v2: Logo-left · Nav-center · Icons-right
   Unified Jost (UI/headings) + Jost (body) — fonts loaded once via
   functions.php (kk_enqueue) so we don't double-load via @import.
═══════════════════════════════════════════════════════════ */

/* ── CSS variable additions ──
   Theme is now locked to a single font family (the brand fonts) for both UI and
   display surfaces. Body weight = 400, navbar weight = 400 (regular).
   Headings rely on the brand fonts' heavier weights (700/800) for visual hierarchy. */
:root {
  --ff-display: 'Jost', sans-serif;
  --ff-ui:      'Jost', sans-serif;
  --header-h:   64px;
}

/* ══════════════════════════════════════════════════════════
   1. HEADER LAYOUT — Logo-Left · Nav-Center · Icons-Right
   ══════════════════════════════════════════════════════════ */

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto; /* logo | nav | actions */
  align-items: center;
  height: 100%;
  padding: 0 var(--pad);
  max-width: var(--max-w);
  margin: 0 auto;
  gap: 0;
}

/* Logo — left column, left-aligned */
.logo-wrap {
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-right: 32px;
  flex-shrink: 0;
}

/* Nav — center column, truly centered */
.nav-left {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

/* Nav-right — right column, right-aligned */
.nav-right {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

/* ══════════════════════════════════════════════════════════
   2. NAV LINKS — Next-style typography
   ══════════════════════════════════════════════════════════ */

/* Top-level nav items */
.kk-primary-menu {
  display: flex;
  align-items: stretch;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
  height: var(--header-h);
}

.kk-primary-menu > li {
  display: flex;
  align-items: stretch;
  position: relative;
}

/* All top-level nav links */
.kk-primary-menu > li > a,
.nav-link {
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-family: var(--ff-ui);
  font-size: 0.9rem;
  font-weight: var(--nav-weight, 400);   /* Regular weight by default — overridable in Customizer */
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink, #1a1a1a);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  /* Force the label to always remain fully visible — no opacity dimming
     on hover. This fixes the "menu items disappear on hover" report. */
  opacity: 1 !important;
  transition: color 0.15s ease;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px; /* compensate so border doesn't shift layout */
}

/* Tighten the padding at small-laptop widths (901-1280px) so the menu
   fits comfortably alongside the logo, search and cart icons. Below
   901px we switch to the burger menu anyway. */
@media (max-width: 1280px) {
  .kk-primary-menu > li > a,
  .nav-link {
    padding: 0 11px;
    font-size: 0.85rem;
  }
}
@media (max-width: 1100px) {
  .kk-primary-menu > li > a,
  .nav-link {
    padding: 0 8px;
    font-size: 0.82rem;
  }
}

/* High-contrast hover state — dark ink, never sage-on-white (which
   read as "the text vanished" on lighter screens). */
.kk-primary-menu > li > a:hover,
.kk-primary-menu > li > a:focus-visible,
.kk-primary-menu > li.mega-open > a,
.kk-primary-menu > li.current-menu-item > a,
.kk-primary-menu > li.current-page-ancestor > a {
  color: #1a1a1a !important;
}

/* Animated underline that grows from the centre on hover/open */
.kk-primary-menu > li > a::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 14px;
  width: 0;
  height: 2px;
  background: #1a1a1a;
  transform: translateX(-50%);
  transition: width 0.18s ease;
  pointer-events: none;
}
.kk-primary-menu > li > a:hover::after,
.kk-primary-menu > li.mega-open > a::after,
.kk-primary-menu > li.current-menu-item > a::after,
.kk-primary-menu > li.current-page-ancestor > a::after {
  width: calc(100% - 32px);
}

/* Hover / active underline — teal brand colour */
.kk-primary-menu > li > a:hover,
.kk-primary-menu > li.mega-open > a,
.kk-primary-menu > li:hover > a,
.nav-link:hover,
.nav-link.active {
  color: var(--sage);
  border-bottom-color: var(--sage);
}

/* Remove legacy nav-link chevron — indicator is built into mega walker */
.nav-link.has-drop::after,
.kk-primary-menu > li > a::after {
  display: none;
}

/* ══════════════════════════════════════════════════════════
   3. INLINE SEARCH BAR (desktop)
   Replaces the search-icon toggle button with an always-visible
   compact search input, matching Next's UX pattern.
   ══════════════════════════════════════════════════════════ */

/* Hide the old icon-only search toggle on desktop */
@media (min-width: 992px) {
  .search-toggle.hbtn {
    display: none !important;
  }
}

/* Inline search wrapper — sits in nav-right */
.kk-inline-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f5f5f5;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 4px;
  padding: 0 12px;
  height: 38px;
  width: 200px;
  transition: border-color 0.2s, width 0.3s ease, box-shadow 0.2s;
}

.kk-inline-search:focus-within {
  border-color: var(--sage);
  box-shadow: 0 0 0 2px rgba(95,155,133,0.15);
  width: 240px;
}

.kk-inline-search svg {
  width: 16px;
  height: 16px;
  stroke: rgba(0,0,0,0.45);
  flex-shrink: 0;
}

.kk-inline-search input,
.kk-inline-search input[type="search"],
.kk-inline-search .search-field {
  background: none;
  border: none;
  outline: none;
  font-family: var(--ff-ui);
  font-size: 0.82rem;
  color: var(--ink);
  width: 100%;
  padding: 0;
  line-height: 1;
}

.kk-inline-search input::placeholder,
.kk-inline-search .search-field::placeholder {
  color: rgba(0,0,0,0.4);
  font-size: 0.82rem;
}

/* Mobile: hide inline search, show icon toggle */
@media (max-width: 900px) {
  .kk-inline-search {
    display: none !important;
  }
  .search-toggle.hbtn {
    display: flex !important;
  }
}

/* ══════════════════════════════════════════════════════════
   4. MEGA MENU — Grid-based sub-category layout
   Gives each section a CSS grid so long lists auto-wrap
   into neat multi-column grids (like Next's dropdown)
   ══════════════════════════════════════════════════════════ */

/* Mega panel — attached to the fixed header via absolute positioning.
   The header is position:fixed so children use absolute and inherit that context. */
.mega-drop {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100vw;
  margin-left: calc(50% - 50vw); /* break out of any constrained parent */
  z-index: 9999;
  background: #ffffff;
  border-top: 3px solid var(--sage);
  box-shadow: 0 8px 40px rgba(0,0,0,0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.has-mega.mega-open > .mega-drop {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Inner — max-width container, sections side-by-side */
.mega-inner {
  display: flex;
  align-items: flex-start;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0;
}

/* Each top-level section (e.g. AGE | GENDER | CLOTHING | BRAND) */
.mega-section {
  flex: 1 1 0;
  min-width: 0;
  padding: 28px 28px 32px;
  border-right: 1px solid rgba(0,0,0,0.06);
}
.mega-section:last-child {
  border-right: none;
}

/* Section heading */
.mega-section-head {
  display: block;
  font-family: var(--ff-ui);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage);
  text-decoration: none;
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 2px solid var(--sage);
  white-space: nowrap;
}
a.mega-section-head:hover { color: var(--sage-dark); }

/* ── THE KEY GRID CHANGE ──
   Leaf items (no sub-columns) now flow in a CSS auto-fill grid
   so 12+ items won't make a single endless column. */
.mega-section-cols {
  display: grid;
  /* Fixed 2-column grid — leaf items always wrap into 2 even columns.
     Prevents auto-fill creating unexpected 1-col or 3-col layouts. */
  grid-template-columns: repeat(2, 1fr);
  gap: 0 8px;
  align-items: start;
}

/* Leaf link item — clear any residual flex property from main.css */
.mega-col-link-item {
  flex: unset !important;
  width: auto;
}

/* Each auto-column inside a section */
.mega-col {
  min-width: 0;
}

/* Column heading (AGE, GENDER…) */
.mega-col-head {
  display: block;
  font-family: var(--ff-ui);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #999;
  text-decoration: none;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px dashed rgba(0,0,0,0.1);
  white-space: nowrap;
}
a.mega-col-head:hover { color: var(--sage); }

/* Links inside a column */
.mega-col-links {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mega-col-links > li > a {
  display: block;
  font-family: var(--ff-ui);
  font-size: 0.82rem;
  font-weight: 400;
  color: #333;
  text-decoration: none;
  padding: 3px 0;
  line-height: 1.6;
  transition: color 0.12s, padding-left 0.12s;
}
.mega-col-links > li > a:hover {
  color: var(--sage);
  padding-left: 4px;
}

/* Leaf links (no further children) — grid cell, not forced full-row */
.mega-col-link-item {
  /* Remove old flex: 0 0 100% that forced vertical stacking */
}
.mega-col-link-item a {
  display: block;
  font-family: var(--ff-ui);
  font-size: 0.82rem;
  font-weight: 400;
  color: #333;
  text-decoration: none;
  padding: 3px 0;
  line-height: 1.6;
  transition: color 0.12s, padding-left 0.12s;
}
.mega-col-link-item a:hover {
  color: var(--sage);
  padding-left: 4px;
}

/* Simple dropdown (non-mega) */
.kk-nav-item:not(.has-mega) > .sub-menu {
  border-top: 2px solid var(--sage);
  font-family: var(--ff-ui);
}
.kk-nav-item:not(.has-mega) > .sub-menu a {
  font-family: var(--ff-ui);
  font-size: 0.85rem;
}
.kk-nav-item:not(.has-mega) > .sub-menu a:hover {
  color: var(--sage);
}

/* ══════════════════════════════════════════════════════════
   5. PRODUCT CARD — Next-inspired typography & wishlist fix
   ══════════════════════════════════════════════════════════ */

.pcard {
  border-radius: 0;
  box-shadow: none;
  border: 1px solid rgba(0,0,0,0.06) !important;
  transition: box-shadow 0.2s, transform 0.2s;
}
.pcard:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

/* Product name — DM Sans, clean weight like Next */
.pcard__name {
  font-family: var(--ff-ui);
  font-size: 0.85rem;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 1.35;
  letter-spacing: 0;
}

/* Price */
.pcard__price-row .woocommerce-Price-amount {
  font-family: var(--ff-ui);
  font-weight: 600;
  font-size: 0.9rem;
  color: #1a1a1a;
}

/* Wishlist heart — always visible, not just on hover */
.pcard__wl {
  opacity: 1 !important;
  background: rgba(255,255,255,0.9) !important;
  border: 1px solid rgba(0,0,0,0.12) !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.pcard__wl:hover {
  background: var(--gold) !important;
  border-color: var(--gold) !important;
  color: #fff !important;
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.pcard__wl.active {
  background: var(--gold) !important;
  border-color: var(--gold) !important;
  color: #fff !important;
}
.pcard__wl.active svg {
  fill: #fff !important;
  stroke: #fff !important;
}

/* ATC button — Next-style clean button */
.pcard__atc {
  font-family: var(--ff-ui);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #1a1a1a;
  color: #fff;
  border: 1px solid #1a1a1a;
  border-radius: 0;
  transition: background 0.15s, color 0.15s;
}
.pcard__atc:hover {
  background: var(--sage) !important;
  border-color: var(--sage) !important;
  color: #fff !important;
}

/* ══════════════════════════════════════════════════════════
   6. REVIEWS — Next-style rating snapshot + review list
   ══════════════════════════════════════════════════════════ */

/* WooCommerce reviews wrapper */
#reviews {
  border-top: 1px solid rgba(0,0,0,0.08);
  padding-top: 48px;
  margin-top: 48px;
}

/* "Reviews (N)" heading */
#reviews h2,
.woocommerce-Reviews-title {
  font-family: var(--ff-display);
  font-size: 1.6rem;
  font-weight: 400;
  color: #1a1a1a;
  margin-bottom: 32px;
}

/* Overall rating snapshot — flex row */
#reviews .comment-form-rating,
.woocommerce-product-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

/* Star display */
.star-rating {
  font-size: 1rem;
  color: #1a1a1a;
  letter-spacing: 2px;
}
.star-rating::before {
  color: #1a1a1a;
}

/* Individual review */
.woocommerce-Reviews .comment {
  border-bottom: 1px solid rgba(0,0,0,0.07);
  padding: 24px 0;
  margin: 0;
}

/* Reviewer name */
.woocommerce-Reviews .comment-author strong,
.woocommerce-Reviews .woocommerce-review__author {
  font-family: var(--ff-ui);
  font-weight: 700;
  font-size: 0.9rem;
  color: #1a1a1a;
  display: block;
  margin-bottom: 2px;
}

/* Date */
.woocommerce-Reviews .woocommerce-review__published-date {
  font-family: var(--ff-ui);
  font-size: 0.75rem;
  color: rgba(0,0,0,0.4);
  margin-bottom: 8px;
  display: block;
}

/* Review text */
.woocommerce-Reviews .description p,
.woocommerce-Reviews p {
  font-family: var(--ff-ui);
  font-size: 0.88rem;
  color: #333;
  line-height: 1.6;
}

/* Review form heading */
#reply-title,
.woocommerce-Reviews #respond h3 {
  font-family: var(--ff-display);
  font-size: 1.3rem;
  font-weight: 400;
  margin-bottom: 24px;
}

/* Submit button */
.woocommerce-Reviews #submit {
  font-family: var(--ff-ui);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #1a1a1a;
  color: #fff;
  border: none;
  padding: 12px 28px;
  cursor: pointer;
  transition: background 0.15s;
}
.woocommerce-Reviews #submit:hover {
  background: var(--sage);
}

/* ══════════════════════════════════════════════════════════
   7. TYPOGRAPHY UPGRADES — headings use DM Serif Display
   ══════════════════════════════════════════════════════════ */

/* Page/section headings take on the display serif */
.woocommerce-products-header__title,
.page-title,
h1.entry-title,
.woocommerce-loop-product__title {
  font-family: var(--ff-display);
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* Hero heading (if using the built-in hero) */
.hero__title {
  font-family: var(--ff-display);
}

/* ══════════════════════════════════════════════════════════
   8. ANNOUNCEMENT BAR — keep existing KK teal style
   ══════════════════════════════════════════════════════════ */

/* No changes — retaining current announcement bar exactly */


/* ══════════════════════════════════════════════════════════
   FIX 1 — Search / blog post cards: remove dark background
   ══════════════════════════════════════════════════════════ */
.kk-post-card {
  background: #ffffff !important;
  border: 1px solid rgba(0,0,0,0.07) !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.kk-post-card__title a {
  color: #1a1a1a !important;
}
.kk-post-card__title a:hover {
  color: var(--sage) !important;
}
.kk-post-card__excerpt {
  color: rgba(0,0,0,0.55) !important;
}
.kk-post-card__read {
  color: var(--sage) !important;
}

/* ══════════════════════════════════════════════════════════
   FIX 2 — Single product: tile-style age/size picker
   We render the visual swatch tiles and HIDE the native WC <select>
   dropdowns. The native selects still exist in the DOM (the form
   submit + WC variation engine read from them) — we just hide them
   off-screen accessibly. JS in main.js syncs swatch clicks → selects.
   Out-of-stock tiles get a red ✕ overlay (drawn with two pseudo
   diagonals) instead of being filtered out — matches babywowwow UX.
   ══════════════════════════════════════════════════════════ */

/* Visually hide the native WC selects (keep accessible to JS / form) */
.variations_form .variations {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Show the tile swatches (overrides the old display:none) */
.pi-swatches {
  display: block !important;
  margin-bottom: 24px;
}
.pi-swatch-label-wrap {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

/* Swatch label heading row — "AGE GROUPS (SELECT ONE)" feel */
.pi-swatch-label {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--ff-ui);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
  color: #1a1a1a;
}
.pi-swatch-attr-name::after { content: ' (Select One)'; font-weight: 400; color: rgba(0,0,0,0.55); }
.pi-swatch-selected { font-weight: 600; color: var(--sage); text-transform: capitalize; }

/* Tile row — wraps onto 2-3 columns naturally */
.pi-swatch-row {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px !important;
}

/* Individual tile */
.pi-swatch--label {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 12px !important;
  font-family: var(--ff-ui);
  font-size: 0.85rem;
  font-weight: 500;
  color: #1a1a1a !important;
  background: #fff !important;
  border: 1.5px solid rgba(0,0,0,0.18) !important;
  border-radius: 4px !important;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
  text-align: center;
  overflow: hidden;
}
.pi-swatch--label:hover {
  border-color: #1a1a1a !important;
}
.pi-swatch--label[aria-checked="true"],
.pi-swatch--label.active {
  border-color: #1a1a1a !important;
  border-width: 2px !important;
  color: #1a1a1a !important;
  background: #fff !important;
}

/* ── Out-of-stock tile: red ✕ overlay (two crossed diagonals) ── */
.pi-swatch--label.out-of-stock {
  cursor: not-allowed;
  color: rgba(0,0,0,0.45) !important;
  opacity: 1 !important;
  text-decoration: none !important;
  border-color: rgba(0,0,0,0.15) !important;
}
.pi-swatch--label.out-of-stock::before,
.pi-swatch--label.out-of-stock::after {
  content: '';
  position: absolute;
  left: 6%;
  right: 6%;
  top: 50%;
  height: 2px;
  background: #d44;
  pointer-events: none;
  transform-origin: center center;
}
.pi-swatch--label.out-of-stock::before { transform: translateY(-50%) rotate(18deg); }
.pi-swatch--label.out-of-stock::after  { transform: translateY(-50%) rotate(-18deg); }

/* ──────────────────────────────────────────────────────────
   COLOR SWATCH — chip with [● dot] [Name] inline.
   Replaces the old "background-on-the-tile + label-absolute-below"
   layout. Now every color renders as a consistent chip even if the
   value isn't in our brand dictionary (a neutral grey dot via
   --swatch-bg fallback). Items lay out horizontally, wrapping as
   needed — no fixed grid columns since color rows are usually short.
   ────────────────────────────────────────────────────────── */

/* Color attributes: row is a wrapping flex (overrides the size-tile grid) */
.pi-swatches[data-attribute*="color"] .pi-swatch-row,
.pi-swatches[data-attribute*="colour"] .pi-swatch-row,
.pi-swatches[data-attribute*="shade"] .pi-swatch-row {
  display: flex !important;
  flex-wrap: wrap !important;
  grid-template-columns: none !important;
  gap: 10px !important;
  padding-bottom: 0 !important;
}

/* Chip — overrides the legacy circular .pi-swatch--color rules in main.css */
.pi-swatch--color {
  position: relative !important;
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
  width: auto !important;
  height: auto !important;
  min-height: 38px;
  padding: 6px 14px 6px 8px !important;
  background: #fff !important;
  background-clip: padding-box !important;
  border: 1.5px solid rgba(0,0,0,0.18) !important;
  border-radius: 100px !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.pi-swatch--color:hover {
  border-color: #1a1a1a !important;
  box-shadow: none !important;
}
.pi-swatch--color[aria-checked="true"],
.pi-swatch--color.active {
  border-color: #1a1a1a !important;
  border-width: 2px !important;
  box-shadow: none !important;
}

/* The dot — pulls its color from the inline --swatch-bg variable
   set by single-product.php. Includes a subtle inner ring so light /
   white colors stay visible on a white chip background. */
.pi-swatch--color .pi-swatch-dot {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--swatch-bg, #cccccc);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15);
  flex-shrink: 0;
}

/* The label — sits inline next to the dot (overrides the old
   absolute-positioned-below layout from main.css). */
.pi-swatch--color .pi-swatch-name {
  position: static !important;
  display: inline-block !important;
  transform: none !important;
  margin: 0 !important;
  font-family: var(--ff-ui);
  font-size: 0.85rem;
  font-weight: 400;
  color: #1a1a1a;
  text-transform: capitalize;
  white-space: nowrap;
  letter-spacing: 0;
  pointer-events: none;
}

/* Out-of-stock color chip — same red ✕ as size tiles */
.pi-swatch--color.out-of-stock {
  cursor: not-allowed;
  opacity: 1 !important;
  border-color: rgba(0,0,0,0.12) !important;
}
.pi-swatch--color.out-of-stock .pi-swatch-name { color: rgba(0,0,0,0.45) !important; }
.pi-swatch--color.out-of-stock .pi-swatch-dot   { opacity: 0.4; }
.pi-swatch--color.out-of-stock::before,
.pi-swatch--color.out-of-stock::after {
  content: '';
  position: absolute;
  left: 6%;
  right: 6%;
  top: 50%;
  height: 2px;
  background: #d44;
  pointer-events: none;
  transform-origin: center center;
  background-image: none;
  inset: auto auto auto auto;
  border-radius: 0;
}
.pi-swatch--color.out-of-stock::before { transform: translateY(-50%) rotate(14deg); }
.pi-swatch--color.out-of-stock::after  { transform: translateY(-50%) rotate(-14deg); }

/* ══════════════════════════════════════════════════════════
   FIX 3 — Nav items: age subtitle under Baby / Girls / Boys
   Applied via JS (see kk-upgrade.js) + this CSS.
   The subtitle is positioned absolutely below the link so the link's
   own height stays equal to every other top-level item — fixes the
   "Baby/Girls/Boys hover higher than About Us/Shop" alignment bug.
   ══════════════════════════════════════════════════════════ */

/* Top-level links stay in a single horizontal line, no flex-column. */
.kk-primary-menu > li > a {
  position: relative;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

/* Age subtitle span (injected by JS) — floats beneath the label */
.kk-primary-menu > li > a .kk-nav-age {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 14px);
  font-family: var(--ff-ui);
  font-size: 0.58rem;
  font-weight: 400;
  color: rgba(0,0,0,0.42);
  letter-spacing: 0;
  text-transform: none;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}

/* Keep hover state on age subtitle too */
.kk-primary-menu > li > a:hover .kk-nav-age,
.kk-primary-menu > li.mega-open > a .kk-nav-age {
  color: var(--sage);
}
/* ══════════════════════════════════════════════════════════
   FIX 4 — "Products you may like" / "Related products" /
   "Frequently bought together" sections
   ══════════════════════════════════════════════════════════ */

.pi-section-title {
  font-family: var(--ff-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
  text-align: center;
}

/* Frequently Bought Together — clean horizontal row of product images
   joined by + signs, total + CTA on the right (desktop) or below (mobile). */
.pi-fbt {
  margin: 48px auto 0;
  padding: 32px 0;
  max-width: var(--max-w);
  border-top: 1px solid rgba(0,0,0,0.08);
}
.pi-fbt-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
}
.pi-fbt-items {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
}
.pi-fbt-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 140px;
  flex-shrink: 0;
}
.pi-fbt-thumb {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
  background: #FFFFFF;
}
.pi-fbt-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pi-fbt-thumb input[type="checkbox"] {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  accent-color: var(--sage);
  cursor: pointer;
}
.pi-fbt-name {
  font-family: var(--ff-ui);
  font-size: 0.8rem;
  color: #1a1a1a;
  line-height: 1.3;
  margin-bottom: 4px;
}
.pi-fbt-name a { color: inherit; text-decoration: none; }
.pi-fbt-name a:hover { color: var(--sage); }
.pi-fbt-price {
  font-family: var(--ff-ui);
  font-size: 0.78rem;
  color: rgba(0,0,0,0.65);
}
.pi-fbt-plus {
  font-family: var(--ff-ui);
  font-size: 1.4rem;
  color: rgba(0,0,0,0.4);
  padding: 0 8px;
  margin-bottom: 32px;
  user-select: none;
}
.pi-fbt-summary {
  text-align: left;
  min-width: 220px;
}
.pi-fbt-total-label {
  font-family: var(--ff-ui);
  font-size: 0.85rem;
  color: rgba(0,0,0,0.6);
  display: block;
  margin-bottom: 4px;
}
.pi-fbt-total {
  font-family: var(--ff-ui);
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a1a;
  display: block;
  margin-bottom: 16px;
}
.pi-fbt-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--sage);
  color: #fff;
  border: none;
  padding: 14px 24px;
  font-family: var(--ff-ui);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  text-decoration: none;
}
.pi-fbt-add:hover {
  background: var(--sage-dark);
  transform: translateY(-1px);
  color: #fff;
}
.pi-fbt-add[disabled] {
  background: rgba(0,0,0,0.2);
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 768px) {
  .pi-fbt-inner { grid-template-columns: 1fr; gap: 24px; }
  .pi-fbt-items { justify-content: center; }
  .pi-fbt-summary { text-align: center; }
  .pi-fbt-add { width: 100%; }
  .pi-fbt-item { width: 110px; }
  .pi-fbt-thumb { width: 100px; height: 100px; }
}

/* ══════════════════════════════════════════════════════════
   FIX 5 — Size Guide v2: tabs + white background
   Two tabs (Toddler / Teen) inside the slide-down panel.
   Replaces the old single-table sage-green-headed chart.
   ══════════════════════════════════════════════════════════ */

/* Panel — white background, subtle border, no cream tint */
.pi-size-guide-panel {
  position: relative;
  background: #ffffff !important;
  border: 1px solid rgba(0,0,0,0.10) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
  padding: 18px 18px 14px !important;
}
.pi-size-guide-panel .pi-sg-close {
  position: absolute;
  top: 8px;
  right: 10px;
  float: none !important;
  z-index: 2;
}

/* Tab row */
.kk-sg-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  margin: -4px -4px 16px;
  padding: 0 4px;
}
.kk-sg-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 16px;
  font-family: var(--ff-ui);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(0,0,0,0.55);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}
.kk-sg-tab:hover { color: #1a1a1a; }
.kk-sg-tab.is-active {
  color: var(--sage);
  border-bottom-color: var(--sage);
  font-weight: 600;
}
.kk-sg-tab:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Panes — only one shows at a time */
.kk-sg-pane { display: none; }
.kk-sg-pane.is-active { display: block; animation: kkSgFade 0.2s ease; }
@keyframes kkSgFade {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Table — white background, light header strip, current row highlighted */
.pi-size-guide-panel .kk-sg-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}
.pi-size-guide-panel .kk-sg-table th {
  background: #ffffff !important;
  color: rgba(0,0,0,0.65) !important;
  font-family: var(--ff-ui);
  font-weight: 700 !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 12px !important;
  text-align: left;
  border-bottom: 1.5px solid rgba(0,0,0,0.12);
}
.pi-size-guide-panel .kk-sg-table td {
  padding: 10px 12px;
  font-family: var(--ff-body);
  font-size: 0.85rem;
  color: #1a1a1a;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.pi-size-guide-panel .kk-sg-table tr:last-child td {
  border-bottom: none;
}
.pi-size-guide-panel .kk-sg-table tbody tr:hover {
  background: rgba(94,155,133,0.06);
}
/* Highlight the row that matches the current product's age category */
.pi-size-guide-panel .kk-sg-table tr.is-current {
  background: rgba(94,155,133,0.10);
}
.pi-size-guide-panel .kk-sg-table tr.is-current td {
  color: #1a1a1a;
  font-weight: 500;
}
.pi-size-guide-panel .kk-sg-table tr.is-current td:first-child {
  position: relative;
  padding-left: 18px;
}
.pi-size-guide-panel .kk-sg-table tr.is-current td:first-child::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 22px;
  background: var(--sage);
  border-radius: 2px;
}

/* Mobile: enable horizontal scroll on narrow viewports */
@media (max-width: 480px) {
  .pi-size-guide-panel .kk-sg-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  .kk-sg-tab {
    padding: 10px 12px;
    font-size: 0.78rem;
  }
}

/* ──────────────────────────────────────────────────────────
   FILTER PILL — visible chip beside the shop title when
   ?gender=boys / ?gender=girls / ?gender=unisex is active.
   Includes a small × button that clears the filter.
   ────────────────────────────────────────────────────────── */
.kk-gender-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 14px;
  padding: 4px 6px 4px 12px;
  background: rgba(94,155,133,0.12);
  border: 1px solid rgba(94,155,133,0.30);
  color: var(--sage-dark, #000000);
  border-radius: 100px;
  font-family: var(--ff-ui);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  vertical-align: middle;
}
.kk-gender-pill strong {
  font-weight: 700;
  color: #1a1a1a;
}
.kk-gender-pill--boys {
  background: rgba(33,150,243,0.10);
  border-color: rgba(33,150,243,0.30);
  color: #1565c0;
}
.kk-gender-pill--girls {
  background: rgba(233,30,99,0.08);
  border-color: rgba(233,30,99,0.25);
  color: #ad1457;
}
.kk-gender-pill__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.06);
  color: rgba(0,0,0,0.65);
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
  margin-left: 2px;
  transition: background 0.15s, color 0.15s;
}
.kk-gender-pill__clear:hover {
  background: rgba(0,0,0,0.15);
  color: #1a1a1a;
}

/* ══════════════════════════════════════════════════════════
   MOBILE — everything below 991px stays EXACTLY as before
   Only the desktop grid/nav/search changes are reversed.
   ══════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  /* Show the burger trigger (matches the breakpoint that hides .nav-left) */
  .hamburger,
  .nav-hamburger {
    display: flex !important;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
  }
  /* Restore old stacked header layout on mobile */
  .header-inner {
    grid-template-columns: 1fr auto 1fr;
  }
  /* Logo back to center on mobile */
  .logo-wrap {
    text-align: center;
    justify-content: center;
    padding-right: 0;
    grid-column: 2;
    grid-row: 1;
  }
  /* Nav-left hidden on mobile (mobile-nav handles it) */
  .nav-left {
    display: none;
  }
  /* Nav-right fills right slot on mobile */
  .nav-right {
    grid-column: 3;
    grid-row: 1;
  }

  /* Mega drop stays hidden on mobile (accordion in mobile-nav) */
  .mega-drop {
    display: none !important;
  }

  /* Product card wishlist — keep always visible on touch */
  .pcard__wl {
    opacity: 1 !important;
  }
}
