/* assets/css/style.css
   Small hand-written additions the Tailwind Play CDN can't generate on its
   own (keyframes, ::-webkit- pseudo-elements). Everything else uses plain
   Tailwind utility classes directly in the markup. */

html {
  scroll-behavior: smooth;
}

/* Hero slider crossfade */
.slide {
  opacity: 0;
  transition: opacity 900ms ease-in-out;
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.slide.is-active {
  opacity: 1;
  z-index: 1;
  pointer-events: auto;
}

/* Slow "Ken Burns" zoom on the active hero slide's image for a subtle
   sense of motion instead of a static photo. */
.slide img {
  transform: scale(1.06);
  transition: transform 6500ms ease-out;
}
.slide.is-active img {
  transform: scale(1);
}

/* Sticky header gains a shadow once the page has scrolled, so it reads
   as "lifted" above the content instead of blending into it. */
#site-header.is-scrolled {
  box-shadow: 0 4px 16px -4px rgb(0 0 0 / 0.08);
}

/* Generic scroll-reveal: elements start faded/offset and animate in once
   they enter the viewport (see the IntersectionObserver in main.js).
   Respects reduced-motion preferences. */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms ease-out, transform 600ms ease-out;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .slide img { transition: none; transform: none; }
}

/* Product gallery thumbnail active ring */
.thumb-active {
  outline: 2px solid #0AB89D;
  outline-offset: 2px;
}

/* Slim custom scrollbar for horizontal scrollers (category chips, etc.) */
.scrollbar-thin::-webkit-scrollbar { height: 6px; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: #E4E4E6; border-radius: 9999px; }

/* Skeleton loading shimmer for AJAX variant swaps */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, #f0efe9 25%, #e8e6de 37%, #f0efe9 63%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
}

/* Fallback multi-line clamp for older browsers (Tailwind's line-clamp-* covers modern ones) */
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Product description rendering (admin-authored via the rich-text editor).
   Tailwind's preflight reset strips default paragraph/list spacing and
   bullets, so this restores just enough to read as normal formatted text. */
.rich-content p { margin-bottom: 1em; }
.rich-content p:last-child { margin-bottom: 0; }
.rich-content ul { list-style: disc; padding-left: 1.5em; margin-bottom: 1em; }
.rich-content ol { list-style: decimal; padding-left: 1.5em; margin-bottom: 1em; }
.rich-content li { margin-bottom: 0.25em; }
.rich-content strong, .rich-content b { font-weight: 600; color: inherit; }
.rich-content .ql-align-center { text-align: center; }
.rich-content .ql-align-right { text-align: right; }
.rich-content .ql-align-justify { text-align: justify; }

/* ============ MOBILE BOTTOM NAV (Admin > Content > Mobile Bottom Nav) ============
   Flipkart/Amazon-app style fixed icon bar, mobile only. `.has-mobile-nav`
   is only added to <body> when at least one active item exists, so pages
   never carry the extra bottom padding for an empty/unconfigured bar. */
.mobile-bottom-nav {
  display: none;
}
@media (max-width: 639px) {
  .has-mobile-nav .mobile-bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    background: #fff;
    border-top: 1px solid var(--line, #E8E1CF);
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -2px 10px rgba(35, 31, 26, 0.06);
  }
  /* Room at the bottom of the page so the fixed bar never overlaps content
     (e.g. the footer, or a sticky "Add to Cart" button on product pages). */
  .has-mobile-nav {
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0));
  }
}
.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 7px 2px 6px;
  color: var(--muted, #726B5B);
  text-decoration: none;
  position: relative;
}
.mobile-nav-item.is-active {
  color: var(--accentDark, #93732F);
}
.mobile-nav-item span {
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
}
.mobile-nav-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: var(--accent, #B4903F);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 999px;
  height: 15px;
  min-width: 15px;
  padding: 0 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Badges ---------- */
.pbadge-wrap { position: absolute; top: 10px; z-index: 5; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.pbadge-left { left: 10px; }
.pbadge-right { right: 10px; }
.pbadge { font-weight: 600; font-size: 12px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; text-align: center; box-shadow: 0 1px 3px rgb(0 0 0 / .15); }
.pbadge-circle { min-width: 46px; height: 46px; padding: 0 6px; border-radius: 999px; }
.pbadge-pill { padding: 6px 12px; border-radius: 999px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.pbadge-square { padding: 6px 10px; border-radius: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 640px) { .pbadge-circle { min-width: 38px; height: 38px; font-size: 11px; } }

/* ---------- Option buttons (Size etc.) ---------- */
.variant-btn { min-width: 44px; padding: 8px 14px; border: 1px solid #E3E8EE; border-radius: 6px; background: #fff; font-size: 14px; line-height: 1; cursor: pointer; transition: all .15s; }
.variant-btn:hover { border-color: #163A63; }
.variant-btn.is-selected { background: #163A63; border-color: #163A63; color: #fff; }
.variant-btn.is-disabled { opacity: .4; text-decoration: line-through; cursor: not-allowed; }

/* ---------- Product image zoom ---------- */
.zoom-stage { position: relative; overflow: hidden; }
.zoom-stage img#main-product-image { transition: opacity 150ms ease-in-out, transform .2s ease-out; will-change: transform; }
.zoom-stage.zoom-on-hover { cursor: zoom-in; }
.zoom-stage.is-zooming img#main-product-image { transform: scale(var(--zoom, 2)); transition: opacity 150ms ease-in-out; }
.zoom-btn { position: absolute; top: 10px; right: 10px; z-index: 6; height: 40px; width: 40px; border-radius: 999px; background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / .2); display: flex; align-items: center; justify-content: center; cursor: pointer; border: 0; }
.zoom-btn svg { width: 18px; height: 18px; }
#zoom-lightbox { position: fixed; inset: 0; z-index: 100; background: rgb(0 0 0 / .88); display: none; align-items: center; justify-content: center; overflow: auto; }
#zoom-lightbox.is-open { display: flex; }
#zoom-lightbox img { max-width: 94vw; max-height: 92vh; object-fit: contain; cursor: zoom-in; transition: transform .2s; }
#zoom-lightbox.is-zoomed { align-items: flex-start; justify-content: flex-start; }
#zoom-lightbox.is-zoomed img { max-width: none; max-height: none; width: 180vw; cursor: zoom-out; }
#zoom-close { position: fixed; top: 14px; right: 18px; z-index: 101; color: #fff; font-size: 30px; background: none; border: 0; cursor: pointer; line-height: 1; }
