/* ============================================================
   LEGACY COLLECTION STORE — Estilos compartidos y animaciones
   Sistema de diseño: Komorebi (Bodoni Moda + Hanken Grotesk)
   ============================================================ */

:root {
  --surface: #fbf9f8;
  --on-surface: #1b1c1c;
  --primary: #000000;
  --on-primary: #ffffff;
  --secondary: #775a19;
  --surface-container: #efeded;
  --surface-container-low: #f5f3f3;
  --surface-container-lowest: #ffffff;
  --outline-variant: #c4c7c7;
  --outline: #747878;
  --error: #ba1a1a;
  --error-container: #ffdad6;
  --on-surface-variant: #444748;
  --surface-variant: #e4e2e2;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Modo oscuro: redefine los tokens del sistema. */
html.dark {
  --surface: #141414;
  --on-surface: #e6e4e3;
  --primary: #e6e4e3;
  --on-primary: #141414;
  --secondary: #e9c176;
  --surface-container: #1e1e1e;
  --surface-container-low: #1a1a1a;
  --surface-container-lowest: #101010;
  --outline-variant: #3a3a3a;
  --outline: #8a8a8a;
  --error: #ffb4ab;
  --error-container: #93000a;
  --on-surface-variant: #c4c4c4;
  --surface-variant: #2a2a2a;
  color-scheme: dark;
}

html { scroll-behavior: smooth; }

body {
  background: var(--surface);
  color: var(--on-surface);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--outline-variant); }
::-webkit-scrollbar-thumb:hover { background: var(--outline); }

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  will-change: opacity, transform;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }
.reveal[data-delay="5"] { transition-delay: 0.4s; }

/* ---------- Fade in (page load) ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.fade-in { animation: fadeIn 0.9s var(--ease-out) both; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.9s var(--ease-out) both; }

/* ---------- Hero parallax ---------- */
.parallax { will-change: transform; }

/* ---------- Marquee ---------- */
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 30s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }

/* ---------- Shimmer (loading) ---------- */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--surface-container) 25%, var(--surface-variant) 50%, var(--surface-container) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
}

/* ---------- Cart drawer ---------- */
.cart-drawer {
  transform: translateX(100%);
  transition: transform 0.5s var(--ease-out);
}
.cart-drawer.open { transform: translateX(0); }
.drawer-backdrop {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

/* ---------- Mobile menu ---------- */
.mobile-menu {
  transform: translateY(-12px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s var(--ease-out), opacity 0.35s ease;
}
.mobile-menu.open { transform: translateY(0); opacity: 1; pointer-events: auto; }

/* ---------- Toast ---------- */
@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.toast { animation: toastIn 0.4s var(--ease-out) both; }

/* ---------- Buttons ---------- */
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  transition: background 0.3s ease, transform 0.15s ease, box-shadow 0.3s ease;
}
.btn-primary:hover { background: #2a2a2a; box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.btn-primary:active { transform: scale(0.98); }

.btn-outline {
  border: 1px solid var(--primary);
  color: var(--primary);
  transition: background 0.3s ease, color 0.3s ease, transform 0.15s ease;
}
.btn-outline:hover { background: var(--surface-container-low); }
.btn-outline:active { transform: scale(0.98); }

/* ---------- Product card image zoom ---------- */
.product-media { overflow: hidden; }
.product-media img {
  transition: transform 0.8s var(--ease-out);
}
.product-card:hover .product-media img { transform: scale(1.04); }

/* ---------- Underline link animation ---------- */
.link-underline {
  position: relative;
}
.link-underline::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 1px;
  width: 0;
  background: currentColor;
  transition: width 0.35s var(--ease-out);
}
.link-underline:hover::after { width: 100%; }

/* ---------- Accordion ---------- */
.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s var(--ease-out);
}
.accordion-body.open { max-height: 400px; }
.accordion-icon { transition: transform 0.3s ease; }
.accordion.open .accordion-icon { transform: rotate(45deg); }

/* ---------- Checkout step ---------- */
.checkout-step { transition: opacity 0.3s ease; }

/* ---------- Pulse dot (live) ---------- */
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.pulse-dot { animation: pulse 1.6s ease-in-out infinite; }

/* ---------- Image reveal on load ---------- */
@keyframes imgReveal {
  from { opacity: 0; transform: scale(1.05); }
  to { opacity: 1; transform: scale(1); }
}
.img-reveal { animation: imgReveal 1.1s var(--ease-out) both; }

/* ---------- Utility: hide scrollbar ---------- */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ---------- Focus ring ---------- */
:focus-visible { outline: 2px solid var(--secondary); outline-offset: 2px; }
