/* =========================
   1) TOKENS / VARIABLES
   ========================= */
:root {
  /* Colores de marca */
  --brand-background: #FFC2E1;
  --brand-text-light: #FFF4F8;
  --brand-title: #DA5373;
  --brand-subtitle: #CF5A77;
  --brand-decor: #FFCCD8;

  /* Colores base */
  --color-background: #FFF4F8;
  --color-surface: #ffffff;
  --color-text-main: #5b3544;
  --color-text-muted: #8a6a78;
  --color-border: #f3d0dd;

  /* Tipografía */
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Otros tokens */
  --radius-base: 16px;
  --shadow-soft: 0 8px 20px rgba(0, 0, 0, 0.08);

  /* Espaciados */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --secret-ingredient: love;
  --core-memory: jamaica-taebaek;
}

/* Tipografías decorativas */
.birthstone-regular { font-family: "Birthstone", cursive; font-weight: 400; font-style: normal; }
.allura-regular { font-family: "Allura", cursive; font-weight: 400; font-style: normal; }

/* =========================
   2) RESET / BASE
   ========================= */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-main);
  background-color: var(--color-background);
  color: var(--color-text-main);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }

/* Accesibilidad: texto solo para lectores de pantalla */
.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;
}

/* Enlace para saltar al contenido */
.skip-link {
  position: absolute;
  top: 0.25rem; left: 0.25rem;
  background: var(--brand-title); color: #fff;
  padding: var(--space-2) var(--space-3);
  border-radius: 999px;
  transform: translateY(-200%);
  transition: transform 0.2s ease;
  z-index: 100;
}
.skip-link:focus { transform: translateY(0); outline: none; }

/* Focus visible coherente con la marca */
a:focus-visible,
button:focus-visible,
.floating-social__btn:focus-visible {
  outline: 3px solid var(--brand-title);
  outline-offset: 2px;
  border-radius: 999px;
}

/* =========================
   3) LAYOUT
   ========================= */
.page {
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  background-color: var(--color-surface);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.04);
}

/* =========================
   4) HEADER
   ========================= */
.header {
  background: radial-gradient(circle at top, var(--brand-background), var(--brand-decor));
  padding: 1.4rem 1.2rem 1.2rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header__content { max-width: 480px; margin: 0 auto; text-align: center; }

.header__brand { display: flex; flex-direction: column; align-items: center; gap: var(--space-2);}

.header__logo { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow-soft); border: 2px solid var(--brand-text-light); background-color: var(--brand-background); }

.header__brand-text { display: flex; flex-direction: column; align-items: center; }


/* Título principal “Menú” */
.header__title {
  margin: 0;
  font-size: clamp(2.4rem, 8vw, 3rem);
  line-height: 1;
  color: var(--brand-title);
}

/* Subtítulo “Susu Waffle Lab · Instinto dulce” */
.header__subtitle {
  margin: 0.2rem 0 0;
  font-size: clamp(0.95rem, 2.6vw, 1.05rem);
  color: var(--brand-text-light);
}
.header__subtitle strong {
  font-weight: 800;
}

/* Teléfono */
.header__phone {
  font-size: clamp(0.9rem, 2.3vw, 1rem);
  color: var(--brand-text-light);
  margin: 0.6rem 0 0;
}
.header__phone a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
}


/* =========================
   5) BOTONES / LINKS
   ========================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; text-decoration: none; border: none; cursor: pointer;
  border-radius: 12px; padding: 0.75rem 1rem; transition: transform 0.08s ease;
  touch-action: manipulation;
}
.btn--primary { background-color: var(--brand-title); color: #fff; box-shadow: var(--shadow-soft); }
.btn--full { width: 100%; }
.btn:active { transform: scale(0.98); }

/* =========================
   6) ÍCONOS FLOTANTES
   ========================= */
.floating-social {
  position: fixed; right: 1rem;
  bottom: calc(5.2rem + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 0.5rem; z-index: 25;
}
.floating-social__btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; border: none; cursor: pointer; box-shadow: var(--shadow-soft);
  text-decoration: none;
}
.floating-social__btn--ig { background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af, #515bd4); }
.floating-social__btn--wa { background-color: #25d366; }
.floating-social__btn i { font-size: 1.2rem; }

/* =========================
   7) SECCIONES
   ========================= */
.section { padding: 1.4rem 1.5rem; background-color: var(--color-surface); }
.section--light { background-color: var(--brand-text-light); }
.section--cta { text-align: center; padding-bottom: 2.5rem; }

.section__title { margin: 0 0 0.3rem; font-size: clamp(1.5rem, 3.5vw, 1.8rem); }
.section__title--pink { color: var(--brand-title); }

/* Subtítulos */
.section__subtitle {
  margin: 1.4rem 0 0.8rem;
  font-size: clamp(1.2rem, 3vw, 1.3rem);
  color: var(--brand-subtitle);
  overflow-wrap: anywhere;        /* protege ante quiebres en pantallas angostas */
}
.section__subtitle--optical { text-indent: 0.15rem; }

.section__description { margin: 0 0 1rem; font-size: clamp(0.95rem, 2.5vw, 1.03rem); color: var(--color-text-muted); }
.section__note { font-size: 0.95rem; color: var(--color-text-muted); }

/* =========================
   8) TAGS DE INGREDIENTES
   ========================= */
.tags {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 0.4rem;
}
.tag {
  font-size: 0.9rem; padding: 0.4rem 0.7rem; border-radius: 999px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-main);
}

/* =========================
   9) CARDS
   ========================= */
.cards { display: flex; flex-direction: column; gap: 0.8rem; }
.cards--inline { margin-top: 1rem; }

.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-base);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(0, 0, 0, 0.02);
}
.card--compact { padding: 0.8rem 0.9rem; }

.card__header {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 0.5rem; margin-bottom: 0.3rem;
}
.card__title {
  margin: 0; font-size: clamp(1rem, 2.6vw, 1.05rem);
  color: var(--color-text-main);
  max-inline-size: 22ch;
}
.card__price { font-weight: 700; font-size: clamp(0.95rem, 2.5vw, 1rem); color: var(--brand-subtitle); }
.card__price--pending { color: var(--color-text-muted); font-style: italic; }
.card__text { margin: 0; font-size: clamp(0.9rem, 2.5vw, 0.98rem); color: var(--color-text-muted); }

/* =========================
   10) GO UP BUTTON
   ========================= */
.go-up {
  position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom));
  width: 48px; height: 48px;
  border-radius: 50%; border: none; background-color: #911F3A; color: #FFCCD8;
  display: none; align-items: center; justify-content: center;
  box-shadow: var(--shadow-soft); cursor: pointer; z-index: 20;
}
.go-up i { font-size: 1.2rem; line-height: 1; }
.go-up--visible { display: inline-flex; }

/* =========================
   11) FOOTER
   ========================= */
.footer {
  padding: 1rem 1.5rem calc(1.2rem + env(safe-area-inset-bottom));
  text-align: center; font-size: 0.9rem;
  background: radial-gradient(circle at bottom, var(--brand-background), var(--brand-decor));
  color: var(--brand-text-light);
}

.footer .footer__text,
.footer .footer__text * {
  color: var(--brand-title) !important;}


/* =========================
   12) ANIMACIONES
   ========================= */
[data-animate="fade-in"] {
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}
[data-animate="fade-in"].is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* =========================
   13) AJUSTES RESPONSIVOS
   ========================= */
/* >= 600px: teléfono grande */
@media (min-width: 600px) {
  .page { max-width: 600px; }
  .header__content { max-width: 600px; }
}

/* >= 768px: Tablet vertical */
@media (min-width: 768px) {
  .page { max-width: 720px; }
  .section { padding: 2rem 2rem; }

  /* Grids para tarjetas largas (2 columnas) */
  .cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  /* Mantener las compactas en dos columnas con alturas iguales */
  .cards--inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: stretch;
  }
  .card,
  .card--compact { height: 100%; }

  /* Flotantes más cómodos en tablet */
  .floating-social {
    right: 1.25rem;
    bottom: calc(6.2rem + env(safe-area-inset-bottom));
  }
  .floating-social__btn {
    width: 48px; height: 48px;
  }
  .go-up {
    right: 1.25rem;
    width: 56px; height: 56px;
  }
  .go-up i { font-size: 1.35rem; }
}

/* =========================
   ANIMACIONES SUTILES PARA FLOTANTES
   ========================= */

/* 1) Brinquito muy ligero + micro-scale (WhatsApp) */
@keyframes float-bounce {
  0%   { transform: translateY(0) scale(1); }
  20%  { transform: translateY(-2px) scale(1.02); }
  40%  { transform: translateY(0) scale(1); }
  60%  { transform: translateY(-1px) scale(1.01); }
  100% { transform: translateY(0) scale(1); }
}

/* 2) Micro-vibración muy sutil (Instagram) */
@keyframes micro-wiggle {
  0%   { transform: rotate(0deg); }
  25%  { transform: rotate(-2deg); }
  50%  { transform: rotate(0.8deg); }
  75%  { transform: rotate(-1deg); }
  100% { transform: rotate(0deg); }
}

/* Estado “atención”: menos específico para evitar fallos por orden de clases */
.floating-social__btn--wa.is-attention {
  animation: float-bounce 700ms ease-out both;
  will-change: transform;
}

.floating-social__btn--ig.is-attention {
  animation: micro-wiggle 550ms ease-in-out both;
  will-change: transform;
}

/* No molestar cuando el usuario interactúa */
.floating-social__btn:hover,
.floating-social__btn:focus-visible,
.floating-social__btn:active {
  animation: none !important;
  transform: none;
}

/* Respeto a usuarios con reducción de movimiento */
@media (prefers-reduced-motion: reduce) {
  .floating-social__btn {
    animation: none !important;
  }
}

/* >= 1024px: Tablet horizontal */
@media (min-width: 1024px) {
  .page { max-width: 840px; }
  .section { padding: 2.2rem 2.4rem; }

  /* En 3 columnas si el contenido lo permite */
  #waffles-belga .cards,
  #mini-waffles .cards:not(.cards--inline) {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Subtítulos/títulos ligeramente mayores */
  .section__title { font-size: clamp(1.7rem, 2.2vw, 2rem); }
  .section__subtitle { font-size: clamp(1.25rem, 1.8vw, 1.4rem); }
}

/* Mantén esta regla para las 2 tarjetas compactas a partir de ~380px */
@media (min-width: 380px) {
  .cards--inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
  }
}