/* ============================================================
 * site-fixes.css — Audit fixes (P0–P3) for the user-front theme
 * Loaded last so it can override theme-specific stylesheets.
 * ============================================================ */

/* ── A11y: Skip to content ─────────────────────────────────── */
.skip-to-content-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  background: #1a1a1a;
  color: #fff;
  padding: 12px 20px;
  font-weight: 600;
  border-radius: 0 0 8px 0;
  text-decoration: none;
}
.skip-to-content-link:focus {
  left: 0;
  outline: 3px solid var(--color-primary, #906A3B);
  outline-offset: 2px;
}

.visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ── A11y: focus rings ─────────────────────────────────────── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-primary, #906A3B);
  outline-offset: 2px;
}

/* ── Sticky header offset ──────────────────────────────────── */
body { scroll-padding-top: 110px; }
@media (max-width: 991px) { body { scroll-padding-top: 80px; } }
main#main-content:focus { outline: none; }

/* ── Tap targets ≥ 44 × 44 px ───────────────────────────────── */
header .menu-link,
header .menu-item > a,
.mobile-footer-menu a,
.mobile-navbar .mobile-menu-toggler,
.go-top {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.header-right .menu > .menu-item { padding: 0 6px; }

/* ── Cart / Wishlist / Compare badges ──────────────────────── */
.menu-item .badge,
.header-right .badge,
.mobile-footer-menu .badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  border-radius: 999px;
  background: var(--color-primary, #906A3B);
  color: #fff;
  text-align: center;
  display: inline-block;
  pointer-events: none;
}
/* hide when count is "0" or empty */
.menu-item .badge[data-count="0"],
.menu-item .badge:empty,
.header-right .badge[data-count="0"],
.header-right .badge:empty,
.mobile-footer-menu .badge[data-count="0"],
.mobile-footer-menu .badge:empty {
  display: none !important;
}

/* ensure parent of badge is positioned */
.header-right .menu-item,
.menu-wishlist,
.mobile-footer-menu .item { position: relative; }

/* ── Hero (mobile image-first) ─────────────────────────────── */
@media (max-width: 767.98px) {
  .product-hero-section .row {
    flex-direction: column-reverse;
  }
  .product-hero-section .product-hero-img {
    margin-bottom: 24px;
  }
  .product-hero-section .product-hero-content h2,
  .product-hero-section .product-hero-content h3 {
    font-size: 26px;
  }
}

/* ── Hero slider speed/pause ───────────────────────────────── */
.swiper.hero-slider:hover .swiper-autoplay,
.swiper.hero-slider:focus-within .swiper-autoplay {
  animation-play-state: paused;
}

/* ── PDP polish ────────────────────────────────────────────── */
.pdp-rating--hidden { display: none !important; }
.size-guide-link {
  background: none;
  border: 0;
  color: var(--color-primary, #906A3B);
  text-decoration: underline;
  padding: 4px 0;
  cursor: pointer;
  font-weight: 600;
}
.size-guide-modal .modal-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
}
.size-guide-modal .modal-body th,
.size-guide-modal .modal-body td {
  border: 1px solid #e8e1d8;
  padding: 8px 10px;
  text-align: center;
  font-size: 14px;
}
.size-guide-modal .modal-body th { background: #faf6ef; font-weight: 700; }
.size-guide-modal .fit-meta {
  background: #faf6ef;
  border-radius: 6px;
  padding: 12px 16px;
  margin: 12px 0;
}

/* ── Header search overlay ─────────────────────────────────── */
.ww-search-toggle { background: none; border: 0; padding: 8px; }
.ww-search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 14, 6, .55);
  backdrop-filter: blur(2px);
  display: none;
  z-index: 1090;
  align-items: flex-start;
  justify-content: center;
  padding: 18vh 16px 0;
}
.ww-search-overlay.is-open { display: flex; }
.ww-search-overlay__panel {
  background: #fff;
  width: 100%;
  max-width: 720px;
  border-radius: 10px;
  padding: 28px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .25);
}
.ww-search-overlay__close {
  position: absolute;
  top: 18px;
  right: 22px;
  background: none;
  border: 0;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}
.ww-search-overlay input[type="search"] {
  width: 100%;
  border: 0;
  border-bottom: 2px solid var(--color-primary, #906A3B);
  background: transparent;
  font-size: 22px;
  padding: 12px 0;
  outline: none;
}

/* ── Fonts (we drop google @imports — fall back to system stack) */
:root {
  --ww-font-display: 'Marcellus', Georgia, 'Times New Roman', serif;
  --ww-font-body: 'Mulish', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
body { font-family: var(--ww-font-body); }
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 { font-family: var(--ww-font-display); }

/* ── Newsletter form ───────────────────────────────────────── */
.newsletter-incentive {
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--color-primary, #906A3B);
}
.newsletter-privacy {
  font-size: 12px;
  opacity: .75;
  margin-top: 6px;
}

/* ── Footer trust strip ────────────────────────────────────── */
.ww-trust-row {
  border-top: 1px solid rgba(255, 255, 255, .12);
  padding: 18px 0;
  font-size: 13px;
  opacity: .85;
}
.ww-trust-row li { display: inline-flex; align-items: center; gap: 6px; margin-right: 18px; }

/* ── About page real text ──────────────────────────────────── */
.about-prose p { margin-bottom: 1rem; line-height: 1.7; }

/* ── Reduced motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Hide unbuilt features (driven by user_shop_settings flags from view) */
[data-feature-disabled="true"] { display: none !important; }
