/* =========================================================
   BASE — reset, variables, .glass, .oculto, toast
   ========================================================= */

/* ---------- Variables ---------- */
:root {
  /* Paleta tomada del logo: fondo amarillo/blanco, letras rojas */

  /* Fondos */
  --bg: #FFF8E1;            /* crema: fondo general */
  --bg-2: #FFEFB8;          /* amarillo suave: fondos secundarios */
  --surface: #FFFFFF;       /* blanco: tarjetas, drawers, header */
  --yellow: #FCC62B;        /* amarillo del logo */
  --yellow-light: #FFE38A;

  /* Rojos */
  --red: #E3262A;           /* rojo del logo */
  --accent: #D7191F;        /* rojo de acento: etiquetas, precios, foco */
  --accent-light: #B51219;  /* rojo de títulos (más oscuro para leerse bien) */
  --deep: #7E0B10;          /* rojo profundo: sombras de títulos, separadores */

  /* Texto */
  --text: #3A1E14;
  --text-dim: #6E5140;
  --on-brand: #FFFFFF;      /* texto sobre botones rojos */

  --brand-gradient: linear-gradient(135deg, #EE3A34 0%, #D7191F 50%, #B3111A 100%);

  /* Variantes RGB para usar con rgba(var(--x-rgb), alpha) */
  --bg-rgb: 255, 248, 225;
  --bg-2-rgb: 255, 239, 184;
  --surface-rgb: 255, 255, 255;
  --yellow-rgb: 252, 198, 43;
  --red-rgb: 227, 38, 42;
  --accent-rgb: 215, 25, 31;
  --accent-light-rgb: 181, 18, 25;
  --deep-rgb: 126, 11, 16;
  --text-rgb: 58, 30, 20;
  --shade-rgb: 70, 25, 10;  /* sombras y overlay cálidos (no negro puro) */

  /* Borde fino compartido */
  --hairline: rgba(var(--accent-light-rgb), 0.14);

  --danger: #e5484d;
  --danger-rgb: 229, 72, 77;

  --wa: #2fe07f;
  --wa-rgb: 47, 224, 127;
  --ig-rgb: 225, 48, 108;
  --ig: #e1306c;
  --ig-gradient: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);

  /* Glass */
  --glass-bg: rgba(var(--surface-rgb), 0.62);
  --glass-border: rgba(var(--accent-light-rgb), 0.12);
  --glass-highlight: rgba(255, 255, 255, 0.8);

  /* Tipografía */
  --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-sans: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --fs-xs: clamp(0.7rem, 0.66rem + 0.2vw, 0.8rem);
  --fs-sm: clamp(0.82rem, 0.78rem + 0.2vw, 0.92rem);
  --fs-base: clamp(0.95rem, 0.9rem + 0.25vw, 1.05rem);
  --fs-md: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  --fs-lg: clamp(1.4rem, 1.2rem + 1vw, 1.9rem);
  --fs-xl: clamp(1.9rem, 1.5rem + 2vw, 2.8rem);
  --fs-hero: clamp(2.8rem, 2rem + 5vw, 5.5rem);

  /* Espaciado */
  --space-xs: clamp(0.25rem, 0.2rem + 0.25vw, 0.4rem);
  --space-sm: clamp(0.5rem, 0.4rem + 0.5vw, 0.75rem);
  --space-md: clamp(0.9rem, 0.75rem + 0.75vw, 1.25rem);
  --space-lg: clamp(1.25rem, 1rem + 1.25vw, 2rem);
  --space-xl: clamp(2rem, 1.5rem + 2.5vw, 3.5rem);

  /* Layout */
  --header-h: clamp(3.75rem, 3.4rem + 1.2vw, 4.5rem);
  --contenido-max: 1200px;
  --gutter: clamp(1rem, 0.7rem + 1.5vw, 2rem);
  --drawer-w: clamp(280px, 85vw, 380px);

  /* Radios / sombras / transiciones */
  --radius-sm: clamp(8px, 0.4rem + 0.2vw, 10px);
  --radius-md: clamp(12px, 0.7rem + 0.3vw, 16px);
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow-card: 0 14px 34px rgba(var(--shade-rgb), 0.14);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 0.2s var(--ease);
  --t-med: 0.35s var(--ease);

  --z-header: 100;
  --z-overlay: 200;
  --z-drawer: 300;
  --z-toast: 400;

  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(var(--yellow-rgb), 0.35), transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(var(--yellow-rgb), 0.25), transparent 70%),
    radial-gradient(ellipse 50% 40% at 0% 60%, rgba(255, 255, 255, 0.9), transparent 70%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Bloquea el scroll mientras hay un drawer abierto */
body.drawer-abierto {
  overflow: hidden;
}

img,
picture,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

h1, h2, h3, h4 {
  line-height: 1.15;
  font-weight: 600;
}

::selection {
  background: var(--accent);
  color: var(--on-brand);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Utilidades ---------- */
.oculto {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Glassmorphism ---------- */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--glass-border);
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    inset 0 -1px 0 rgba(var(--shade-rgb), 0.05),
    0 8px 28px rgba(var(--shade-rgb), 0.10);
}

/* Fallback si no hay backdrop-filter */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass {
    background: rgba(var(--bg-2-rgb), 0.94);
  }
}

/* ---------- Botones compartidos ---------- */
.btn-principal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: clamp(0.65rem, 0.55rem + 0.4vw, 0.85rem) clamp(1.2rem, 1rem + 1vw, 1.8rem);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--on-brand);
  background: var(--brand-gradient);
  background-size: 200% 200%;
  border-radius: var(--radius-pill);
  box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.25);
  transition: transform var(--t-fast), box-shadow var(--t-fast), background-position var(--t-med);
}

.btn-principal:hover {
  transform: translateY(-2px);
  background-position: 100% 50%;
  box-shadow: 0 10px 28px rgba(var(--accent-rgb), 0.35);
}

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

.btn-secundario {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.65rem, 0.55rem + 0.4vw, 0.85rem) clamp(1.2rem, 1rem + 1vw, 1.8rem);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--accent-light);
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  border-radius: var(--radius-pill);
  transition: background-color var(--t-fast), border-color var(--t-fast);
}

.btn-secundario:hover {
  background-color: rgba(var(--accent-rgb), 0.1);
  border-color: var(--accent);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: clamp(1rem, 0.8rem + 1vw, 1.75rem);
  z-index: var(--z-toast);
  max-width: min(90vw, 420px);
  padding: clamp(0.6rem, 0.5rem + 0.4vw, 0.8rem) clamp(1rem, 0.9rem + 0.6vw, 1.4rem);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-align: center;
  color: var(--on-brand);
  background: var(--brand-gradient);
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 30px rgba(var(--shade-rgb), 0.25);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
  transition: opacity var(--t-med), transform var(--t-med);
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
