/* Varuna demo upgrade: uniform photo framing, trust strip, richer but restrained motion.
   Loaded after site.css / home.css / motion.css so it only adds or overrides. */

/* ---------- 1. Uniform photo framing ---------- */
.product-photo.is-tile,
.product-photo:has(.tile-set) { background: #fff; }
.product-photo.is-tile { position: relative; }
.product-photo.is-tile img { object-fit: contain; padding: 18px; background: #fff; }
.product-photo.is-tile img.swap {
  position: absolute; inset: 0; opacity: 0;
  transition: opacity .45s ease, transform .35s ease;
}
.product-card:hover .product-photo.is-tile img.swap { opacity: 1; }

.product-photo-set.tile-set {
  display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr; gap: 0; padding: 14px; background: #fff; min-height: 0;
}
.product-photo-set.tile-set:has(> :nth-child(3)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.product-photo-set.tile-set > img,
.product-photo-set.tile-set figure img {
  width: 100%; height: 100%; object-fit: contain; background: #fff; grid-row: auto !important; padding: 4px;
}
.product-photo-set.tile-set figure { margin: 0; min-height: 0; display: flex; }
.product-photo-set.tile-set > img:first-child:nth-last-child(3) { grid-row: auto; }

.cut-grid .variant-image.is-tile img { object-fit: contain; }

.grade-photo img { width: 64px !important; height: 64px !important; object-fit: contain !important; border: 0 !important; background: transparent !important; }

.enquiry-note { margin-top: 22px; color: var(--muted); font-size: 15px; }
.form-reply { margin: 14px 0 0; color: var(--muted); font-size: 14px; }

/* ---------- 2. Trust strip (home) ---------- */
.trust-strip { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.trust-strip .container { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.trust-strip .container > div { position: relative; padding: 34px 28px 36px; border-left: 1px solid var(--line); }
.trust-strip .container > div:first-child { border-left: 0; padding-left: 0; }
.trust-strip span { display: block; color: #0997aa; font: 800 12px 'Manrope', sans-serif; letter-spacing: .14em; margin-bottom: 14px; }
.trust-strip strong { display: block; font: 800 19px/1.25 'Manrope', sans-serif; color: var(--navy); letter-spacing: -.02em; }
.trust-strip p { margin: 8px 0 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.trust-strip .container > div::before {
  content: ""; position: absolute; top: -1px; left: 0; height: 2px; width: 100%;
  background: var(--cyan); transform: scaleX(0); transform-origin: left;
}
.trust-strip .container > div:first-child::before { left: 0; }
@media (max-width: 900px) {
  .trust-strip .container { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trust-strip .container > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .trust-strip .container > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .trust-strip .container { grid-template-columns: 1fr; }
  .trust-strip .container > div { border-left: 0 !important; padding: 24px 0 !important; }
  .trust-strip .container > div + div { border-top: 1px solid var(--line); }
}

/* ---------- 3. Header: glass on scroll ---------- */
.header { position: sticky; top: 0; transition: background .3s ease, box-shadow .3s ease; }
.header .header-inner { transition: min-height .3s ease; }
.header .brand img { transition: transform .3s ease; transform-origin: left center; }
.header.is-scrolled {
  background: rgba(255,255,255,.82);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 10px 30px #08263f14;
}
.header.is-scrolled .header-inner { min-height: 72px; }
.header.is-scrolled .brand img { transform: scale(.84); }
.nav a { position: relative; }

/* ---------- 4. Pointer glow on dark heroes ---------- */
.immersive-hero, .category-hero { --gx: 30%; --gy: 40%; }
.immersive-hero::after, .category-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(520px circle at var(--gx) var(--gy), #3bd3df22, transparent 60%);
  opacity: 0; transition: opacity .5s ease;
}
.category-hero { position: relative; }
.category-hero > .container { position: relative; z-index: 2; }
.immersive-hero.glow::after, .category-hero.glow::before { opacity: 1; }

/* ---------- 5. Motion (only when the visitor allows it) ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* Ken Burns on every hero slide, not just the first */
  .hero-slide.is-active img { animation: vx-kenburns 7.5s ease-out both; }
  @keyframes vx-kenburns { from { transform: scale(1.08) translate3d(1%, 0, 0); } to { transform: scale(1) translate3d(0, 0, 0); } }

  /* Word-by-word heading reveal */
  .vx-split vx-w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .06em; margin-bottom: -.06em; }
  .vx-split vx-w > vx-i { display: inline-block; transform: translate3d(0, 105%, 0); transition: transform .9s cubic-bezier(.16, 1, .3, 1); transition-delay: calc(var(--i) * 55ms); }
  .vx-split.is-in vx-w > vx-i { transform: none; }

  /* Button shine */
  .button.cyan, .button.white, .button.navy { position: relative; overflow: hidden; isolation: isolate; }
  .button.cyan::after, .button.white::after, .button.navy::after {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: linear-gradient(110deg, transparent 30%, #ffffff8c 50%, transparent 70%);
    transform: translateX(-120%); animation: vx-shine 6.5s 2s ease-in-out infinite;
  }
  .button.navy::after { background: linear-gradient(110deg, transparent 30%, #ffffff2e 50%, transparent 70%); }
  @keyframes vx-shine { 0%, 82% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }

  /* Cards: lift + soft shadow */
  .product-card { transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s ease; }
  .product-card:hover { box-shadow: 0 22px 44px #08263f1f; }
  .motion-ready .product-card.is-visible:hover { transform: translateY(-6px); }
  .product-photo img { transition: transform .6s cubic-bezier(.2, .8, .2, 1), opacity .45s ease; }

  /* Showcase images drift slightly with scroll (set from JS) */
  .showcase-image img { transform: translate3d(0, var(--py, 0px), 0) scale(1.08); transition: none; will-change: transform; }
  .showcase-row:hover .showcase-image img { transform: translate3d(0, var(--py, 0px), 0) scale(1.12); transition: transform .8s ease; }

  /* Trust strip: line draws in, stagger */
  .trust-strip .container > div { opacity: 0; transform: translate3d(0, 18px, 0); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--i, 0) * 110ms); }
  .trust-strip .container > div::before { transition: transform 1s cubic-bezier(.16, 1, .3, 1); transition-delay: calc(var(--i, 0) * 110ms + .2s); }
  .trust-strip.is-in .container > div { opacity: 1; transform: none; }
  .trust-strip.is-in .container > div::before { transform: scaleX(1); }

  /* Process steps: a line fills as you scroll */
  .steps { position: relative; }
  .steps::before, .steps::after { content: ""; position: absolute; left: 0; top: 34px; bottom: 34px; width: 2px; }
  .steps::before { background: var(--line); }
  .steps::after { background: var(--cyan); transform: scaleY(var(--fill, 0)); transform-origin: top; transition: transform .15s linear; }
  .steps article { position: relative; }
  .steps article span { position: relative; z-index: 1; padding-left: 16px; }
  .steps article.is-lit span { color: var(--navy); }

  /* Nav underline slide */
  .nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--cyan); transform: scaleX(0); transform-origin: right; transition: transform .35s ease; }
  .nav a:hover::after { transform: scaleX(1); transform-origin: left; }

  /* WhatsApp: one gentle pulse after load */
  .floating-whatsapp::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; border: 2px solid #25d366;
    animation: vx-pulse 1.8s 3s ease-out 2; opacity: 0; pointer-events: none;
  }
  @keyframes vx-pulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }

  /* Category hero photo: slow breathing zoom */
  .category-hero-media img { animation: vx-breathe 14s ease-in-out infinite alternate; }
  @keyframes vx-breathe { from { transform: scale(1); } to { transform: scale(1.06); } }

  /* Filter chips on the dehydrated page */
  .filter-buttons button { transition: background .2s ease, color .2s ease, transform .2s ease; }
  .filter-buttons button:hover { transform: translateY(-2px); }
  .cut-card.vx-pop { animation: vx-pop .45s cubic-bezier(.2, .8, .2, 1) both; }
  @keyframes vx-pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
}

@media (prefers-reduced-motion: reduce) {
  .header, .header .header-inner, .header .brand img { transition: none; }
  .immersive-hero::after, .category-hero::before { display: none; }
}

/* Footer credit link */
.footer-end a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.immersive-content { z-index: 2; }

/* Dehydrated division on the products page: four cards in one row */
@media (min-width: 1000px) {
  #dehydrated-foods-salt .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #dehydrated-foods-salt .product-photo { aspect-ratio: 1.1; }
}

/* Electrical photo sets: even grid of framed tiles on a soft panel */
.electrical-photo-set {
  display: grid !important; grid-template-columns: repeat(var(--photo-columns), minmax(0, 1fr));
  gap: 10px; padding: 18px !important; align-content: center; background: var(--paper) !important;
}
.electrical-photo-frame, .electrical-gallery .variant-image .electrical-photo-frame {
  width: auto !important; flex: none !important; aspect-ratio: 1; padding: 6px !important;
  background: #fff !important; border: 1px solid var(--line) !important;
  transition: transform .3s ease, box-shadow .3s ease;
}
.electrical-gallery .variant-image .electrical-photo-frame { width: 100% !important; height: auto !important; }
.product-card:hover .electrical-photo-frame:hover, .variant-card .electrical-photo-frame:hover { transform: translateY(-3px); box-shadow: 0 10px 22px #08263f14; }
.electrical-gallery .variant-photo-set { width: 100%; }
.product-photo .electrical-photo-set { height: 100% !important; align-content: center !important; }
.electrical-gallery .variant-photo-set,
.electrical-gallery .variant-photo-set:has(>.electrical-photo-frame:only-child),
.electrical-gallery .variant-photo-set:has(>.electrical-photo-frame:first-child:nth-last-child(2)),
.electrical-gallery .variant-photo-set:has(>.electrical-photo-frame:first-child:nth-last-child(4)) {
  max-width: none !important; width: 100%; height: 100%;
  grid-template-columns: repeat(auto-fit, minmax(150px, 190px)) !important;
  justify-content: center; align-content: center;
}
@media (max-width: 560px) {
  .electrical-gallery .variant-photo-set { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .electrical-gallery .variant-photo-set:has(>.electrical-photo-frame:only-child) { grid-template-columns: minmax(0, 220px) !important; }
}
.electrical-photo-set { grid-auto-rows: auto !important; }
.electrical-photo-frame { align-self: center; }
.cc-note { margin: 18px 0 0; font-size: 13px; color: var(--muted); }
.cc-note a { text-decoration: underline; text-underline-offset: 3px; }
