/* ============================================================
   Meuble MDF — Shared styles, animations & components
   Light mode only. Fonts: Plus Jakarta Sans + Noto Sans Arabic.
   Brand palette (from template):
     primary #173124 · primary-container #2d4739 · secondary #805533
     surface #fbf9f8 · surface-container-low #f5f3f3
   ============================================================ */

:root {
  --font-arabic: "Noto Sans Arabic", sans-serif;
  --primary: #173124;
  --primary-container: #2d4739;
  --secondary: #805533;
  --surface: #fbf9f8;
  --shadow-wood: rgba(45, 71, 57, 0.10);
}

* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  font-family: "Plus Jakarta Sans", var(--font-arabic);
  min-height: max(760px, 100dvh);
  overflow-x: hidden;
}

.font-arabic-body { font-family: var(--font-arabic); }

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  user-select: none;
}
.material-symbols-outlined.fill { font-variation-settings: "FILL" 1, "wght" 500; }

/* ---------- Glass / blur ---------- */
.glass-effect {
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
}

/* ---------- Scroll reveal ---------- */
.scroll-reveal,
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.scroll-reveal.active,
.reveal-on-scroll.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.12s; }
.reveal-delay-2 { transition-delay: 0.24s; }
.reveal-delay-3 { transition-delay: 0.36s; }
.reveal-delay-4 { transition-delay: 0.48s; }

/* ---------- Lift / hover ---------- */
.hover-lift { transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.45s ease; }
.hover-lift:hover { transform: translateY(-8px); }

/* ---------- Borders / shadows ---------- */
.border-subtle { border: 1px solid rgba(23, 49, 36, 0.10); }
.custom-shadow { box-shadow: 0 10px 40px var(--shadow-wood); }

/* ---------- Underline nav ---------- */
.nav-link { position: relative; }
.nav-link::after {
  content: ""; position: absolute; bottom: -4px; right: 0;
  height: 1.5px; width: 0; background: currentColor;
  transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-link:hover::after, .nav-link.is-active::after { width: 100%; }

/* ---------- Buttons: shine sweep ---------- */
.btn-shine { position: relative; overflow: hidden; }
.btn-shine::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.7s ease;
}
.btn-shine:hover::before { transform: translateX(120%); }

/* Pulse for primary CTA */
@keyframes cta-pulse {
  0%, 100% { box-shadow: 0 10px 30px rgba(23,49,36,0.22); }
  50% { box-shadow: 0 14px 44px rgba(23,49,36,0.42); }
}
.cta-pulse { animation: cta-pulse 2.4s ease-in-out infinite; }

/* ---------- Hero background (responsive) ---------- */
.hero-bg { background-image: url("../assets/hero-mobile.jpg"); background-position: center 60%; }
@media (min-width: 768px) { .hero-bg { background-image: url("../assets/hero.jpg"); } }

/* ---------- Hero ken-burns ---------- */
@keyframes ken-burns {
  0% { transform: scale(1.08) translate(0, 0); }
  100% { transform: scale(1.18) translate(-1.5%, -1.5%); }
}
.ken-burns { animation: ken-burns 18s ease-in-out infinite alternate; }

/* ---------- Floating hint / bounce ---------- */
@keyframes float-y { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.float-y { animation: float-y 2.6s ease-in-out infinite; }

@keyframes scroll-dot {
  0% { transform: translateY(0); opacity: 0; }
  35% { opacity: 1; }
  70% { transform: translateY(14px); opacity: 0; }
  100% { opacity: 0; }
}
.scroll-dot { animation: scroll-dot 1.8s ease-in-out infinite; }

/* ---------- Live pulse dot ---------- */
.live-dot { position: relative; }
.live-dot::before {
  content: ""; position: absolute; inset: -4px; border-radius: 9999px;
  background: currentColor; opacity: 0.5; animation: live-ping 1.6s cubic-bezier(0,0,0.2,1) infinite;
}
@keyframes live-ping { 75%, 100% { transform: scale(2.2); opacity: 0; } }

/* ---------- Marquee (announcement bar) ---------- */
.marquee { display: flex; white-space: nowrap; overflow: hidden; }
.marquee__track { display: flex; gap: 3rem; padding-inline: 1.5rem; animation: marquee 26s linear infinite; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Order success modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(20, 30, 24, 0.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; transition: opacity 0.35s ease, visibility 0.35s;
}
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal-card {
  background: var(--surface); border-radius: 28px; width: 100%; max-width: 440px;
  padding: 36px 28px; text-align: center; box-shadow: 0 30px 90px rgba(20,30,24,0.4);
  transform: translateY(24px) scale(0.96); transition: transform 0.45s cubic-bezier(0.34,1.56,0.64,1);
  max-height: 92dvh; overflow-y: auto;
}
.modal-backdrop.open .modal-card { transform: translateY(0) scale(1); }

/* success check draw */
.check-circle {
  width: 88px; height: 88px; border-radius: 9999px; margin: 0 auto 18px;
  display: grid; place-items: center; background: #eaf6ee;
  animation: pop-in 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes pop-in { from { transform: scale(0); } to { transform: scale(1); } }
.check-svg { width: 46px; height: 46px; }
.check-svg path {
  stroke-dasharray: 48; stroke-dashoffset: 48;
  animation: draw-check 0.5s 0.25s cubic-bezier(0.65,0,0.35,1) forwards;
}
@keyframes draw-check { to { stroke-dashoffset: 0; } }

/* ---------- Color swatches ---------- */
.swatch {
  width: 44px; height: 44px; border-radius: 9999px; cursor: pointer;
  border: 2px solid transparent; box-shadow: inset 0 0 0 2px #fff, 0 2px 8px rgba(0,0,0,0.12);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.swatch:hover { transform: scale(1.08); }
.swatch.selected { border-color: var(--primary); transform: scale(1.06); }

/* ---------- Quantity stepper ---------- */
.qty-btn {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px;
  background: #fff; border: 1px solid rgba(23,49,36,0.12); cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease; user-select: none;
}
.qty-btn:hover { background: var(--surface); }
.qty-btn:active { transform: scale(0.92); }

/* ---------- Input error ---------- */
.field-error { color: #ba1a1a; font-size: 12px; margin-top: 6px; display: none; }
.has-error input, .has-error textarea, .has-error select { border-color: #ba1a1a !important; }
.has-error .field-error { display: block; }

/* ---------- Product card ---------- */
.product-card { transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.4s ease; }
.product-card:hover { transform: translateY(-6px); box-shadow: 0 24px 60px rgba(45,71,57,0.16); }
.product-card:hover .product-card__img { transform: scale(1.07); }
.product-card__img { transition: transform 0.7s cubic-bezier(0.22,1,0.36,1); }

/* skeleton shimmer for images */
.img-skeleton { position: relative; overflow: hidden; background: #ece7e0; }
.img-skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: translateX(-100%); animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }
img.loaded ~ .img-skeleton, .img-loaded .img-skeleton { display: none; }

/* ---------- Mobile drawer ---------- */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 70; background: rgba(20,30,24,0.5);
  opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s;
  backdrop-filter: blur(2px);
}
.drawer-backdrop.open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; right: 0; z-index: 71; height: 100dvh; width: min(84vw, 340px);
  background: var(--surface); box-shadow: -20px 0 60px rgba(20,30,24,0.25);
  transform: translateX(100%); transition: transform 0.4s cubic-bezier(0.22,1,0.36,1);
  display: flex; flex-direction: column; padding: 24px;
}
.drawer.open { transform: translateX(0); }

/* ---------- Sticky mobile buy bar ---------- */
.buy-bar {
  transform: translateY(120%); transition: transform 0.45s cubic-bezier(0.22,1,0.36,1);
}
.buy-bar.show { transform: translateY(0); }

/* ---------- Utility ---------- */
.pb-safe { padding-bottom: calc(env(safe-area-inset-bottom) + 12px); }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* count-up flip feel */
.tabular { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.05ms !important; }
}
