/* ================================================================
   Comiendo al Mundo · Sistema visual compartido (v1)
   Cargado por: index.html, landing-restaurantes.html,
   historia.html, recomendaciones.html
   ================================================================ */

:root {
  /* ============ Tokens del Design System ============ */
  --red: #D80303;
  --red-deep: #4A0000;
  --red-soft: #FFEFEF;
  --white: #FFFFFF;
  --gray-50: #FAFAFA;
  --gray-100: #F5F5F5;
  --gray-300: #E8E8E8;
  --gray-500: #9B9B9B;
  --gray-700: #2A2A2A;
  --gray-900: #0F0F0F;
  --gold: #FAA307;
  --gold-soft: #FFF4DD;
  --peach: #FFF6F1;

  /* Tipografía */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-script: 'Caveat', cursive;

  /* Espaciado */
  --space-2xs: 8px;
  --space-xs:  14px;
  --space-sm:  22px;
  --space-md:  32px;
  --space-lg:  48px;
  --space-xl:  72px;
  --space-2xl: 108px;

  /* Sombras */
  --shadow-pill: 0 6px 18px rgba(0,0,0,0.08);
  --shadow-card: 0 12px 36px rgba(0,0,0,0.06);
  --shadow-cta:  0 8px 24px rgba(216,3,3,0.35);

  /* Radios */
  --r-pill: 100px;
  --r-card: 24px;
  --r-callout: 16px;
  --r-cta: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--white);
  color: var(--gray-700);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  min-height: 100svh;
}

body {
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  visibility: hidden;

  background:
    radial-gradient(ellipse 60% 40% at 85% 0%, rgba(216, 3, 3, 0.07), transparent 70%),
    radial-gradient(ellipse 50% 35% at 10% 100%, rgba(216, 3, 3, 0.04), transparent 70%),
    linear-gradient(170deg, var(--white) 0%, var(--peach) 100%);
  background-attachment: fixed, fixed, fixed;
  background-repeat: no-repeat, no-repeat, no-repeat;
}
body.lang-ready { visibility: visible; }

/* ============ Wrapper general ============ */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 22px 40px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.wrap-wide {
  max-width: 860px;
}

/* ============ Top row: logo + lang switcher ============ */
.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: var(--space-lg);
  animation: fadeUp 0.5s ease 0s both;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  height: 36px;
  width: auto;
  display: block;
}

.brand-fallback {
  display: none;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--red);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-pill);
}
.brand-mark .plate {
  display: block;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--red);
}

.brand-name {
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: 18px;
  line-height: 1;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}
.brand-name .accent {
  font-family: var(--font-script);
  font-weight: 700;
  font-style: italic;
  color: var(--red);
  font-size: 1.35em;
  letter-spacing: -0.01em;
  padding-left: 2px;
}

/* Lang switcher */
.lang-switch {
  display: inline-flex;
  background: var(--gray-100);
  border-radius: var(--r-pill);
  padding: 3px;
}
.lang-switch button {
  border: 0;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--gray-500);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.lang-switch button[aria-pressed="true"] {
  background: var(--gray-900);
  color: var(--white);
}

/* ============ Main ============ */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 580px;
  width: 100%;
  margin: 0 auto;
}
main.main-wide {
  max-width: 720px;
}

/* Eyebrow pill */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--red);
  background: var(--red-soft);
  padding: 8px 14px;
  border-radius: var(--r-pill);
  align-self: flex-start;
  margin-bottom: var(--space-md);
}
.eyebrow .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--red);
  animation: pulse 1.8s ease-in-out infinite;
}

/* H1 hero */
h1 {
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: clamp(32px, 5.8vw, 48px);
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--red-deep);
  margin: 0 0 var(--space-md);
}
h1 .accent {
  color: var(--red);
  font-family: var(--font-script);
  font-weight: 700;
  font-style: italic;
  font-size: 1.22em;
  letter-spacing: -0.01em;
  line-height: 0.85;
  display: inline-block;
  transform: translateY(0.06em);
}

/* H2 (subtítulo de capítulo en historia) */
h2 {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(22px, 4vw, 30px);
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--gray-900);
  margin: 0 0 var(--space-sm);
}

/* H3 (subtítulo menor) */
h3 {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--gray-900);
  margin: 0 0 var(--space-xs);
}

/* Ledes */
.lede {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--gray-700);
  margin: 0 0 var(--space-sm);
}
.lede strong { color: var(--gray-900); font-weight: 700; }
.lede.tight { margin-bottom: var(--space-lg); }
.lede.callout {
  background: var(--gray-100);
  border-radius: var(--r-callout);
  padding: 14px 18px;
  font-size: 15px;
  color: var(--gray-900);
  margin-bottom: var(--space-lg);
}
.lede.callout strong { color: var(--gray-900); font-weight: 800; }

/* Body text de lectura larga */
.body-text {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.7;
  color: var(--gray-700);
  margin: 0 0 var(--space-sm);
}
.body-text strong { color: var(--gray-900); font-weight: 700; }

/* reCAMendaciones */
.recam {
  font-weight: 700;
  color: var(--gray-900);
  white-space: nowrap;
}
.recam .cam { color: var(--red); font-weight: 900; }

/* ============ Pills ============ */
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--space-lg);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  background: var(--white);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-700);
}
.pill .pill-icon {
  font-size: 14px;
  line-height: 1;
}

/* ============ Botones ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  min-height: 56px;
  border-radius: var(--r-cta);
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  border: 0;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  letter-spacing: -0.005em;
  line-height: 1.15;
  min-width: 0;
  text-align: center;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: rgba(216, 3, 3, 0.78);
  color: var(--white);
  border: 2px solid var(--red);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow-cta);
}
.btn-primary:hover {
  background: rgba(216, 3, 3, 0.92);
  border-color: var(--red-deep);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.55);
  color: var(--red-deep);
  border: 2px solid var(--red);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.78);
  color: var(--red);
}

.btn .icon {
  width: 17px; height: 17px;
  stroke: currentColor; fill: none;
  stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}

/* Botón solicitud full width (para historia y final de páginas) */
.btn-block {
  display: flex;
  width: 100%;
  margin-top: var(--space-md);
}

/* CTA row con dos botones */
.cta-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 10px;
  margin-bottom: var(--space-xl);
}
.cta-row .btn { flex: 1 1 0; }

/* ============ Accordion ============ */
.accordion-section {
  margin-bottom: var(--space-xl);
}
.accordion-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--red);
  margin-bottom: var(--space-md);
}
.accordion-title .wave {
  flex: 1;
  height: 8px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 8' preserveAspectRatio='none'><path d='M0 4 Q 15 0, 30 4 T 60 4' stroke='%23D80303' stroke-width='1.2' fill='none' opacity='0.45'/></svg>");
  background-repeat: repeat-x;
  background-size: 60px 8px;
}

.accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.acc-item {
  background: var(--white);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--r-card);
  overflow: hidden;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.acc-item[open] {
  border-color: var(--red);
  box-shadow: var(--shadow-card);
}
.acc-summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-sans);
  font-size: 15.5px;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.01em;
  user-select: none;
}
.acc-summary::-webkit-details-marker { display: none; }
.acc-summary::marker { display: none; content: ''; }
.acc-summary .acc-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}
.acc-summary .acc-label {
  flex: 1;
  line-height: 1.3;
}
.acc-summary .acc-chevron {
  width: 20px; height: 20px;
  flex-shrink: 0;
  color: var(--red);
  stroke: currentColor;
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s ease;
}
.acc-item[open] .acc-chevron { transform: rotate(180deg); }
.acc-body {
  padding: 0 22px 22px 22px;
  color: var(--gray-700);
  font-size: 14.5px;
  line-height: 1.65;
  min-width: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
}
.acc-body p { margin: 0 0 12px; }
.acc-body p:last-child { margin-bottom: 0; }
.acc-body strong { color: var(--gray-900); font-weight: 700; }

/* Quote y note dentro de acordeón o lectura */
.acc-quote, .quote-box {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--red-deep);
  background: var(--red-soft);
  padding: 14px 18px;
  border-radius: var(--r-callout);
  margin: 16px 0 4px;
}
.acc-quote strong, .quote-box strong { color: var(--red-deep); font-weight: 800; }

.acc-note, .note-box {
  background: var(--gray-50);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--r-callout);
  padding: 16px 18px;
  margin: 16px 0 4px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--gray-700);
}
.acc-note .acc-note-title, .note-box-title {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--red);
  margin-bottom: 8px;
  display: block;
}
.acc-note p, .note-box p { margin: 0 0 8px; }
.acc-note p:last-child, .note-box p:last-child { margin-bottom: 0; }
.acc-note strong, .note-box strong { color: var(--gray-900); font-weight: 700; }

/* ============ Tablas ============ */
.acc-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 14px 0 4px;
  font-size: 13.5px;
  table-layout: fixed;
  background: var(--white);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--r-callout);
  overflow: hidden;
}
.acc-table caption {
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gray-500);
  padding-bottom: 10px;
  caption-side: top;
}
.acc-table th, .acc-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--gray-300);
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.acc-table thead th {
  background: var(--gray-100);
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-500);
}
.acc-table td {
  font-weight: 600;
  color: var(--gray-700);
}
.acc-table td:last-child {
  color: var(--red);
  font-weight: 800;
}
.acc-table td .star {
  color: var(--gold);
  font-weight: 900;
}
.acc-table tr:last-child td { border-bottom: 0; }

/* ============ Closing ============ */
.closing {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.closing .wave {
  flex: 1;
  height: 8px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 8' preserveAspectRatio='none'><path d='M0 4 Q 15 0, 30 4 T 60 4' stroke='%239B9B9B' stroke-width='1.2' fill='none' opacity='0.5'/></svg>");
  background-repeat: repeat-x;
  background-size: 60px 8px;
}
.closing strong { color: var(--gray-900); font-weight: 700; }

/* ============ Toast ============ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--gray-900);
  color: var(--white);
  padding: 13px 22px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.3s ease;
  pointer-events: none;
  box-shadow: 0 12px 32px rgba(0,0,0,0.22);
  z-index: 50;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============ Animaciones ============ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.4); }
}

/* ============ Mobile ============ */
@media (max-width: 540px) {
  .wrap { padding: 16px 18px 32px; }
  .top-row { margin-bottom: var(--space-md); }
  h1 { margin-bottom: var(--space-sm); }
  .lede { font-size: 15.5px; }
  .lede.tight { margin-bottom: var(--space-md); }
  .lede.callout { font-size: 14.5px; margin-bottom: var(--space-md); }
  .body-text { font-size: 16px; }
  .pills { margin-bottom: var(--space-md); }
  .cta-row { margin-bottom: var(--space-lg); gap: 8px; }
  .btn { min-height: 60px; font-size: 14px; padding: 0 14px; gap: 7px; }
  .btn .icon { width: 17px; height: 17px; stroke-width: 2.4; }
  .accordion-section { margin-bottom: var(--space-lg); }
  .acc-summary { padding: 16px 18px; font-size: 15px; }
  .acc-body { padding: 0 18px 18px; font-size: 14px; }
}

@media (max-width: 380px) {
  .btn { min-height: 58px; font-size: 13px; padding: 0 12px; gap: 6px; }
  .btn .icon { width: 15px; height: 15px; }
  .pills { gap: 6px; }
  .pill { font-size: 11.5px; padding: 6px 12px; }
  .acc-summary .acc-icon { width: 32px; height: 32px; font-size: 16px; }
}

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