/* ============================================================
   Nobo Deal — site-level "force animations" (nd-force-anim)
   ============================================================
   WHY: Windows "Animation effects" OFF (or any OS/browser with
   prefers-reduced-motion: reduce) makes every stacked theme CSS
   force [data-reveal] to opacity:1 / transform:none /
   transition:none — the scroll-fade never plays.

   When the user opts in via the site toggle (.nd-anim-toggle),
   <html> gets the class `nd-force-anim`. The rules below then
   re-apply the hidden gate + smooth transitions with !important
   and HIGHER specificity than the reduced-motion media rules, so
   they win regardless of where the theme files were loaded.

   This file is intentionally linked LAST in app/layout.jsx
   (CSS_LINKS), so equal-specificity !important ties go to us.

   NOTE: reduced-motion's `transition: none !important` resets
   transition-delay to 0s; re-enabling the stagger delays here is
   deliberately skipped (keeps forced mode simple — elements fade
   simultaneously instead of cascading).
   ------------------------------------------------------------ */

/* 1. Re-hide + position reveal elements (force mode only) */
html.nd-force-anim [data-reveal]:not(.revealed) {
  opacity: 0 !important;
  will-change: opacity, transform;
}

html.nd-force-anim [data-reveal]:not([data-reveal="up"]):not([data-reveal="left"]):not([data-reveal="right"]):not([data-reveal="zoom"]):not(.revealed) {
  transform: translateY(34px) !important;
}

html.nd-force-anim [data-reveal="up"]:not(.revealed)    { transform: translateY(34px) scale(0.985) !important; }
html.nd-force-anim [data-reveal="left"]:not(.revealed)  { transform: translateX(-38px) !important; }
html.nd-force-anim [data-reveal="right"]:not(.revealed) { transform: translateX(38px) !important; }
html.nd-force-anim [data-reveal="zoom"]:not(.revealed)  { transform: scale(0.9) !important; }

/* 2. Smooth reveal transition (force mode only) */
html.nd-force-anim [data-reveal] {
  transition-property: opacity, transform !important;
  transition-duration: 0.7s !important;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* 3. Revealed = final state */
html.nd-force-anim [data-reveal].revealed {
  opacity: 1 !important;
  transform: none !important;
}

/* ============================================================
   ProductCard reveal (.nd-scroll-card) — same force treatment so
   card scroll-fades also run when the OS asks for reduced motion.
   ============================================================ */
html.nd-force-anim .nd-scroll-card:not(.is-scroll-visible) {
  opacity: 0 !important;
  transform: translate3d(0, 34px, 0) !important;
  will-change: opacity, transform;
}
html.nd-force-anim .nd-scroll-card {
  transition-property: opacity, transform !important;
  transition-duration: 0.7s !important;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1) !important;
}
html.nd-force-anim .nd-scroll-card.is-scroll-visible {
  opacity: 1 !important;
  transform: none !important;
}

/* ============================================================
   Toggle pill (shown only while prefers-reduced-motion: reduce
   is active AND the user has not forced animations on/off yet)
   ------------------------------------------------------------ */
.nd-anim-toggle {
  position: fixed;
  left: 16px;
  bottom: 84px; /* above the mobile bottom-nav */
  z-index: 1080;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: #0a4d43;
  color: #fff;
  font: 600 13px/1 'Poppins', 'Hind Siliguri', sans-serif;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

@media (min-width: 992px) {
  .nd-anim-toggle { bottom: 24px; }
}

.nd-anim-toggle:hover,
.nd-anim-toggle:focus-visible {
  background: #0e5d51;
  outline: 2px solid rgba(255, 209, 102, 0.8);
  outline-offset: 2px;
}

.nd-anim-toggle-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffd166;
  flex: none;
}

.nd-anim-toggle[aria-pressed='true'] .nd-anim-toggle-dot {
  background: #5be08b;
}

/* ===== Instant content: no preloader band / hidden-header on refresh =====
   The legacy preloader white band used to sit above the header for ~1s after
   refresh (navbar/search appeared late). Hide it from the very first paint and
   force the header + page-wrapper fully visible immediately. */
.preloader,
.preloader img {
  display: none !important;
  visibility: hidden !important;
}
.nd-header,
.page-wrapper {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

/* ============================================================
   FULL-WIDTH containers on EVERY page (client: applies only to
   home so far — now global): from 1200px up every storefront
   .container / .nd-container grows, and on very wide / zoomed-out
   screens it turns fluid (fills both sides, no empty margins).
   ============================================================ */
@media (min-width: 1200px) {
  .page-wrapper .container,
  .page-wrapper .nd-container {
    max-width: 1560px !important;
  }
}
@media (min-width: 1700px) {
  .page-wrapper .container,
  .page-wrapper .nd-container {
    max-width: calc(100% - 40px) !important;
  }
  /* Top Selling stays THREE per row at every width — photo LEFT, info +
     Add-to-Cart / Buy Now buttons RIGHT (client layout). Wide screens simply
     get wider cards inside the full-width container. */
  .nd-ts-list { grid-template-columns: repeat(3, 1fr) !important; }
}
