/* ==========================================================================
   La Manne du Ciel — base.css
   Estilos COMPARTIDOS por todas las páginas (index.html y contact.html):
   variables, reset, tipografía, utilidades, botones, etiqueta de sección,
   cabecera (con logo) y pie de página.

   Índice:
     1. Tokens de diseño (variables)
     2. Reset y base + mapeo tipográfico por etiqueta
     3. Utilidades de layout
     4. Tipografía de secciones
     5. Botones
     6. Etiqueta de sección
     7. Cabecera y navegación
     8. Pie de página
   ========================================================================== */

/* 1. TOKENS DE DISEÑO ===================================================== */
:root {
  /* Paleta corporativa (no modificar para conservar la imagen de marca) */
  --navy: #0e1c38;
  --navy-light: #1a2f5c;
  --navy-deep: #080f1e;
  --gold: #c9a256;
  --gold-dark: #b8912a;
  --gold-light: #e2c07a;
  --sand: #e8dcc8;
  --sand-light: #f5f0e8;
  --cream: #faf8f3;
  --warm-gray: #8b8070;
  --muted: #b8a89a;
  --border-warm: #f0eae0;

  /* Tipografías (sustitutos gratuitos; cambiar por las de marca en fonts.css)
     --font-display  ->  H1, H2  (Wreath / Cormorant Garamond)
     --font-heading  ->  H3, H4  (Campaign Serif / Lora)
     --font-body     ->  resto   (Montserrat) */
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-heading: "Lora", Georgia, "Times New Roman", serif;
  --font-body: "Montserrat", system-ui, -apple-system, Segoe UI, sans-serif;

  /* Tamaños de texto de cuerpo (ajusta aquí para agrandar/reducir el texto) */
  --fs-body: 1.0625rem; /* texto normal (párrafos, subtítulos) */
  --fs-body-sm: 0.95rem; /* texto de apoyo (tarjetas, listas) */
  --fs-body-xs: 0.85rem; /* notas pequeñas */

  /* Colores de texto de cuerpo con más contraste según el fondo */
  --text-body-on-light: #57503f; /* sobre crema/arena: más oscuro que warm-gray */
  --text-body-on-dark: rgba(250, 248, 243, 0.85); /* sobre navy: más claro */

  /* Medidas */
  --maxw: 1280px;
  --gutter: 24px;
  --header-h: 96px; /* alto del navbar (el logo escala con --logo-h) */
  --logo-h: 62px; /* alto del logo en el navbar */
  --footer-logo-h: 112px; /* alto del logo en el pie */
  --formule-icon-size: 38px; /* tamaño de los iconos de "Nos formules" */

  /* Radios y sombras */
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-card: 0 4px 20px rgba(14, 28, 56, 0.06);
  --shadow-card-hover: 0 20px 40px rgba(14, 28, 56, 0.12);
  --shadow-form: 0 8px 40px rgba(14, 28, 56, 0.08);

  /* Transiciones */
  --t-fast: 0.2s ease;
  --t-med: 0.35s ease;
}

/* 2. RESET Y BASE ======================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* Compensa la cabecera fija al saltar a un ancla */
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--fs-body);
  background-color: var(--cream);
  color: var(--navy);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Mapeo tipográfico por etiqueta (petición: H1/H2, H3/H4 y "resto") */
h1,
h2 {
  font-family: var(--font-display);
  margin: 0;
}
h3,
h4 {
  font-family: var(--font-heading);
  margin: 0;
}
p {
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
}
button {
  font-family: inherit;
}

::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--cream);
}
::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 3px;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Enlace para saltar al contenido (accesibilidad / SEO) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--navy);
  color: var(--cream);
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  font-size: 0.85rem;
}
.skip-link:focus {
  left: 0;
}

[hidden] {
  display: none !important;
}

/* Compensación del header fijo para las secciones ancladas */
section[id],
div[id] {
  scroll-margin-top: var(--header-h);
}

/* 3. UTILIDADES DE LAYOUT =============================================== */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(56px, 8vw, 100px);
}
.section--cream {
  background: var(--cream);
}
.section--sand {
  background: var(--sand-light);
}
.section--navy {
  background: var(--navy);
}

.text-center {
  text-align: center;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 60px);
  align-items: center;
}
.split--top {
  align-items: start;
}

.section__head {
  margin-bottom: clamp(40px, 5vw, 56px);
}
.section__head--tight {
  margin-bottom: 40px;
}

/* 4. TIPOGRAFÍA DE SECCIONES ============================================ */
.section__title {
  font-weight: 600;
  color: var(--navy);
  line-height: 1.15;
  font-size: clamp(1.9rem, 4vw, 3rem);
  letter-spacing: 0.005em;
}
.section--navy .section__title {
  color: var(--cream);
}
.section__title em {
  font-style: italic;
  color: var(--gold);
}
.section__subtitle {
  margin-top: 16px;
  font-size: var(--fs-body);
  color: var(--text-body-on-light);
  line-height: 1.7;
  max-width: 580px;
}
.section__head.text-center .section__subtitle {
  margin-inline: auto;
}
.section--navy .section__subtitle {
  color: var(--text-body-on-dark);
}
/* Subtítulo que ocupa todo el ancho de su columna (no limitado a 580px) */
.section__subtitle--wide {
  max-width: none;
}
/* Contenedor estrecho (p. ej. bloque de FAQ) */
.container--narrow {
  max-width: 760px;
}

/* 5. BOTONES =========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 9999px;
  cursor: pointer;
  user-select: none;
  transition: background var(--t-fast), color var(--t-fast),
    border-color var(--t-fast), transform var(--t-fast);
}
.btn:active {
  transform: translateY(1px);
}
.btn--sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
}
.btn--md {
  padding: 0.75rem 1.75rem;
  font-size: 0.875rem;
}
.btn--lg {
  padding: 1rem 2.25rem;
  font-size: 1rem;
}
.btn--primary {
  background: var(--gold);
  color: var(--cream);
  box-shadow: 0 1px 2px rgba(14, 28, 56, 0.1);
}
.btn--primary:hover {
  background: var(--gold-dark);
}
.btn--secondary {
  background: var(--navy);
  color: var(--cream);
}
.btn--secondary:hover {
  background: var(--navy-light);
}
.btn--ghost {
  background: transparent;
  border-color: var(--sand);
  color: var(--navy);
}
.btn--ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.btn--outline-light {
  background: transparent;
  border-color: rgba(250, 248, 243, 0.6);
  color: var(--cream);
}
.btn--outline-light:hover {
  background: rgba(250, 248, 243, 0.1);
}
.btn--block {
  width: 100%;
}

/* 6. ETIQUETA DE SECCIÓN =============================================== */
.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
}
.section-label::before {
  content: "";
  width: 28px;
  height: 1.5px;
  background: var(--gold);
  flex-shrink: 0;
}
.section-label span {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
}

/* 7. CABECERA Y NAVEGACIÓN ============================================= */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--t-med), backdrop-filter var(--t-med),
    border-color var(--t-med);
}
.site-header.is-scrolled {
  background: rgba(14, 28, 56, 0.97);
  backdrop-filter: blur(12px);
  border-bottom-color: rgba(201, 162, 86, 0.15);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 16px;
}

/* Logo */
.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}
.brand__logo {
  height: var(--logo-h);
  width: auto;
  display: block;
}

/* Navegación de escritorio */
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}
.nav-link {
  position: relative;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--cream);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 12px;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--t-fast);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 12px;
  bottom: 2px;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width 0.3s ease;
}
.nav-link:hover {
  color: var(--gold);
}
.nav-link:hover::after {
  width: calc(100% - 24px);
}
.nav-link.is-active {
  color: var(--gold);
}
.nav-link.is-active::after {
  width: calc(100% - 24px);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.header__tel {
  display: none;
  color: var(--gold);
  align-items: center;
}
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--cream);
  padding: 4px;
  line-height: 0;
}
.menu-toggle .icon-close {
  display: none;
}
.menu-toggle.is-open .icon-open {
  display: none;
}
.menu-toggle.is-open .icon-close {
  display: block;
}

/* Menú móvil */
.mobile-menu {
  display: none;
  background: var(--navy);
  border-top: 1px solid rgba(201, 162, 86, 0.2);
  padding: 16px 24px 24px;
}
.mobile-menu.is-open {
  display: block;
}
.mobile-menu__link {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: var(--cream);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.mobile-menu__link.is-active {
  color: var(--gold);
}
.mobile-menu__cta {
  margin-top: 20px;
}
.mobile-menu__social {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

/* 8. PIE DE PÁGINA ===================================================== */
.site-footer {
  background: var(--navy-deep);
  color: var(--cream);
  padding: clamp(48px, 6vw, 80px) 24px clamp(40px, 5vw, 56px);
}
/* 3 columnas: [logo] · [descripción + redes] · [contacto] */
.footer__top {
  display: grid;
  grid-template-columns: auto 1.5fr 1.1fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
.footer__col--brand {
  display: flex;
  align-items: flex-start;
}
.footer__brand-link {
  display: inline-block;
  text-decoration: none;
}
.footer__brand-logo {
  height: var(--footer-logo-h);
  width: auto;
}
.footer__about {
  font-size: var(--fs-body-sm);
  color: var(--text-body-on-dark);
  line-height: 1.8;
  margin-bottom: 24px;
  max-width: 380px;
}
.footer__socials-title,
.footer__col-title {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}
.footer__socials {
  display: flex;
  gap: 12px;
}
.social-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cream);
  transition: background var(--t-fast), color var(--t-fast),
    transform var(--t-fast);
}
.social-btn:hover {
  background: var(--gold);
  color: var(--navy-deep);
  transform: translateY(-2px);
}
.footer__contact {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.footer__contact a,
.footer__contact div {
  display: flex;
  gap: 10px;
  align-items: center;
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  color: var(--text-body-on-dark);
  text-decoration: none;
  transition: color var(--t-fast);
}
.footer__contact a:hover {
  color: var(--cream);
}
.footer__contact svg {
  flex-shrink: 0;
  color: var(--gold);
}

/* --- Responsive compartido -------------------------------------------- */

/* Navegación: menú hamburguesa por debajo de 860px */
@media (max-width: 860px) {
  .main-nav,
  .header__cta {
    display: none;
  }
  .header__tel {
    display: flex;
  }
  .menu-toggle {
    display: block;
  }
}

/* Pie: de 3 columnas a una sola cuando falta espacio */
@media (max-width: 900px) {
  .footer__top {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}

/* Layouts a dos columnas -> una */
@media (max-width: 768px) {
  .split {
    grid-template-columns: 1fr;
  }
}

/* Móvil: navbar y logos ligeramente más compactos (vía variables) */
@media (max-width: 600px) {
  :root {
    --header-h: 78px;
    --logo-h: 50px;
    --footer-logo-h: 92px;
  }
}

@media (max-width: 480px) {
  :root {
    --gutter: 18px;
  }
}
