/* ==========================================================================
   Deshi Food — custom styles (layered on top of Tailwind utilities)
   ========================================================================== */

:root {
  --forest-950: #0a1f14;
  --forest-900: #0f2e1d;
  --forest-800: #163d27;
  --forest-700: #1f5132;
  --gold-600: #a8842f;
  --gold-500: #c9a14a;
  --gold-400: #d9b867;
  --gold-300: #e8cf8a;
  --cream-50: #fffdf8;
  --cream-100: #faf6ee;
  --cream-200: #f3ecdc;
  --ink: #1c1a14;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { background: var(--cream-100); color: var(--ink); overflow-x: hidden; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }
::selection { background: var(--gold-300); color: var(--forest-950); }
img { -webkit-user-drag: none; }

/* Bangla scripts need a little more line-height than Latin */
.bn { line-height: 1.55; }

/* ---------- Preloader / page curtain ---------- */
#preloader {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: radial-gradient(ellipse at center, #163d27 0%, #0a1f14 70%);
  transition: opacity .6s var(--ease-out), visibility .6s;
}
#preloader .pl-inner { position: relative; width: 84px; height: 84px; }
#preloader .pl-inner img {
  position: absolute; inset: 8px; width: 68px; height: 68px; border-radius: 9999px; object-fit: cover;
  animation: plPop .9s var(--ease-out) both;
}
#preloader .pl-ring { position: absolute; inset: 0; animation: spin 1.5s linear infinite; }
#preloader .pl-ring circle { fill: none; stroke: var(--gold-400); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 110 400; }
#preloader .pl-text { font-family: "Noto Serif Bengali", serif; color: var(--gold-300); font-size: 13px; animation: plFade .9s .2s var(--ease-out) both; }
#preloader.is-quick { background: var(--cream-100); }
#preloader.is-quick > * { display: none; }
#preloader.is-done { opacity: 0; visibility: hidden; }
@keyframes plPop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes plFade { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Scroll progress ---------- */
#scroll-progress { transform: scaleX(0); transform-origin: 0 50%; }

/* ---------- Header ---------- */
#site-header { transition: transform .5s var(--ease-out); will-change: transform; }
#site-header.is-hidden { transform: translateY(-100%); }
#site-header .nav-shell { transition: box-shadow .3s, background-color .3s; }
#site-header.is-scrolled .nav-shell { box-shadow: 0 10px 24px -18px rgba(15, 46, 29, .45); background-color: rgba(255, 253, 248, .95); }

.nav-link { position: relative; }
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--gold-600), var(--gold-300));
  transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease-out);
}
.nav-link:hover::after, .nav-link.is-active::after { transform: scaleX(1); transform-origin: left; }

.ticker-item { opacity: 0; transform: translateY(100%); transition: opacity .5s var(--ease-out), transform .5s var(--ease-out); }
.ticker-item.is-active { opacity: 1; transform: none; }
.ticker-item.is-leaving { opacity: 0; transform: translateY(-100%); }

/* Slide-in panels: mobile menu + cart drawer */
.drawer { visibility: hidden; }
.drawer.is-open { visibility: visible; }
.drawer .dr-overlay { opacity: 0; transition: opacity .4s var(--ease-out); }
.drawer .dr-panel { transform: translateX(100%); transition: transform .5s var(--ease-out); }
.drawer.is-open .dr-overlay { opacity: 1; }
.drawer.is-open .dr-panel { transform: none; }
.drawer .mm-link { opacity: 0; transform: translateX(20px); transition: opacity .45s var(--ease-out), transform .45s var(--ease-out); }
.drawer.is-open .mm-link { opacity: 1; transform: none; transition-delay: calc(var(--i) * 60ms + 120ms); }

/* ---------- Text effects ---------- */
.text-gold-gradient {
  background: linear-gradient(100deg, #9a7a2c 0%, #e8cf8a 28%, #c9a14a 48%, #f2e2b5 68%, #a8842f 100%);
  background-size: 220% auto; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 7s linear infinite;
}
.text-gold-deep {
  background: linear-gradient(100deg, #7a5d1c 0%, #c9a14a 30%, #8a6a22 55%, #b8923e 80%, #7a5d1c 100%);
  background-size: 220% auto; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 7s linear infinite;
}
@keyframes shine { to { background-position: 220% center; } }

/* ---------- Textures ---------- */
.grain { position: relative; isolation: isolate; }
.grain::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1; opacity: .08; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.leaf-pattern {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='110' height='110' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23c9a14a' stroke-width='1.1'%3E%3Cpath d='M18 62c10-20 30-26 44-24-4 16-20 30-44 24z'/%3E%3Cpath d='M18 62c14-6 26-14 44-24'/%3E%3Cpath d='M76 106c4-14 18-20 30-20-2 12-14 22-30 20z'/%3E%3Cpath d='M76 106c10-6 18-12 30-20'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---------- Section label ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: .55rem; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .22em; color: var(--gold-600); }
.eyebrow::before { content: ""; width: 20px; height: 1.5px; background: currentColor; opacity: .8; }
.eyebrow.is-center::after { content: ""; width: 20px; height: 1.5px; background: currentColor; opacity: .8; }
.eyebrow-light { color: var(--gold-400); }

/* ---------- Scroll reveal ---------- */
[data-reveal] {
  opacity: 0; transform: translateY(22px);
  transition: opacity .85s var(--ease-out), transform .85s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
[data-reveal="left"] { transform: translateX(-26px); }
[data-reveal="right"] { transform: translateX(26px); }
[data-reveal="zoom"] { transform: scale(.96); }
[data-reveal="fade"] { transform: none; }
[data-reveal].is-in { opacity: 1; transform: none; }
/* (the clip goes on the child: a fully clipped element never reports as intersecting) */
[data-reveal="wipe"] { opacity: 1; transform: none; }
[data-reveal="wipe"] > * { clip-path: inset(0 0 100% 0); transition: clip-path 1.2s var(--ease-out); transition-delay: var(--d, 0ms); }
[data-reveal="wipe"].is-in > * { clip-path: inset(0 0 0 0); }

/* ---------- Motion utilities ---------- */
.marquee { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.marquee-wrap:hover .marquee { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

.floaty { animation: floaty 7s ease-in-out infinite; }
.floaty-slow { animation: floaty 10s ease-in-out infinite; }
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50% { transform: translateY(-9px) rotate(calc(var(--r, 0deg) + 4deg)); }
}

.leaf-fall { position: absolute; top: -12%; pointer-events: none; animation: leafFall var(--t, 14s) linear infinite; animation-delay: var(--delay, 0s); }
@keyframes leafFall {
  0% { top: -12%; transform: translateX(0) rotate(0deg); opacity: 0; }
  10% { opacity: .85; }
  50% { transform: translateX(var(--x, 40px)) rotate(180deg); }
  90% { opacity: .7; }
  100% { top: 105%; transform: translateX(0) rotate(360deg); opacity: 0; }
}

.spin-text { animation: spin 18s linear infinite; }

.pulse-ring { position: relative; isolation: isolate; }
.pulse-ring::before, .pulse-ring::after {
  content: ""; position: absolute; inset: 0; border-radius: 9999px; background: #25D366; z-index: -1;
  animation: ring 2.6s var(--ease-out) infinite;
}
.pulse-ring::after { animation-delay: 1.3s; }
@keyframes ring { 0% { transform: scale(1); opacity: .45; } 100% { transform: scale(1.75); opacity: 0; } }
.pulse-pill { position: relative; isolation: isolate; }
.pulse-pill::before, .pulse-pill::after {
  content: ""; position: absolute; inset: 0; border-radius: 9999px; background: #25D366; z-index: -1;
  animation: ringPill 2.6s var(--ease-out) infinite;
}
.pulse-pill::after { animation-delay: 1.3s; }
@keyframes ringPill { 0% { transform: scale(1); opacity: .4; } 100% { transform: scale(1.08, 1.45); opacity: 0; } }

.btn-shine { position: relative; overflow: hidden; isolation: isolate; }
.btn-shine::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
  transform: translateX(-130%); transition: transform .8s var(--ease-out);
}
.btn-shine:hover::after { transform: translateX(130%); }

[data-magnetic] { transition: transform .4s var(--ease-out); }

.bump { animation: bump .6s var(--ease-out); }
@keyframes bump { 0% { transform: scale(1); } 30% { transform: scale(1.45); } 60% { transform: scale(.9); } 100% { transform: scale(1); } }

.shake { animation: shake .5s; }
@keyframes shake {
  10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-4px); } 40%, 60% { transform: translateX(4px); }
}

/* ---------- Hero slider ---------- */
.slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 1s var(--ease-in-out), visibility 1s; }
.slide.is-active { opacity: 1; visibility: visible; z-index: 2; }
.slide [data-anim] { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.slide.is-active [data-anim] { opacity: 1; transform: none; transition-delay: calc(var(--i, 0) * 100ms + 300ms); }
.slide [data-anim="image"] { transform: translateX(30px) scale(.97); }
.slide.is-active [data-anim="image"] { transform: none; }
.slide .kb { transform: scale(1.02); }
.slide.is-active .kb { animation: kenburns 9s ease-out forwards; }
@keyframes kenburns { from { transform: scale(1.02); } to { transform: scale(1.08); } }
.slide .kb-soft { transform-origin: 72% 50%; }
.slide.is-active .kb-soft { animation: kenburnsSoft 9s ease-out forwards; }
@keyframes kenburnsSoft { from { transform: scale(1); } to { transform: scale(1.03); } }

.dot .dot-progress { transform: scaleX(0); transform-origin: left; }
.dot.is-active .dot-progress { animation: progress var(--dur, 6.5s) linear forwards; }
.slider.is-paused .dot.is-active .dot-progress { animation-play-state: paused; }
@keyframes progress { to { transform: scaleX(1); } }

.arch { border-radius: 999px 999px 20px 20px; }

/* ---------- Product gallery zoom ---------- */
.zoom-wrap img { transition: transform .45s var(--ease-out), opacity .3s; }
.zoom-wrap.is-zooming img { transform: scale(1.8); }

/* ---------- Toast ---------- */
.toast { transform: translateX(120%); opacity: 0; transition: transform .55s var(--ease-out), opacity .55s var(--ease-out); }
.toast.is-in { transform: none; opacity: 1; }
@media (max-width: 639px) { .toast { transform: translateY(-120%); } }
.toast .toast-bar { transform-origin: left; animation: progress 3.4s linear forwards; }

/* ---------- Lightbox ---------- */
#lightbox { opacity: 0; visibility: hidden; transition: opacity .35s var(--ease-out), visibility .35s; }
#lightbox.is-open { opacity: 1; visibility: visible; }
#lightbox img { transform: scale(.94); transition: transform .45s var(--ease-out); }
#lightbox.is-open img { transform: none; }

/* ---------- Accordion ---------- */
.acc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease-out); }
.acc-body > div { overflow: hidden; }
.acc.is-open .acc-body { grid-template-rows: 1fr; }
.acc .acc-icon { transition: transform .4s var(--ease-out); }
.acc.is-open .acc-icon { transform: rotate(45deg); }

/* ---------- Success check ---------- */
.check-circle { stroke-dasharray: 166; stroke-dashoffset: 166; animation: draw .9s var(--ease-out) .15s forwards; }
.check-mark { stroke-dasharray: 48; stroke-dashoffset: 48; animation: draw .5s var(--ease-out) .9s forwards; }
.check-pop { animation: checkPop .6s var(--ease-out) 1.1s both; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes checkPop { 0% { transform: scale(1); } 45% { transform: scale(1.08); } 100% { transform: scale(1); } }

/* ---------- Order tracker ---------- */
.track-fill { transform-origin: left; transform: scaleX(0); transition: transform 1.4s var(--ease-out) .3s; }
.track-fill.is-set { transform: scaleX(var(--p, 0)); }
.track-fill-v { transform-origin: top; transform: scaleY(0); transition: transform 1.4s var(--ease-out) .3s; }
.track-fill-v.is-set { transform: scaleY(var(--p, 0)); }
.stage-dot { transition: background-color .4s, color .4s, box-shadow .4s; transition-delay: calc(var(--i) * 180ms + 300ms); }
.stage-current { animation: stagePulse 2.2s ease-out infinite; }
@keyframes stagePulse { 0% { box-shadow: 0 0 0 0 rgba(201, 161, 74, .55); } 100% { box-shadow: 0 0 0 12px rgba(201, 161, 74, 0); } }

/* ---------- Forms ---------- */
.field {
  width: 100%; border-radius: 12px; border: 1.5px solid #e4dac3; background: #fffdf8; padding: 10px 14px;
  font-size: 16px; /* 16px on phones stops iOS from zooming into the field */
  color: var(--ink); outline: none; transition: border-color .2s, box-shadow .2s, background-color .2s;
}
@media (min-width: 640px) { .field { font-size: 14px; } }
.field::placeholder { color: #a79f8c; }
.field:focus { border-color: var(--gold-500); box-shadow: 0 0 0 3px rgba(201, 161, 74, .18); background: #fff; }
.field.is-invalid { border-color: #c2412d; box-shadow: 0 0 0 3px rgba(194, 65, 45, .12); }
.field-error { display: none; }
.is-invalid ~ .field-error, .field-error.is-shown { display: flex; }
select.field {
  appearance: none; -webkit-appearance: none; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%231f5132' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.mini-select { appearance: none; -webkit-appearance: none; padding-right: 22px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231f5132' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 6px center; }

/* ---------- Scrollbars ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--cream-100); }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--gold-400), var(--gold-600)); border-radius: 10px; border: 3px solid var(--cream-100); }
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* ---------- Floating WhatsApp: stay clear of sticky mobile bars ---------- */
#wa-float { transition: transform .45s var(--ease-out), opacity .3s; }
@media (max-width: 767px) { body.has-sticky #wa-float { transform: translateY(-64px); } }
@media (max-width: 1023px) { body.has-bottom-bar #wa-float { transform: translateY(-72px); } }

/* ---------- Accessibility ---------- */
:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 2px; border-radius: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
  [data-reveal], [data-reveal="wipe"] > * { opacity: 1; transform: none; clip-path: none; }
  .leaf-fall { display: none; }
}

/* ---------- Print (order receipt) ---------- */
@media print {
  #site-header, #site-footer, #wa-float, #scroll-progress, #preloader, .no-print, #mobile-bar { display: none !important; }
  body { background: #fff !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* Keep the checkout's Place-order buttons clear on phones/tablets */
@media (max-width: 1023px) { body[data-page="checkout"] #wa-float { display: none; } }

/* ---------- Home: "shop the tray" photo hotspots ---------- */
.hotspot { z-index: 2; transform: translate(-50%, -50%); }
.hotspot .hs-dot {
  position: relative; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 9999px;
  background: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); transition: transform .35s var(--ease-out), background-color .3s;
}
.hotspot .hs-dot::before {
  content: ""; position: absolute; inset: -6px; border-radius: 9999px; border: 2px solid rgba(255, 255, 255, .9);
  animation: hsPulse 2s var(--ease-out) infinite;
}
.hotspot .hs-dot::after { content: ""; width: 8px; height: 8px; border-radius: 9999px; background: var(--gold-500); transition: background-color .3s; }
.hotspot .hs-tip {
  position: absolute; left: 50%; bottom: calc(100% + 12px); white-space: nowrap; pointer-events: none;
  opacity: 0; transform: translate(-50%, 6px); transition: opacity .35s var(--ease-out), transform .35s var(--ease-out);
}
.hotspot .hs-tip::after {
  content: ""; position: absolute; left: 50%; top: 100%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: rgba(10, 31, 20, .9);
}
.hotspot:hover .hs-tip, .hotspot:focus-visible .hs-tip, .hotspot.is-active .hs-tip { opacity: 1; transform: translate(-50%, 0); }
.hotspot:hover .hs-dot, .hotspot.is-active .hs-dot { transform: scale(1.18); background: var(--gold-400); }
.hotspot:hover .hs-dot::after, .hotspot.is-active .hs-dot::after { background: var(--forest-900); }
@keyframes hsPulse { 0% { transform: scale(.7); opacity: 1; } 100% { transform: scale(1.7); opacity: 0; } }
