/* ==========================================================================
   OMONYMA — Header & Footer
   Header markup/classes below are 1:1 the original mockup's own
   .nav / .nav-logo / .nav-links / .nav-right — there is no parent theme
   to avoid colliding with any more, so there is no reason to keep the
   omh-/wd- prefix gymnastics the Woodmart version needed.
   ========================================================================== */

/* ================= NAV — fixed everywhere, hides on scroll down / reveals on scroll up =================
   position:fixed + a JS-driven .is-hidden/.is-scrolled class pair (see
   assets/js/header-scroll.js) is the single source of truth for the
   header's position and appearance — nothing else touches it. */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 2.2rem 3rem;
  background: transparent;
  transition: transform 0.4s var(--ease), background-color 0.35s var(--ease), color 0.35s var(--ease);
  color: var(--color-bg);
}
.nav.is-hidden { transform: translateY(-100%); }

/* When logged in, WordPress's own admin bar sits at the very top with
   a very high z-index (fixed, above everything) — our header being
   ALSO fixed at top:0 meant the admin bar wasn't just visually
   covering it, it was intercepting real taps/clicks meant for our nav
   (confirmed via elementFromPoint: the admin bar's own link, not our
   button, was the actual hit-test target). Logged-out visitors never
   see the admin bar at all, so this only matters for admin/editor
   accounts — but it matters every time one of us tests on a phone. */
body.admin-bar .nav { top: 32px; }
body.admin-bar .mobile-menu-overlay { top: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar .nav { top: 46px; }
  body.admin-bar .mobile-menu-overlay { top: 46px; }
}

/* Homepage: transparent over the hero, solid ink once scrolled past it */
body.home .nav.is-scrolled { background: var(--color-ink); }

/* Every other page: solid light header from the very start */
body:not(.home) .nav {
  position: fixed;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-line);
  color: var(--color-ink);
}

.nav-logo a { display: block; line-height: 0; }
.nav-logo svg { height: 15px; width: auto; display: block; color: inherit; }
/* Real uploaded logo (Customizer → Site Identity → Logo) renders as an
   <img>, not our fallback <svg> — same visual sizing either way, and it
   inherits the header's own scroll-based color logic automatically
   since it's just a raster image, not something we recolor. */
.nav-logo img {
  height: 32px;
  width: auto;
  max-width: 160px;
  display: block;
  object-fit: contain;
}
/* The bundled wordmark auto-swaps: ink by default (solid light header,
   or interior pages), white while transparent over the hero. A logo
   set manually via Customizer does NOT get this — it's a single fixed
   file, by design of WordPress's own Site Identity feature. */
/* The homepage header sits on a dark backdrop the whole time — a dark
   photo while transparent, solid ink once scrolled — so it always
   needs the white mark. Only pages OFF the homepage (permanently solid,
   light background) use the default ink version from header.php. */
body.home .nav-logo-mark {
  content: url("../img/omonyma-mark-white.svg");
}
@media (max-width: 900px) {
  .nav-logo img { height: 26px; }
}

.nav-links, .nav-right { display: flex; list-style: none; align-items: center; }
.nav-links { gap: 2.4rem; }
.nav-right { gap: 2rem; }
.nav-links a, .nav-right a {
  font-family: var(--font-ui);
  font-size: 0.72rem; letter-spacing: var(--tracking-label);
  text-transform: uppercase; text-decoration: none; font-weight: 500;
  position: relative; padding-bottom: 2px; color: inherit;
}
/* Animated underline — main menu links only, exactly as the original */
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 0%; height: 1px; background: currentColor;
  transition: width 0.35s var(--ease);
}
.nav-links a:hover::after { width: 100%; }

/* Shop dropdown (product categories) — WordPress's own default
   sub-menu markup from wp_nav_menu(), no custom Walker needed */
.nav-links li { position: relative; }
.nav-links .sub-menu {
  display: none; position: absolute; top: 100%; left: 0; margin-top: 1rem;
  background: var(--color-bg); color: var(--color-ink);
  padding: 1rem 1.4rem; min-width: 180px;
  box-shadow: 0 16px 40px rgba(20,19,17,0.12);
  list-style: none;
}
/* Hover-trigger removed on request — the sub-menu itself stays
   display:none (its default, above) and is no longer shown at all. */
.nav-links .sub-menu li { padding: 0.4rem 0; }
.nav-links .sub-menu a { font-size: 0.8rem; letter-spacing: 0.02em; text-transform: none; font-weight: 400; }
.nav-links .sub-menu a::after { display: none; }

.nav-cart-count {
  display: inline-block; margin-left: 0.3em;
}

/* Add-to-cart confirmation — a thin ring pulses outward from whichever
   cart link is currently visible (mobile icon or desktop "Bag" text).
   Approved concept #4 (Ripple Ring). */
.omh-cart-trigger { position: relative; }
.omh-cart-trigger .omh-cart-ripple {
  position: absolute; inset: -10px; border: 1.5px solid var(--color-ink);
  border-radius: 50%; opacity: 0; pointer-events: none;
}
.omh-cart-trigger .omh-cart-ripple.go { animation: omhCartRippleOut 0.7s var(--ease); }
@keyframes omhCartRippleOut {
  0%   { opacity: 0.8; transform: scale(0.6); }
  100% { opacity: 0;   transform: scale(2.2); }
}
@media (prefers-reduced-motion: reduce) {
  .omh-cart-trigger .omh-cart-ripple { display: none; }
}

/* Search — Command Palette (approved concept #5). A light overlay
   backdrop behind a small floating box near the top, not a dark
   full-screen takeover — opens via the header icon or Cmd+K/Ctrl+K
   from anywhere (assets/js/search-live.js). */
.omh-search-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(26,26,24,0.35);
  display: flex; align-items: flex-start; justify-content: center; padding-top: 8vh;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s var(--ease);
}
.omh-search-overlay.is-open { opacity: 1; pointer-events: auto; }

.omh-search-palette {
  background: var(--color-bg); width: min(560px, 92vw);
  box-shadow: 0 30px 70px rgba(20,19,17,0.25);
  max-height: 74vh; display: flex; flex-direction: column;
  transform: translateY(-8px); transition: transform 0.25s var(--ease);
}
.omh-search-overlay.is-open .omh-search-palette { transform: translateY(0); }

.omh-search-input-row { display: flex; align-items: center; padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--color-line); color: var(--color-ink-soft); }
.omh-search-input-row svg { flex-shrink: 0; margin-right: 0.7rem; }
.omh-search-field {
  flex: 1; border: none; background: none; outline: none;
  font-family: var(--font-ui); font-size: 1rem; color: var(--color-ink);
}
.omh-search-field::placeholder { color: var(--color-ink-soft); }
.omh-search-close {
  background: none; border: 1px solid var(--color-line); color: var(--color-ink-soft);
  font-family: var(--font-ui); font-size: 0.68rem; letter-spacing: var(--tracking-label);
  text-transform: uppercase; cursor: pointer; padding: 0.2rem 0.5rem; margin-left: 0.6rem;
}

.omh-search-body { overflow-y: auto; padding: 0.6rem; }
.omh-search-section-label { font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-ink-soft); padding: 0.6rem 0.6rem 0.3rem; }
.omh-search-trending-list button {
  display: block; width: 100%; text-align: left; background: none; border: none;
  padding: 0.6rem 0.6rem; font-family: var(--font-ui); font-size: 0.86rem; color: var(--color-ink); cursor: pointer;
}
.omh-search-trending-list button:hover { background: var(--color-bg-alt); }

.omh-search-result-row { display: flex; align-items: center; gap: 0.8rem; padding: 0.5rem 0.6rem; cursor: pointer; text-decoration: none; color: inherit; }
.omh-search-result-row:hover { background: var(--color-bg-alt); }
.omh-search-result-photo { width: 40px; height: 40px; flex-shrink: 0; object-fit: cover; background: var(--color-bg-alt); }
.omh-search-result-name { font-size: 0.85rem; }
.omh-search-result-price { font-size: 0.76rem; color: var(--color-ink-soft); margin-left: auto; white-space: nowrap; }

.omh-search-view-all { display: none; text-align: center; padding: 0.8rem; font-size: 0.72rem; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--color-ink); text-decoration: underline; }
.omh-search-no-results { display: none; text-align: center; color: var(--color-ink-soft); padding: 1.4rem; font-size: 0.85rem; }

@media (max-width: 900px) {
  .omh-search-overlay { padding-top: 0; align-items: stretch; }
  .omh-search-palette { width: 100%; max-height: 100vh; }
}

/* ================= MOBILE HEADER + MENU =================
   Below 900px: logo moves to dead-center, .nav-links and .nav-right
   (the inline Search/Account/Bag) are hidden — everything moves into
   the hamburger-triggered overlay instead. Ported from the approved
   HTML preview, including its two fixes:
     - .mobile-menu-toggle needs `color: inherit` — buttons don't
       inherit color/font from their parent by default in any browser,
       so without this the lines render in the browser's default
       button-text color (usually black) instead of the header's
       actual color.
     - .nav's z-index must stay ABOVE .mobile-menu-overlay's, or the
       overlay's own background paints over the toggle button (now a
       ✕) once open, hiding the one thing you need to close the menu. */
@media (max-width: 900px) {
  .nav {
    display: grid !important;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    padding: 1.1rem 1.4rem !important;
  }
  .nav-logo { grid-column: 2; justify-self: center; }
  .nav-links, .nav-right { display: none !important; }
  .omh-mobile-cart-icon { display: inline-flex !important; }
}

.omh-mobile-cart-icon {
  display: none; /* shown only ≤900px, above */
  grid-column: 1; justify-self: start;
  position: relative; color: inherit;
}
.omh-mobile-cart-icon .nav-cart-count {
  position: absolute; top: -6px; right: -8px;
  background: var(--color-ink); color: var(--color-bg);
  border-radius: 50%; width: 15px; height: 15px;
  font-size: 0.62rem; line-height: 15px; text-align: center;
  font-family: var(--font-ui);
}
/* Fixed dark-badge/light-number contrast on purpose, not tied to the
   icon's own currentColor — the icon legitimately switches between
   white (transparent-over-hero) and ink (solid header), and a badge
   whose fill tracked that same swap would risk its number matching
   its own background in one of the two states. A small dark badge
   reads fine sitting on either version of the header. */

.mobile-menu-toggle {
  display: none;
  grid-column: 3; justify-self: end;
  width: 22px; height: 14px; position: relative;
  background: none; border: none; padding: 0; cursor: pointer;
  color: inherit;
}
@media (max-width: 900px) {
  .mobile-menu-toggle { display: block; }
}
.mobile-menu-toggle span {
  position: absolute; left: 0; width: 100%; height: 1px; background: currentColor;
  transition: transform 0.4s var(--ease), opacity 0.3s var(--ease), top 0.4s var(--ease);
}
.mobile-menu-toggle span:nth-child(1) { top: 0; }
.mobile-menu-toggle span:nth-child(2) { top: 6.5px; }
.mobile-menu-toggle span:nth-child(3) { top: 13px; }

/* Body-level state class (set by JS) drives the toggle's own morph into
   a ✕ — simpler and more reliable across markup order than a CSS-only
   sibling selector. */
body.mobile-menu-open .mobile-menu-toggle span:nth-child(1) { top: 6.5px; transform: rotate(45deg); }
body.mobile-menu-open .mobile-menu-toggle span:nth-child(2) { opacity: 0; }
body.mobile-menu-open .mobile-menu-toggle span:nth-child(3) { top: 6.5px; transform: rotate(-45deg); }

/* The toggle button lives inside .nav (z-index 200) — keep it above
   the overlay always, so the ✕ stays visible once open, on every page
   context (home transparent/scrolled, or any solid interior page). */
.mobile-menu-overlay {
  display: none;
}
@media (max-width: 900px) {
  .mobile-menu-overlay {
    display: flex;
    position: fixed; inset: 0; z-index: 190;
    background: var(--color-ink); color: var(--color-bg);
    flex-direction: column; justify-content: center;
    padding: 0 1.6rem;
    opacity: 0; pointer-events: none;
    transition: opacity 0.45s var(--ease);
  }
  .mobile-menu-overlay.is-open { opacity: 1; pointer-events: auto; }

  /* The overlay's dark backdrop starts just below the header, not
     behind it — the header strip itself keeps showing the site's
     cream background the whole time the menu is open, on every page
     including the homepage's normally-transparent-over-hero state.
     So the toggle/✕ always needs to be dark-on-cream here, never the
     light colour used for the transparent-hero header — that was
     rendering as an invisible white icon on the cream strip. */
  body.mobile-menu-open .nav { color: var(--color-ink) !important; background: var(--color-bg) !important; transition: none !important; }

  .mobile-menu-links { list-style: none; margin: 0 0 2rem; padding: 0; }
  /* Deliberately NOT opacity/transform-animated per item anymore: that
     staggered reveal (opacity:0 -> 1, translateY(100%) -> 0, on a
     transition) was confirmed live to get permanently stuck mid-
     transition on real pages — even inline !important couldn't
     override it, because a still-"running" transition outranks
     !important in the CSS cascade. Since a stuck transition left
     these links at opacity:0 forever (invisible AND unclickable,
     since the animated <a> — not just its LI — was what a real tap
     needed to hit), the entrance animation was actively breaking the
     one thing that has to work no matter what: the links. The overlay
     itself still fades in (see .mobile-menu-overlay's own opacity
     transition above, which has stayed reliable) — that's enough
     polish without risking this. */
  .mobile-menu-links a {
    display: block; color: inherit; text-decoration: none;
    font-family: var(--font-display); font-weight: 400; font-size: 2.2rem; line-height: 1.3;
  }

  .mobile-menu-divider {
    height: 1px; background: rgba(247,245,241,0.15); margin-bottom: 1.5rem;
    transform: scaleX(0); transform-origin: left; transition: transform 0.6s var(--ease) 0.32s;
  }
  .mobile-menu-overlay.is-open .mobile-menu-divider { transform: scaleX(1); }

  .mobile-menu-tools { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.6rem; flex-wrap: wrap; }
  .mobile-menu-tools li {
    opacity: 0; transform: translateY(10px);
    transition: opacity 0.5s var(--ease) 0.38s, transform 0.5s var(--ease) 0.38s;
  }
  .mobile-menu-overlay.is-open .mobile-menu-tools li { opacity: 1; transform: translateY(0); }
  .mobile-menu-tools a {
    color: inherit; text-decoration: none; font-family: var(--font-ui);
    font-size: 0.7rem; letter-spacing: var(--tracking-label); text-transform: uppercase; font-weight: 500;
  }

  .mobile-menu-foot {
    position: absolute; left: 1.6rem; bottom: 2rem;
    font-family: var(--font-ui); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase;
    color: rgba(247,245,241,0.4);
    opacity: 0; transition: opacity 0.6s var(--ease) 0.46s;
  }
  .mobile-menu-overlay.is-open .mobile-menu-foot { opacity: 1; }

  /* Body scroll-lock while the menu is open */
  body.mobile-menu-open { overflow: hidden; }
}

/* ================= FOOTER ================= */
.omh-real-footer {
  background: var(--color-footer-bg);
  color: var(--color-bg);
  padding: 6rem 3rem 2rem;
}
.omh-real-footer .footer-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  padding-bottom: 5rem;
  border-bottom: 1px solid rgba(247, 245, 241, 0.12);
  max-width: 1600px;
  margin-inline: auto;
}
.omh-real-footer .footer-col h4 {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: rgba(247, 245, 241, 0.5);
  margin: 0 0 1.2rem;
  font-weight: 500;
}
.omh-real-footer .footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
}
.omh-real-footer .footer-col a {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  text-decoration: none;
  color: rgba(247, 245, 241, 0.9);
  transition: color 0.25s var(--ease);
}
.omh-real-footer .footer-col a:hover {
  color: var(--color-bg);
}
.omh-real-footer .footer-wordmark {
  padding: 3rem 0 1rem;
  max-width: 1600px;
  margin-inline: auto;
}
.omh-real-footer .footer-wordmark svg {
  width: 100%;
  height: auto;
  display: block;
  color: var(--color-bg);
}
.omh-real-footer .footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(247, 245, 241, 0.45);
  padding-top: 1.5rem;
  max-width: 1600px;
  margin-inline: auto;
}
.omh-real-footer .footer-bottom a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.omh-real-footer .footer-bottom a:hover {
  color: var(--color-bg);
}

@media (max-width: 768px) {
  .omh-real-footer { padding: 4rem 1.4rem 1.5rem; }
  .omh-real-footer .footer-cols { grid-template-columns: repeat(2, 1fr); gap: 2.5rem 1.5rem; }
  /* Was flex-direction:column — stacked the three lines rigidly, one
     full-width row each. Now they wrap and spread across the available
     width instead, same as desktop, just wrapping to a 2nd line if the
     credit text needs it on a narrow screen. */
  .omh-real-footer .footer-bottom { font-size: 0.66rem; }
}
