/* ==========================================================================
   BASE
   Colores (cambiar acá por cliente), tipografía, layout de secciones,
   botones, formularios y piezas compartidas por el sitio y el panel.
   Pensado primero para celular: los @media agregan cosas en pantallas grandes.
   ========================================================================== */

:root {
  /* ---- Paleta: blancos cálidos + verde salvia + celeste suave ---- */
  --bg: #fbfaf6;            /* fondo general (blanco cálido) */
  --surface: #ffffff;       /* tarjetas */
  --surface-alt: #f1f7f3;   /* secciones alternas (verde muy suave) */
  --ink: #1d2b28;           /* texto principal */
  --ink-soft: #5b6b67;      /* texto secundario */
  --line: #e2ebe6;          /* bordes */

  --primary: #2f8f6f;       /* verde de marca: botones, links, acentos */
  --primary-dark: #22715a;
  --primary-soft: #e2f2ea;
  --sky: #4fa3d1;           /* celeste: detalles e info */
  --sky-soft: #e5f2f9;
  --warm: #f0a04b;          /* naranja suave: estrellas, huellitas */
  --warm-soft: #fdf1e2;
  --danger: #d64d43;        /* urgencias y cancelar */
  --danger-soft: #fdecea;
  --whatsapp: #25d366;

  /* ---- Formas y sombras ---- */
  --radius: 22px;
  --radius-sm: 14px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(29, 43, 40, .06), 0 2px 8px rgba(29, 43, 40, .05);
  --shadow: 0 6px 24px rgba(29, 43, 40, .08);
  --shadow-lg: 0 18px 50px rgba(29, 43, 40, .14);

  /* ---- Tipografía y medidas ---- */
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --container: 1160px;
  --gutter: 20px;
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Que "hidden" gane siempre, aunque la clase tenga su propio display. */
[hidden] { display: none !important; }

img { max-width: 100%; display: block; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0; font-weight: 800; letter-spacing: -.01em; }
p { margin: 0; }
svg { flex-shrink: 0; }

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

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm);
  text-decoration: none; font-weight: 700;
}
.skip-link:focus { top: 12px; }

/* ---------- Layout de secciones ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

.section { padding: 64px 0; }
.section--alt { background: var(--surface-alt); }
.section[hidden] { display: none; }

.section__head { max-width: 640px; margin-bottom: 32px; }
.section__head--center { margin-left: auto; margin-right: auto; text-align: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--primary); margin-bottom: 10px;
}
.eyebrow::before {
  content: ""; width: 18px; height: 18px; border-radius: 50%;
  background: var(--warm-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f0a04b'%3E%3Ccircle cx='6.5' cy='10' r='2'/%3E%3Ccircle cx='10' cy='5.5' r='2'/%3E%3Ccircle cx='14.5' cy='5.5' r='2'/%3E%3Ccircle cx='18' cy='10' r='2'/%3E%3Cpath d='M12 11.5c-2.6 0-5.5 3.4-5.5 6 0 1.6 1.3 2.5 2.8 2.5 1 0 1.8-.5 2.7-.5s1.7.5 2.7.5c1.5 0 2.8-.9 2.8-2.5 0-2.6-2.9-6-5.5-6Z'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.section__title { font-size: clamp(1.7rem, 5.5vw, 2.5rem); }
.section__title em { font-style: normal; color: var(--primary); }
.section__intro { margin-top: 12px; color: var(--ink-soft); font-size: 1.05rem; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px;
  border: 2px solid transparent; border-radius: var(--radius-pill);
  font-weight: 800; font-size: 1rem; line-height: 1.1; text-decoration: none; cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, transform .15s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 20px; height: 20px; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

.btn--primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(47, 143, 111, .28); }
.btn--primary:hover:not([disabled]) { background: var(--primary-dark); }

.btn--danger { background: var(--danger); color: #fff; box-shadow: 0 6px 16px rgba(214, 77, 67, .25); }
.btn--danger:hover { background: #bd3d34; }

.btn--outline { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn--outline:hover:not([disabled]) { border-color: var(--primary); color: var(--primary); }

.btn--soft { background: var(--primary-soft); color: var(--primary-dark); }
.btn--soft:hover { background: #d2eadf; }

.btn--whatsapp { background: var(--whatsapp); color: #fff; }
.btn--whatsapp:hover { background: #1ebe5a; }

.btn--ghost { background: transparent; color: var(--ink-soft); padding-inline: 12px; }
.btn--ghost:hover { color: var(--ink); background: rgba(29, 43, 40, .05); }

.btn--sm { min-height: 38px; padding: 8px 14px; font-size: .9rem; }
.btn--sm svg { width: 17px; height: 17px; }
.btn--block { width: 100%; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 800; text-decoration: none;
}
.link-arrow svg { width: 18px; height: 18px; transition: transform .2s; }
.link-arrow:hover svg { transform: translateX(3px); }

/* ---------- Formularios ---------- */
.form { display: grid; gap: 16px; }
.form__row { display: grid; gap: 16px; }

.field { display: grid; gap: 6px; }
.field > label, .field__label { font-weight: 800; font-size: .95rem; }
.field__opt { font-weight: 600; color: var(--ink-soft); font-size: .85rem; }
.field__help { font-size: .85rem; color: var(--ink-soft); }

.field input, .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-sm);
  font-size: 1rem; /* 16px: evita el zoom automático en iPhone */
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft);
}
.field.is-invalid input, .field.is-invalid textarea { border-color: var(--danger); }
.field__error { color: var(--danger); font-size: .85rem; font-weight: 700; }
.field__error:empty { display: none; }

.check { display: flex; align-items: flex-start; gap: 10px; font-size: .95rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--primary); flex-shrink: 0; }

/* Opciones tipo pastilla (especie, sexo, filtros). */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 8px 16px;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-pill);
  font-weight: 700; cursor: pointer; transition: border-color .2s, background-color .2s, color .2s;
}
.chip svg { width: 20px; height: 20px; }
.chip:hover { border-color: var(--primary); }
.chip[aria-pressed="true"], .chip[aria-checked="true"], .chip.is-active {
  background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark);
}

/* ---------- Piezas compartidas ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.icon-bubble {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px;
  background: var(--primary-soft); color: var(--primary);
}
.icon-bubble svg { width: 26px; height: 26px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: .78rem; font-weight: 800; background: var(--sky-soft); color: #2b739b;
}

/* Logo: huellita + texto. */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo__mark {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px;
  background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(47, 143, 111, .3);
}
.logo__mark svg { width: 24px; height: 24px; }
.logo__text { display: grid; line-height: 1.05; }
.logo__tagline { font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--primary); }
.logo__name { font-size: 1.15rem; font-weight: 900; }

.socials { display: flex; gap: 10px; list-style: none; margin: 0; padding: 0; }
.social {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); transition: .2s;
}
.social svg { width: 20px; height: 20px; }
.social:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Recuadro con iniciales cuando una foto no carga. */
.foto-respaldo {
  display: grid; place-items: center; width: 100%; height: 100%; aspect-ratio: inherit;
  background: linear-gradient(135deg, var(--primary-soft), var(--sky-soft));
  color: var(--primary); font-weight: 900; font-size: 2rem;
}

/* Aviso de urgencias (reserva y ubicación). */
.aviso-urgencia {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px; border-radius: var(--radius-sm);
  background: var(--danger-soft); border: 1px solid #f6cfcb; color: #7d2a24;
}
.aviso-urgencia > svg { width: 24px; height: 24px; color: var(--danger); margin-top: 2px; }
.aviso-urgencia strong { display: block; color: #6b201b; }
.aviso-urgencia p { font-size: .92rem; }
.aviso-urgencia .btn { margin-top: 10px; }

/* Aparición suave al hacer scroll (clase que agrega header.js). */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@media (min-width: 640px) {
  :root { --gutter: 28px; }
  .form__row--2 { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 960px) {
  :root { --header-h: 76px; }
  .section { padding: 96px 0; }
  .section__head { margin-bottom: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
