/* ==========================================================================
   global.css — Loaded LAST. Wins over WooCommerce and all other CSS.
   ========================================================================== */

/* ── Design tokens ── */
:root {
  --max:         min(90vw, 1600px);
  --tp-thumb-w:  80px;
  --tp-header-h: 80px;
  --tp-green:    #2d5a3d;
  --tp-green-lt: #eef5f0;
  --tp-beige:    #f7f4ef;
  --tp-border:   #e8e4de;
  --tp-text:     #111;
  --tp-muted:    #777;
  --tp-radius:    16px;
  --tp-radius-sm: 10px;
}

/* ── Container widths ── */
.wrap,
.tp-topbar__inner,
.tp-header__nav-row,
.tp-header__inner {
  max-width: var(--max) !important;
  padding-left:  clamp(16px, 2vw, 40px) !important;
  padding-right: clamp(16px, 2vw, 40px) !important;
}
.site-footer .wrap,
.footer-inner,
.tp2-wrap,
.tp2-tabs-section,
.tp2-related,
.tp2-sticky-bar__inner,
.woocommerce .content,
.woocommerce-page .content,
.content,
.content-narrow,
.nt-hero-wrap,
.nt-page-hero__inner,
.product-extra-panels { max-width: var(--max) !important; }

.nt-hero-wrap,
.nt-page-hero__inner { margin-left: auto !important; margin-right: auto !important; }

[style*="max-width: 1200px"],
[style*="max-width:1200px"],
[style*="max-width: 1180px"] { max-width: var(--max) !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   GALLERY

   Layout: .tp2-gallery is a flex ROW.
   Left:  thumb strip — fixed 80px wide, height matches main image
          via align-self:stretch, overflow-y:auto clips excess thumbs.
   Right: main image — square via aspect-ratio + absolute img.

   Using flex (not grid) so the right column drives the row height
   naturally via its aspect-ratio, and the left column stretches to
   match it — no 1048px blowout.
   ═══════════════════════════════════════════════════════════════════════════ */

.tp2-gallery {
  position: sticky !important;
  top: calc(var(--tp-header-h) + 20px) !important;
  align-self: start !important;
}

/* ── WITH thumbs: flex row ── */
.tp2-gallery.has-thumbs {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important; /* both children same height */
  gap: 10px !important;
}

/* ── Thumb strip: fixed width, stretches to match main image height,
   scrolls internally if more thumbs than fit ── */
.tp2-gallery.has-thumbs .tp2-gallery__thumbs {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  width: var(--tp-thumb-w) !important;
  min-width: var(--tp-thumb-w) !important;
  max-width: var(--tp-thumb-w) !important;
  flex-shrink: 0 !important;
  /* Height comes from the flex row (= main image square height).
     Overflow clips thumbs that don't fit. */
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-width: none !important;
}
.tp2-gallery.has-thumbs .tp2-gallery__thumbs::-webkit-scrollbar {
  display: none !important;
}

/* ── Main image: flex-grow fills remaining width ── */
.tp2-gallery.has-thumbs .tp2-gallery__main {
  flex: 1 1 0% !important;
  min-width: 0 !important;
}

/* ── No thumbs: plain block ── */
.tp2-gallery:not(.has-thumbs) {
  display: block !important;
}

/* ── Thumb button ── */
.tp2-thumb {
  position: relative !important;
  display: block !important;
  width: var(--tp-thumb-w) !important;
  height: var(--tp-thumb-w) !important;
  min-width: var(--tp-thumb-w) !important;
  min-height: var(--tp-thumb-w) !important;
  max-width: var(--tp-thumb-w) !important;
  flex-shrink: 0 !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  border: 2px solid transparent !important;
  background: var(--tp-beige) !important;
  cursor: pointer !important;
  padding: 0 !important;
  opacity: .6 !important;
  transition: border-color .15s, opacity .15s !important;
  box-sizing: border-box !important;
}
.tp2-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}
.tp2-thumb.is-active,
.tp2-thumb:hover {
  border-color: var(--tp-green) !important;
  opacity: 1 !important;
}
.tp2-thumb:focus-visible {
  outline: 2px solid var(--tp-green) !important;
  outline-offset: 2px !important;
  opacity: 1 !important;
}

/* ── Main image container: square via aspect-ratio + absolute img ── */
.tp2-gallery__main {
  position: relative !important;
  width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 20px !important;
  overflow: hidden !important;
  background: var(--tp-beige) !important;
  display: block !important;
  box-sizing: border-box !important;
  cursor: zoom-in !important;
}
.tp2-gallery__main img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  transition: opacity .25s ease !important;
}
.tp2-gallery__main:focus-visible {
  outline: 2px solid var(--tp-green) !important;
  outline-offset: 3px !important;
}

/* ── Expand / zoom affordance on the main image ── */
.tp2-gallery__expand {
  position: absolute !important;
  right: 12px !important;
  bottom: 12px !important;
  z-index: 3 !important;
  width: 42px !important;
  height: 42px !important;
  border-radius: 50% !important;
  border: none !important;
  background: rgba(17,17,17,.55) !important;
  color: #fff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: zoom-in !important;
  opacity: 0 !important;
  transform: translateY(6px) !important;
  transition: opacity .2s, transform .2s, background .15s !important;
  -webkit-backdrop-filter: blur(4px) !important;
  backdrop-filter: blur(4px) !important;
  padding: 0 !important;
}
.tp2-gallery__main:hover .tp2-gallery__expand,
.tp2-gallery__main:focus-within .tp2-gallery__expand { opacity: 1 !important; transform: translateY(0) !important; }
.tp2-gallery__expand:hover { background: rgba(17,17,17,.82) !important; }
.tp2-gallery__expand svg { width: 18px !important; height: 18px !important; fill: none !important; stroke: currentColor !important; stroke-width: 2 !important; stroke-linecap: round !important; stroke-linejoin: round !important; }

/* ── Mobile: stack vertically, thumbs horizontal below ── */
@media (max-width: 1024px) {
  .tp2-gallery,
  .tp2-gallery.has-thumbs {
    display: flex !important;
    flex-direction: column !important;
    position: static !important;
    gap: 10px !important;
  }
  .tp2-gallery__main {
    order: 1 !important;
    flex: none !important;
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
  }
  .tp2-gallery.has-thumbs .tp2-gallery__thumbs {
    order: 2 !important;
    flex-direction: row !important;
    width: 100% !important;
    min-width: unset !important;
    max-width: none !important;
    height: auto !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    gap: 8px !important;
  }
  .tp2-thumb {
    width: 68px !important;
    height: 68px !important;
    min-width: 68px !important;
    min-height: 68px !important;
    max-width: 68px !important;
  }
  /* Touch devices: always show the expand hint (no hover) */
  .tp2-gallery__expand { opacity: 1 !important; transform: none !important; }
}

/* ── Mobile widths ── */
@media (max-width: 768px) {
  :root { --max: 100%; }
  .wrap,
  .tp-topbar__inner,
  .tp-header__inner,
  .tp2-wrap,
  .tp2-tabs-section,
  .tp2-related,
  .tp2-sticky-bar__inner {
    padding-left:  16px !important;
    padding-right: 16px !important;
  }
}

/* ── Fix: feature-list check icons rendered as solid black circles ── */
.nt-included-list span svg,
.included-list span svg {
  width: 22px !important;
  height: 22px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  flex: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LIGHTBOX  (built by assets/js/product.js)
   ═══════════════════════════════════════════════════════════════════════════ */
html.tp2-lb-lock { overflow: hidden !important; }

.tp2-lb {
  position: fixed !important;
  inset: 0 !important;
  z-index: 100000 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(12,12,12,.93) !important;
  -webkit-backdrop-filter: blur(2px) !important;
  backdrop-filter: blur(2px) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity .25s ease, visibility .25s !important;
  -webkit-tap-highlight-color: transparent;
}
.tp2-lb.is-open { opacity: 1 !important; visibility: visible !important; }

.tp2-lb__stage {
  position: relative !important;
  width: 100%;
  height: 100%;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
}
.tp2-lb__img {
  max-width: 90vw !important;
  max-height: 84vh !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  border-radius: 8px !important;
  box-shadow: 0 14px 60px rgba(0,0,0,.55) !important;
  transition: transform .25s ease, opacity .2s ease !important;
  cursor: zoom-in !important;
  user-select: none !important;
  -webkit-user-drag: none !important;
  will-change: transform;
}
.tp2-lb.is-zoomed .tp2-lb__img { cursor: zoom-out !important; transition: none !important; max-width: 90vw !important; max-height: 84vh !important; }
.tp2-lb.is-loading .tp2-lb__img { opacity: .35 !important; }

.tp2-lb__close,
.tp2-lb__nav {
  position: absolute !important;
  border: none !important;
  background: rgba(255,255,255,.10) !important;
  color: #fff !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background .15s !important;
  z-index: 5 !important;
  padding: 0 !important;
}
.tp2-lb__close:hover,
.tp2-lb__nav:hover { background: rgba(255,255,255,.24) !important; }
.tp2-lb__close {
  top: 18px !important; right: 20px !important;
  width: 46px !important; height: 46px !important;
  border-radius: 50% !important; font-size: 26px !important; line-height: 1 !important;
}
.tp2-lb__nav {
  top: 50% !important; transform: translateY(-50%) !important;
  width: 54px !important; height: 54px !important; border-radius: 50% !important;
}
.tp2-lb__nav svg { width: 26px !important; height: 26px !important; fill: none !important; stroke: currentColor !important; stroke-width: 2 !important; stroke-linecap: round !important; stroke-linejoin: round !important; }
.tp2-lb__prev { left: 18px !important; }
.tp2-lb__next { right: 18px !important; }

.tp2-lb__counter {
  position: absolute !important;
  top: 26px !important; left: 50% !important; transform: translateX(-50%) !important;
  color: #fff !important; font-size: 14px !important; letter-spacing: .04em !important;
  background: rgba(0,0,0,.32) !important; padding: 5px 13px !important; border-radius: 999px !important;
  z-index: 5 !important; font-family: 'Urbanist', Arial, sans-serif !important;
}

.tp2-lb__thumbs {
  position: absolute !important;
  left: 0 !important; right: 0 !important; bottom: 16px !important;
  display: flex !important; gap: 8px !important; justify-content: center !important;
  overflow-x: auto !important; padding: 0 16px !important;
  scrollbar-width: none !important; z-index: 5 !important;
}
.tp2-lb__thumbs::-webkit-scrollbar { display: none !important; }
.tp2-lb__thumb {
  width: 56px !important; height: 56px !important; border-radius: 8px !important;
  overflow: hidden !important; border: 2px solid transparent !important;
  background: #222 !important; cursor: pointer !important; flex: 0 0 auto !important;
  opacity: .5 !important; transition: opacity .15s, border-color .15s !important; padding: 0 !important;
}
.tp2-lb__thumb img { width: 100% !important; height: 100% !important; object-fit: cover !important; display: block !important; }
.tp2-lb__thumb.is-active,
.tp2-lb__thumb:hover { opacity: 1 !important; border-color: #fff !important; }

.tp2-lb.is-single .tp2-lb__nav,
.tp2-lb.is-single .tp2-lb__thumbs,
.tp2-lb.is-single .tp2-lb__counter { display: none !important; }

@media (max-width: 768px) {
  .tp2-lb__nav { width: 44px !important; height: 44px !important; }
  .tp2-lb__prev { left: 8px !important; }
  .tp2-lb__next { right: 8px !important; }
  .tp2-lb__thumbs { display: none !important; }
  .tp2-lb__img { max-height: 80vh !important; }
  .tp2-lb__close { top: 12px !important; right: 12px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .tp2-lb, .tp2-lb__img, .tp2-gallery__main img { transition: none !important; }
}
