/* =========================================================================
   MAGMA — base visual compartida (tienda + panel)
   Colores tomados del logo, el manifiesto y las etiquetas RV2.
   ========================================================================= */
@font-face {
  font-family: 'Unageo';
  src: url('/assets/fonts/unageo-var.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Droid Serif';
  src: url('/assets/fonts/droid-serif.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Droid Serif';
  src: url('/assets/fonts/droid-serif-bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  /* Marca */
  --magma: #c4471b;          /* naranja quemado del logo */
  --magma-claro: #e2622f;
  --magma-oscuro: #8f2f0e;
  --brasa: #ff7a2f;          /* brillo de lava, solo acentos */
  --crema: #e7cfa6;          /* texto cálido del manifiesto */
  --crema-suave: #bfa684;

  /* Sabores (etiquetas RV2) */
  --maracuya: #ddb82d;
  --pina: #24bba4;
  --tamarindo: #c46a43;
  --hot-date: #8c6eb1;

  /* Superficies volcánicas */
  --roca-0: #0b0807;
  --roca-1: #120d0b;
  --roca-2: #1b1411;
  --roca-3: #261c18;
  --roca-4: #35281f;
  --linea: rgba(231, 207, 166, 0.12);
  --linea-fuerte: rgba(231, 207, 166, 0.24);

  --texto: #f3e6d2;
  --texto-2: #c9b79c;
  --texto-3: #8e7d68;

  --ok: #5fbf77;
  --aviso: #e7b43a;
  --error: #ef5b4b;

  --serif: 'Droid Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Unageo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --r-1: 6px;
  --r-2: 12px;
  --r-3: 20px;
  --sombra: 0 10px 30px rgba(0, 0, 0, 0.45);
  --brillo: 0 0 0 1px rgba(196, 71, 27, 0.4), 0 8px 30px rgba(196, 71, 27, 0.25);

  --t-rapida: 160ms cubic-bezier(0.2, 0.7, 0.2, 1);
  --t-media: 320ms cubic-bezier(0.2, 0.7, 0.2, 1);

  --seguro-arriba: env(safe-area-inset-top, 0px);
  --seguro-abajo: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--roca-0);
  color: var(--texto);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img, video, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; line-height: 1.12; margin: 0 0 0.5em; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--brasa); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--magma); color: #fff; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.saltar {
  position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--magma); color: #fff;
  padding: 10px 14px; border-radius: var(--r-1); text-decoration: none; transition: top var(--t-rapida);
}
.saltar:focus { top: 12px; }

/* ----------------------------- Botones ----------------------------- */
.btn {
  --bg: var(--magma);
  --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 46px; padding: 0 1.25rem;
  border: 1px solid transparent; border-radius: 999px;
  background: var(--bg); color: var(--fg);
  font-family: var(--sans); font-weight: 650; font-size: 0.98rem; letter-spacing: 0.01em;
  text-decoration: none; cursor: pointer; user-select: none;
  transition: transform var(--t-rapida), background-color var(--t-rapida), box-shadow var(--t-rapida), opacity var(--t-rapida);
}
.btn:hover { background: var(--magma-claro); }
.btn:active { transform: scale(0.97); }
.btn[disabled], .btn[aria-disabled='true'] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn--fantasma { --bg: transparent; --fg: var(--texto); border-color: var(--linea-fuerte); }
.btn--fantasma:hover { background: rgba(231, 207, 166, 0.08); }
.btn--crema { --bg: var(--crema); --fg: var(--roca-0); }
.btn--crema:hover { background: #f3dfbb; }
.btn--peligro { --bg: #7d1f14; }
.btn--peligro:hover { background: #9b2a1b; }
.btn--chico { min-height: 36px; padding: 0 0.9rem; font-size: 0.88rem; }
.btn--icono { width: 44px; min-height: 44px; padding: 0; }

/* ---------------------------- Formularios ---------------------------- */
.campo { display: grid; gap: 6px; margin-bottom: 14px; }
.campo > label, .etiqueta { font-size: 0.86rem; font-weight: 600; color: var(--texto-2); }
.entrada, .campo input:not([type='checkbox']):not([type='radio']), .campo select, .campo textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  background: var(--roca-2); border: 1px solid var(--linea-fuerte); border-radius: var(--r-1);
  font-size: 16px; /* evita zoom en iOS */
  transition: border-color var(--t-rapida), box-shadow var(--t-rapida);
}
.campo textarea { min-height: 110px; resize: vertical; }
.entrada:focus, .campo input:focus, .campo select:focus, .campo textarea:focus {
  outline: none; border-color: var(--magma); box-shadow: 0 0 0 3px rgba(196, 71, 27, 0.25);
}
.campo .ayuda { font-size: 0.8rem; color: var(--texto-3); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; color: var(--texto-2); cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--magma); flex: none; }

/* ------------------------------ Varios ------------------------------ */
.etiqueta-pequena {
  font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.16em;
  font-size: 0.75rem; font-weight: 700; color: var(--magma-claro);
}
.aviso { padding: 12px 14px; border-radius: var(--r-1); border: 1px solid var(--linea-fuerte); background: var(--roca-2); font-size: 0.92rem; }
.aviso--error { border-color: rgba(239, 91, 75, 0.5); background: rgba(239, 91, 75, 0.1); color: #ffd0c9; }
.aviso--ok { border-color: rgba(95, 191, 119, 0.5); background: rgba(95, 191, 119, 0.1); color: #d3f5dc; }

.fuego { display: inline-flex; gap: 3px; align-items: center; }
.fuego img { width: 18px; height: 18px; }

@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; }
}
