/* ══════════════════════════════════════════════════════════════
   Paniri Mallku Reutiliza — Sistema de temas
   ☀️ Tema claro:  Natural Claro (crema/arena/oliva/terracota)
   🌙 Tema oscuro: Desierto Premium (marrón cálido profundo)
   Se alternan con el atributo data-tema en <html>.
   ══════════════════════════════════════════════════════════════ */

:root {
  /* ── Superficies ── */
  --fondo: 247 242 232;          /* crema principal        #f7f2e8 */
  --fondo-claro: 251 248 241;    /* crema más claro        #fbf8f1 */
  --fondo-oscuro: 239 230 211;   /* crema profundo         #efe6d3 */
  --superficie: 255 255 255;     /* tarjetas               #ffffff */
  --superficie-acento: 248 243 232;

  /* ── Texto (escala tierra) ── */
  --texto: 43 33 24;             /* #2b2118 */
  --texto-suave: 107 90 68;      /* #6b5a44 */
  --texto-muy-suave: 138 122 99; /* #8a7a63 */
  --texto-apagado: 163 147 122;  /* #a3937a */
  --texto-cta: 43 33 24;         /* texto sobre botones arena (no cambia) */

  /* ── Escala tierra completa (para Tailwind) ── */
  --tierra-950: 43 33 24;
  --tierra-900: 61 50 38;
  --tierra-800: 79 66 50;
  --tierra-700: 107 90 68;
  --tierra-600: 138 122 99;
  --tierra-500: 163 147 122;
  --tierra-400: 192 180 157;
  --tierra-300: 217 207 186;
  --tierra-200: 232 223 207;
  --tierra-100: 241 234 217;
  --tierra-50: 248 243 232;

  /* ── Bordes ── */
  --borde: 232 223 207;

  /* ── Acentos ── */
  --arena: 176 136 82;           /* #b08852 */
  --arena-clara: 232 213 163;
  --arena-oscura: 138 101 55;
  --verde: 111 133 86;           /* #6f8556 */
  --verde-claro: 195 205 170;
  --verde-oscuro: 85 104 63;
  --terracota: 201 111 74;       /* #c96f4a */
  --terracota-clara: 229 165 133;
  --terracota-oscura: 184 92 56;

  /* ── Colores planos para tarjetas dinámicas (JS) ── */
  --accent: #c96f4a;
  --glass: #6f8556;
  --sand: #b08852;

  /* ── Fondos y sombras complejos ── */
  --hero-bg:
    radial-gradient(ellipse 80% 60% at 60% 40%, rgba(176,136,82,0.14) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 10% 80%, rgba(111,133,86,0.10) 0%, transparent 60%),
    linear-gradient(160deg, #fbf8f1 0%, #f1e7d3 50%, #ead9bc 100%);
  --hero-overlay:
    linear-gradient(90deg,
      rgba(251,248,241,0.95) 0%,
      rgba(251,248,241,0.80) 40%,
      rgba(251,248,241,0.35) 70%,
      rgba(251,248,241,0.05) 100%);
  --hero-overlay-bottom: linear-gradient(to top, rgba(251,248,241,0.9), transparent);
  --navbar-bg: rgba(247,242,232,0.88);
  --seccion-alt: rgba(232, 223, 207, 0.45);
  --overlay: rgba(60, 45, 25, 0.45);
  --wave-fill: rgba(232,223,207,0.7);
  --scrollbar-track: #efe6d3;
  --scrollbar-thumb: #b08852;
  --sombra-suave: 0 4px 20px rgba(139, 101, 55, 0.06);
  --sombra-media: 0 14px 40px rgba(139, 101, 55, 0.14);
  --sombra-lateral: -12px 0 50px rgba(75, 55, 30, 0.18);
}

/* ── 🌙 Tema oscuro: Desierto Premium ── */
[data-tema="oscuro"] {
  --fondo: 26 18 10;             /* #1a120a */
  --fondo-claro: 32 24 15;       /* #201510 */
  --fondo-oscuro: 20 13 7;       /* #140d07 */
  --superficie: 42 31 20;        /* #2a1f14 */
  --superficie-acento: 51 38 26;

  --texto: 243 234 217;          /* #f3ead9 */
  --texto-suave: 184 166 140;    /* #b8a68c */
  --texto-muy-suave: 168 152 126;
  --texto-apagado: 148 131 106;

  --tierra-950: 243 234 217;
  --tierra-900: 220 208 186;
  --tierra-800: 200 187 165;
  --tierra-700: 184 166 140;
  --tierra-600: 168 152 126;
  --tierra-500: 148 131 106;
  --tierra-400: 122 104 82;
  --tierra-300: 96 80 60;
  --tierra-200: 74 58 40;
  --tierra-100: 42 31 20;
  --tierra-50: 32 24 15;

  --borde: 74 58 40;

  --arena: 217 185 138;          /* #d9b98a (más claro sobre oscuro) */
  --arena-clara: 232 213 163;
  --arena-oscura: 176 136 82;
  --verde: 143 168 122;          /* #8fa87a */
  --verde-claro: 195 205 170;
  --verde-oscuro: 111 133 86;
  --terracota: 217 129 90;       /* #d9815a */
  --terracota-clara: 229 165 133;
  --terracota-oscura: 201 111 74;

  --accent: #d9815a;
  --glass: #8fa87a;
  --sand: #d9b98a;

  --hero-bg:
    radial-gradient(ellipse 80% 60% at 60% 40%, rgba(217,185,138,0.10) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 10% 80%, rgba(143,168,122,0.08) 0%, transparent 60%),
    linear-gradient(160deg, #201510 0%, #1a120a 50%, #140d07 100%);
  --hero-overlay:
    linear-gradient(90deg,
      rgba(26,18,10,0.95) 0%,
      rgba(26,18,10,0.80) 40%,
      rgba(26,18,10,0.35) 70%,
      rgba(26,18,10,0.05) 100%);
  --hero-overlay-bottom: linear-gradient(to top, rgba(26,18,10,0.9), transparent);
  --navbar-bg: rgba(26,18,10,0.88);
  --seccion-alt: rgba(74, 58, 40, 0.35);
  --overlay: rgba(10, 6, 3, 0.6);
  --wave-fill: rgba(74,58,40,0.5);
  --scrollbar-track: #201510;
  --scrollbar-thumb: #b08852;
  --sombra-suave: 0 4px 20px rgba(0,0,0,0.25);
  --sombra-media: 0 14px 40px rgba(0,0,0,0.4);
  --sombra-lateral: -12px 0 50px rgba(0,0,0,0.5);
}

/* ── Base ── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Poppins', sans-serif;
  background: rgb(var(--fondo));
  color: rgb(var(--texto));
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Tipografía editorial (títulos en serif) */
h1, h2, h3, h4, .font-display {
  font-family: 'Fraunces', Georgia, serif;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 10px; }

/* ── Gradient text utility ── */
.grad-sand {
  background: linear-gradient(135deg, rgb(var(--arena-oscura)), rgb(var(--arena)));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.grad-glass {
  background: linear-gradient(135deg, rgb(var(--verde-oscuro)), rgb(var(--verde)));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* ── HERO ── */
.hero-section {
  min-height: 100vh;
  background: var(--hero-bg);
  position: relative;
  overflow: hidden;
  transition: background 0.3s ease;
}
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%238a6537' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

/* ── Section alternada ── */
.section-alt { background: var(--seccion-alt); transition: background 0.3s ease; }

/* ── Tarjeta de producto ── */
.tarjeta {
  background: rgb(var(--superficie));
  border: 1px solid rgb(var(--arena) / 0.22);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--sombra-suave);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  display: flex; flex-direction: column;
}
.tarjeta:hover { transform: translateY(-6px); border-color: rgb(var(--arena) / 0.55); box-shadow: var(--sombra-media); }
.tarjeta-img { width:100%; aspect-ratio: 3/4; object-fit: contain; background: rgb(var(--tierra-50)); transition: transform 0.4s ease; }
.tarjeta:hover .tarjeta-img { transform: scale(1.05); }

/* ── Carrito sidebar ── */
.cart-sidebar {
  position: fixed; top:0; right:-100%; bottom:0;
  width: 100%; max-width: 400px;
  background: rgb(var(--superficie));
  border-left: 1px solid rgb(var(--arena) / 0.25);
  z-index: 1000;
  transition: right 0.4s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
  box-shadow: var(--sombra-lateral);
}
.cart-sidebar.open { right: 0; }
.cart-overlay { position:fixed; inset:0; background: var(--overlay); backdrop-filter:blur(4px); z-index:999; display:none; }

/* ── Steps list ── */
.step-number {
  width: 44px; height: 44px; flex-shrink: 0;
  background: linear-gradient(135deg, rgb(var(--arena-clara)), rgb(var(--arena-oscura)));
  border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  font-weight: 800; font-size: 1.1rem; color: rgb(var(--texto-cta));
}

/* ── Botón flotante WhatsApp ── */
.btn-float-wa {
  position:fixed; bottom:2rem; right:2rem;
  width:60px; height:60px; background:#25d366; color:white;
  border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-size:1.8rem; z-index:900;
  box-shadow: 0 8px 32px rgba(37,211,102,0.4);
  animation: pulse-wa 2s infinite;
  transition: transform 0.2s;
}
.btn-float-wa:hover { transform: scale(1.1); animation: none; }
@keyframes pulse-wa {
  0%,100% { box-shadow: 0 8px 32px rgba(37,211,102,0.4); }
  50%      { box-shadow: 0 8px 48px rgba(37,211,102,0.7); }
}

/* ── Logo hero float ── */
@keyframes logoFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%       { transform: translateY(-12px) rotate(0.5deg); }
  66%       { transform: translateY(-6px) rotate(-0.5deg); }
}

/* ── Navbar ── */
.navbar {
  position: sticky; top:0; z-index:500;
  background: var(--navbar-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgb(var(--arena) / 0.2);
  transition: background 0.3s ease;
}

/* ── Botón toggle de tema (luna/sol) ── */
.btn-tema {
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid rgb(var(--arena) / 0.3);
  background: rgb(var(--superficie));
  color: rgb(var(--texto-suave));
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}
.btn-tema:hover { border-color: rgb(var(--arena)); color: rgb(var(--texto)); transform: translateY(-1px); }

/* ── Animación fadeIn ── */
@keyframes fadeInUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
.fade-in { animation: fadeInUp 0.5s ease forwards; }

/* ── Impact cards ── */
.impact-card {
  background: rgb(var(--superficie));
  border: 1px solid rgb(var(--verde) / 0.25);
  border-radius: 18px;
  padding: 2rem;
  box-shadow: var(--sombra-suave);
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.impact-card:hover { transform: translateY(-4px); border-color: rgb(var(--verde) / 0.5); box-shadow: var(--sombra-media); }

/* ── Badge ── */
.badge-stat {
  background: rgb(var(--arena) / 0.10);
  border: 1px solid rgb(var(--arena) / 0.30);
  border-radius: 12px;
  padding: 1rem 1.5rem;
}

/* ── Course cards ── */
.curso-card {
  background: rgb(var(--superficie));
  border: 1px solid rgb(var(--terracota) / 0.22);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--sombra-suave);
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.curso-card:hover { transform: translateY(-6px); border-color: rgb(var(--terracota) / 0.5); box-shadow: var(--sombra-media); }

/* ── Fuente manuscrita (acento artesanal) ── */
.fuente-mano { font-family: 'Caveat', 'Comic Sans MS', cursive; }

/* ── Animación de aparición al hacer scroll ── */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* ── Lightbox (página de producto) ── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: zoom-out;
}
.lightbox.abierto { display: flex; }
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 14px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
}

/* ── Barra sticky de compra (página de producto) ── */
.barra-compra {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: rgb(var(--superficie));
  border-top: 1px solid rgb(var(--arena) / 0.25);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.12);
  padding: 0.75rem 1rem;
  z-index: 950;
  transform: translateY(110%);
  transition: transform 0.35s ease;
}
.barra-compra.visible { transform: translateY(0); }
