/* ============================================
   chilita.mia — base.css
   Paleta cálida + reset + estilos globales
   Inspirada en el aesthetic real de @chilita.mia:
   fondos crema/durazno · texto terra cotta · vibe antojitos MX
   ============================================ */

/* Fonts loaded via <link> in HTML for better performance */

/* ——— CSS Variables: Modo Chamoy (salado) ——— */
:root,
[data-mode="chamoy"] {
  /* Backgrounds — crema cálida */
  --bg-primary:       #FFF7EF;
  --bg-secondary:     #FAF0E4;
  --bg-card:          #FFFFFF;
  --bg-card-hover:    #FFF3EA;
  --bg-section-alt:   #FFF0E2;

  /* Texto */
  --text-primary:     #2D1206;
  --text-secondary:   #7A3A1A;
  --text-muted:       #B5835A;

  /* Acento chamoy — terra cotta / rojo enchilado */
  --accent-main:      #C4502A;
  --accent-bright:    #E84B25;
  --accent-warm:      #F4A835;
  --accent-glow:      rgba(232, 75, 37, 0.10);
  --accent-pale:      #FDEAE4;

  /* Borders */
  --border-color:     rgba(196, 80, 42, 0.18);
  --border-card:      rgba(196, 80, 42, 0.10);

  /* Líquido GSAP */
  --liquid-color:     #E84B25;
  --liquid-color-2:   #C4502A;

  /* Botones */
  --btn-bg:           #E84B25;
  --btn-text:         #FFFFFF;
  --btn-hover:        #C4502A;

  /* Tags */
  --tag-bg:           rgba(196, 80, 42, 0.08);
  --tag-text:         #C4502A;

  /* Sombras */
  --shadow-card:      0 2px 16px rgba(196, 80, 42, 0.10);
  --shadow-card-hover:0 8px 32px rgba(196, 80, 42, 0.18);
  --shadow-glow:      0 0 40px rgba(232, 75, 37, 0.12);

  /* Gradientes */
  --gradient-hero:    linear-gradient(150deg, #FFF7EF 0%, #FAEEE2 50%, #FFF0E2 100%);
  --gradient-section: linear-gradient(180deg, #FFF7EF 0%, #FAF0E4 100%);

  /* Nav */
  --nav-bg:           rgba(255, 247, 239, 0.92);

  /* Misc */
  --mode-emoji:       "🌶️";
  --mode-label:       "Lo Salado";
  --scrollbar-thumb:  #C4502A;
}

/* ——— CSS Variables: Modo Chocolate (dulce) ——— */
[data-mode="chocolate"] {
  /* Backgrounds — crema ivorio */
  --bg-primary:       #FDF6EC;
  --bg-secondary:     #F7EBD8;
  --bg-card:          #FFFFFF;
  --bg-card-hover:    #FFF8F0;
  --bg-section-alt:   #F5E8D0;

  /* Texto */
  --text-primary:     #2A1506;
  --text-secondary:   #6B3D1E;
  --text-muted:       #A07045;

  /* Acento chocolate — cacao cálido */
  --accent-main:      #7B4416;
  --accent-bright:    #9A5520;
  --accent-warm:      #D4A574;
  --accent-glow:      rgba(123, 68, 22, 0.10);
  --accent-pale:      #F5E3CF;

  /* Borders */
  --border-color:     rgba(123, 68, 22, 0.18);
  --border-card:      rgba(123, 68, 22, 0.10);

  /* Líquido GSAP */
  --liquid-color:     #5C2D0A;
  --liquid-color-2:   #3B1A0A;

  /* Botones */
  --btn-bg:           #7B4416;
  --btn-text:         #FFFFFF;
  --btn-hover:        #6B3A12;

  /* Tags */
  --tag-bg:           rgba(123, 68, 22, 0.08);
  --tag-text:         #7B4416;

  /* Sombras */
  --shadow-card:      0 2px 16px rgba(123, 68, 22, 0.10);
  --shadow-card-hover:0 8px 32px rgba(123, 68, 22, 0.18);
  --shadow-glow:      0 0 40px rgba(123, 68, 22, 0.12);

  /* Gradientes */
  --gradient-hero:    linear-gradient(150deg, #FDF6EC 0%, #F7EBDA 50%, #F5E8D0 100%);
  --gradient-section: linear-gradient(180deg, #FDF6EC 0%, #F7EBD8 100%);

  /* Nav */
  --nav-bg:           rgba(253, 246, 236, 0.92);

  /* Misc */
  --mode-emoji:       "🍫";
  --mode-label:       "Lo Dulce";
  --scrollbar-thumb:  #7B4416;
}

/* ——— Reset & Base ——— */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.15s ease, color 0.15s ease;
}

/* Grain/noise editorial overlay — da sensación de impresión física */
@media (prefers-reduced-motion: no-preference) {
  body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9997;
    opacity: 0.038;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 180px 180px;
  }
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }

/* ——— Typography ——— */
h1, h2, h3, h4 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* ——— Links ——— */
a {
  color: inherit;
  text-decoration: none;
}

/* ——— Liquid Overlay (GSAP animation target) ——— */
#liquid-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 9999;
  pointer-events: none;
  visibility: hidden;
}

#liquid-overlay svg {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0; left: 0;
}

/* ——— Navigation ——— */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border-color);
  transition: background 0.3s, border-color 0.3s;
}

.nav-logo {
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent-main);
  letter-spacing: -0.02em;
}

.nav-logo .dot {
  color: var(--accent-warm);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.2s;
  letter-spacing: 0.02em;
}

.nav-links a:hover {
  color: var(--accent-main);
}

.nav-mode-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-pale);
  border: 1.5px solid var(--border-color);
  border-radius: 9999px;
  padding: 0.45rem 1.1rem;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-main);
  transition: all 0.2s;
}

.nav-mode-toggle:hover {
  background: var(--btn-bg);
  color: #FFFFFF;
  border-color: var(--btn-bg);
}

/* ——— Section spacing ——— */
section {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

.section-full {
  max-width: 100%;
  padding: 0;
}

.section-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-main);
  margin-bottom: 0.6rem;
  background: var(--tag-bg);
  padding: 0.3rem 0.8rem;
  border-radius: 9999px;
}

.section-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 520px;
  line-height: 1.7;
}

/* ——— Buttons ——— */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  border-radius: 9999px;
  padding: 0.875rem 1.75rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.25s cubic-bezier(0.25,1,0.5,1), transform 0.25s cubic-bezier(0.25,1,0.5,1), box-shadow 0.25s cubic-bezier(0.25,1,0.5,1);
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  background: var(--btn-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--accent-main);
  border: 2px solid var(--border-color);
  border-radius: 9999px;
  padding: 0.75rem 1.5rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.btn-outline:hover {
  border-color: var(--accent-bright);
  color: var(--accent-bright);
  background: var(--accent-pale);
}

/* ——— WhatsApp Sticky ——— */
.whatsapp-sticky {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  background: #25D366;
  color: #fff;
  border-radius: 9999px;
  padding: 0.875rem 1.4rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 0.875rem;
  box-shadow: 0 6px 28px rgba(37, 211, 102, 0.35);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}

.whatsapp-sticky:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 36px rgba(37, 211, 102, 0.45);
}

.whatsapp-sticky svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.whatsapp-sticky .ws-text {
  white-space: nowrap;
}

/* ——— Divider ——— */
.section-divider {
  width: calc(100% - 4rem);
  margin: 0 auto;
  height: 1px;
  background: var(--border-color);
}

/* ——— Responsive ——— */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  section {
    padding: 3.5rem 1.25rem;
  }

  .whatsapp-sticky .ws-text {
    display: none;
  }

  .whatsapp-sticky {
    padding: 1rem;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    justify-content: center;
  }
}
