/* ==========================================================================
   Farmacia Bueno — Pego (Alicante)
   Sistema de diseño. Paleta extraída del logo vectorial de 2019.
   Sin fuentes externas, sin peticiones de terceros, sin cookies.
   Público objetivo: población envejecida, >70% móvil. Tipografía grande,
   alto contraste, objetivos táctiles de 48px mínimo.
   ========================================================================== */

:root {
  /* Paleta del logo */
  --verde: #008065;
  --verde-oscuro: #005947;
  --verde-claro: #E6F2EF;
  --lima: #94D600;
  --lima-oscuro: #6BA300;
  --beige: #C2B59B;
  --tostado: #C49A6C;

  /* Neutros cálidos (no blanco puro: cansa menos la vista) */
  --papel: #FDFCF9;
  --papel-alt: #F6F3EC;
  --tinta: #23302C;
  --tinta-suave: #5A6862;
  --borde: #E3DDD1;

  /* Estados */
  --abierta: #0F8A3C;
  --cerrada: #B23A2E;

  /* Tipografía */
  --fuente: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --base: 1.125rem;      /* 18px */
  --escala-h1: clamp(2rem, 5vw, 3rem);
  --escala-h2: clamp(1.5rem, 3.5vw, 2.125rem);
  --escala-h3: clamp(1.25rem, 2.5vw, 1.5rem);

  /* Espacio */
  --gap: 1.25rem;
  --seccion: clamp(3rem, 8vw, 5.5rem);
  --ancho: 68rem;
  --ancho-texto: 40rem;

  /* Forma — ecos de la píldora y la tirita del logo */
  --radio: 14px;
  --radio-grande: 28px;
  --radio-pildora: 999px;

  --sombra: 0 1px 2px rgba(35, 48, 44, .04), 0 8px 24px rgba(35, 48, 44, .06);
}

/* --------------------------------------------------------------- Base --- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--fuente);
  font-size: var(--base);
  line-height: 1.65;
  color: var(--tinta);
  background: var(--papel);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  color: var(--verde-oscuro);
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: 0 0 .6em;
  text-wrap: balance;
}

h1 { font-size: var(--escala-h1); }
h2 { font-size: var(--escala-h2); margin-top: 2.5rem; }
h3 { font-size: var(--escala-h3); margin-top: 2rem; }

p, li { max-width: var(--ancho-texto); }
p { margin: 0 0 1.15em; }

a { color: var(--verde); text-underline-offset: .18em; }
a:hover { color: var(--verde-oscuro); }

strong { color: var(--verde-oscuro); }

img, svg { max-width: 100%; height: auto; }

:focus-visible {
  outline: 3px solid var(--lima-oscuro);
  outline-offset: 3px;
  border-radius: 4px;
}

.contenedor {
  width: 100%;
  max-width: var(--ancho);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.saltar {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--verde);
  color: #fff;
  padding: .9rem 1.4rem;
  z-index: 100;
  border-radius: 0 0 var(--radio) 0;
}
.saltar:focus { left: 0; }

/* ------------------------------------------------------------ Cabecera --- */

.cabecera {
  background: var(--papel);
  border-bottom: 1px solid var(--borde);
  position: sticky;
  top: 0;
  z-index: 50;
}

.cabecera__fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  padding-block: .7rem;
}

.marca {
  display: flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
  color: var(--verde-oscuro);
  flex-shrink: 0;
}
.marca img { width: 46px; height: 46px; }
.marca__texto { display: flex; flex-direction: column; line-height: 1.15; }
.marca__nombre { font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.marca__lugar { font-size: .8rem; color: var(--tinta-suave); font-weight: 500; }

.nav-boton {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--verde-claro);
  color: var(--verde-oscuro);
  border: 1px solid var(--borde);
  border-radius: var(--radio-pildora);
  padding: .6rem 1rem;
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
}

.nav {
  display: none;
  border-top: 1px solid var(--borde);
  padding-block: .5rem 1rem;
}
.nav[data-abierto="true"] { display: block; }

.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.nav a {
  display: block;
  padding: .8rem .75rem;
  border-radius: var(--radio);
  text-decoration: none;
  font-weight: 600;
  color: var(--tinta);
  min-height: 48px;
}
.nav a:hover, .nav a[aria-current="page"] {
  background: var(--verde-claro);
  color: var(--verde-oscuro);
}

@media (min-width: 62rem) {
  .nav-boton { display: none; }
  .nav { display: block; border-top: 0; padding: 0; }
  .nav ul { flex-direction: row; align-items: center; gap: .2rem; }
  .nav a { padding: .55rem .8rem; font-size: .95rem; min-height: 0; }
}

/* ---------------------------------------------------------------- Hero --- */

.hero {
  background:
    radial-gradient(120% 90% at 88% 0%, var(--verde-claro) 0%, transparent 62%),
    var(--papel);
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  border-bottom: 1px solid var(--borde);
}

.hero__grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}
@media (min-width: 56rem) {
  .hero__grid { grid-template-columns: 1.15fr .85fr; gap: 3.5rem; }
}

.hero h1 { margin-bottom: .35em; }

.hero__entradilla {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--tinta-suave);
  max-width: 34rem;
}

.hero__figura {
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.hero__figura img { width: min(300px, 78%); }

/* -------------------------------------------------------------- Estado --- */

.estado {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: var(--radio-pildora);
  padding: .5rem 1.05rem .5rem .8rem;
  font-weight: 600;
  font-size: .95rem;
  box-shadow: var(--sombra);
  margin-bottom: 1.1rem;
}
.estado__punto {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--tinta-suave);
  flex-shrink: 0;
}
.estado[data-estado="abierta"] { color: var(--abierta); }
.estado[data-estado="abierta"] .estado__punto {
  background: var(--abierta);
  box-shadow: 0 0 0 4px rgba(15, 138, 60, .16);
}
.estado[data-estado="cerrada"] { color: var(--cerrada); }
.estado[data-estado="cerrada"] .estado__punto { background: var(--cerrada); }

/* ------------------------------------------------------------- Botones --- */

.acciones {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  margin-top: 1.6rem;
}

.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 56px;
  padding: .85rem 1.5rem;
  border-radius: var(--radio-pildora);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.boton:active { transform: translateY(1px); }

.boton--primario {
  background: var(--verde);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 128, 101, .28);
}
.boton--primario:hover { background: var(--verde-oscuro); color: #fff; }

.boton--whatsapp {
  background: #fff;
  color: var(--verde-oscuro);
  border-color: var(--verde);
}
.boton--whatsapp:hover { background: var(--verde-claro); }

.boton--lima {
  background: var(--lima);
  color: #1B2E00;
  box-shadow: 0 4px 14px rgba(148, 214, 0, .3);
}
.boton--lima:hover { background: var(--lima-oscuro); color: #fff; }

.boton svg { width: 22px; height: 22px; flex-shrink: 0; }

/* ------------------------------------------------------------ Secciones --- */

.seccion { padding-block: var(--seccion); }
.seccion--alt { background: var(--papel-alt); border-block: 1px solid var(--borde); }

.seccion__intro { max-width: var(--ancho-texto); margin-bottom: 2.5rem; }
.seccion h2:first-child { margin-top: 0; }

/* -------------------------------------------------------------- Tarjetas --- */

.rejilla {
  display: grid;
  gap: 1.15rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.tarjeta {
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: var(--radio-grande);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--sombra);
  transition: transform .14s ease, border-color .14s ease;
}
a.tarjeta:hover {
  transform: translateY(-3px);
  border-color: var(--verde);
}
.tarjeta h3 { margin: 0; font-size: 1.2rem; }
.tarjeta p { margin: 0; color: var(--tinta-suave); font-size: 1rem; }
.tarjeta__icono {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: var(--verde-claro);
  border-radius: var(--radio);
  margin-bottom: .35rem;
}
.tarjeta__icono svg { width: 26px; height: 26px; color: var(--verde); }
.tarjeta__mas {
  margin-top: auto;
  padding-top: .8rem;
  font-weight: 700;
  color: var(--verde);
  font-size: .95rem;
}

/* -------------------------------------------------------------- Guardia --- */

.guardia {
  background: #fff;
  border: 2px solid var(--verde);
  border-radius: var(--radio-grande);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: var(--sombra);
}
.guardia__etiqueta {
  display: inline-block;
  background: var(--verde-claro);
  color: var(--verde-oscuro);
  border-radius: var(--radio-pildora);
  padding: .35rem .9rem;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.guardia__nombre {
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  color: var(--verde-oscuro);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 .35rem;
}
.guardia__dato {
  font-size: 1.1rem;
  margin: 0 0 .3rem;
  max-width: none;
}
.guardia__horario {
  display: inline-block;
  background: var(--papel-alt);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: .5rem 1rem;
  font-weight: 700;
  color: var(--verde-oscuro);
  margin-top: .75rem;
}
.guardia__actualizado {
  font-size: .9rem;
  color: var(--tinta-suave);
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--borde);
  max-width: none;
}

/* ---------------------------------------------------------------- Tablas --- */

.tabla-scroll { overflow-x: auto; margin-block: 1.5rem; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  min-width: 22rem;
}
caption {
  text-align: left;
  font-weight: 700;
  color: var(--verde-oscuro);
  padding-bottom: .7rem;
}
th, td {
  text-align: left;
  padding: .8rem .9rem;
  border-bottom: 1px solid var(--borde);
}
th {
  background: var(--verde-claro);
  color: var(--verde-oscuro);
  font-weight: 700;
  white-space: nowrap;
}
tbody tr:hover { background: var(--papel-alt); }
tr[data-hoy="true"] { background: #FFFBEA; }
tr[data-hoy="true"] th, tr[data-hoy="true"] td { border-bottom-color: var(--tostado); }
tr[data-hoy="true"] th { background: #FBF0C9; }

.tabla__sub {
  display: block;
  color: var(--tinta-suave);
  font-size: .9rem;
  font-weight: 400;
  line-height: 1.4;
}

/* ------------------------------------------------------------------ Aviso --- */

.aviso {
  border-left: 5px solid var(--tostado);
  background: var(--papel-alt);
  border-radius: 0 var(--radio) var(--radio) 0;
  padding: 1.1rem 1.35rem;
  margin-block: 1.75rem;
}
.aviso p:last-child { margin-bottom: 0; }
.aviso strong { color: var(--verde-oscuro); }
.aviso--legal { border-left-color: var(--cerrada); }

/* --------------------------------------------------------------- Reseñas --- */

.resenas { display: grid; gap: 1.15rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.resena {
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: var(--radio-grande);
  padding: 1.5rem;
  box-shadow: var(--sombra);
}
.resena__estrellas { color: var(--tostado); font-size: 1.1rem; letter-spacing: .1em; }
.resena p { font-size: 1rem; margin: .7rem 0; }
.resena cite { font-style: normal; font-weight: 700; color: var(--verde-oscuro); font-size: .95rem; }

/* ------------------------------------------------------------- Preguntas --- */

.faq { max-width: var(--ancho-texto); }
.faq details {
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  background: #fff;
  margin-bottom: .7rem;
  overflow: hidden;
}
.faq summary {
  padding: 1rem 1.2rem;
  font-weight: 700;
  color: var(--verde-oscuro);
  cursor: pointer;
  min-height: 48px;
  display: flex;
  align-items: center;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  margin-left: auto;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--verde);
  line-height: 1;
}
.faq details[open] summary::after { content: "\2212"; }
.faq details > *:not(summary) { padding-inline: 1.2rem; }
.faq details > p:last-child { padding-bottom: 1.1rem; }

/* ------------------------------------------------------------- Formulario --- */

.formulario { max-width: var(--ancho-texto); }
.campo { margin-bottom: 1.25rem; }
.campo label { display: block; font-weight: 700; margin-bottom: .4rem; color: var(--verde-oscuro); }
.campo input, .campo select, .campo textarea {
  width: 100%;
  font: inherit;
  padding: .85rem 1rem;
  border: 2px solid var(--borde);
  border-radius: var(--radio);
  background: #fff;
  color: var(--tinta);
  min-height: 52px;
}
.campo input:focus, .campo select:focus, .campo textarea:focus {
  border-color: var(--verde);
  outline: none;
}
.campo textarea { min-height: 8rem; resize: vertical; }
.campo__ayuda { font-size: .9rem; color: var(--tinta-suave); margin-top: .35rem; }
.consentimiento { display: flex; gap: .75rem; align-items: flex-start; }
.consentimiento input { width: 24px; height: 24px; min-height: 0; flex-shrink: 0; margin-top: .25rem; }
.consentimiento label { font-weight: 400; font-size: .95rem; color: var(--tinta); }

/* ---------------------------------------------------------------- Mapa --- */

/* El mapa NO se carga solo: es la única cosa de toda la web que contactaría con
   un tercero, y hacerlo sin permiso echaría por tierra el «sin cookies, sin
   banner». Se muestra un marcador y el iframe se inserta al pulsar. */
.mapa {
  border: 1px solid var(--borde);
  border-radius: var(--radio-grande);
  overflow: hidden;
  box-shadow: var(--sombra);
  background: var(--papel-alt);
}
.mapa iframe { display: block; width: 100%; height: 24rem; border: 0; }

.mapa__aviso {
  min-height: 20rem;
  display: grid;
  place-content: center;
  gap: .9rem;
  text-align: center;
  padding: 2.5rem 1.5rem;
  background:
    repeating-linear-gradient(45deg, transparent, transparent 14px, rgba(194,181,155,.14) 14px, rgba(194,181,155,.14) 28px),
    var(--papel-alt);
}
.mapa__aviso svg { width: 44px; height: 44px; color: var(--verde); justify-self: center; }
.mapa__aviso p { margin: 0 auto; max-width: 30rem; color: var(--tinta-suave); font-size: .98rem; }
.mapa__aviso .boton { justify-self: center; }

/* ---------------------------------------------------------------- Blog --- */

.articulo { max-width: var(--ancho-texto); }
.articulo__meta {
  font-size: .95rem;
  color: var(--tinta-suave);
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--borde);
  margin-bottom: 1.75rem;
}
.firma {
  background: var(--papel-alt);
  border: 1px solid var(--borde);
  border-radius: var(--radio-grande);
  padding: 1.4rem;
  margin-top: 2.5rem;
}
.firma p { margin-bottom: .5rem; font-size: .98rem; }
.firma p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- Cinta --- */

.cinta {
  background: var(--verde);
  color: #fff;
  border-radius: var(--radio-grande);
  padding: clamp(1.75rem, 4vw, 2.75rem);
  text-align: center;
}
.cinta h2, .cinta p { color: #fff; }
.cinta h2 { margin-top: 0; }
.cinta p { margin-inline: auto; opacity: .92; }
.cinta .acciones { justify-content: center; }
.cinta .boton--primario { background: #fff; color: var(--verde-oscuro); }
.cinta .boton--primario:hover { background: var(--verde-claro); color: var(--verde-oscuro); }
.cinta .boton--whatsapp { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.cinta .boton--whatsapp:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ------------------------------------------------------------------ Pie --- */

.pie {
  background: var(--verde-oscuro);
  color: #D9E8E3;
  padding-block: var(--seccion) 2rem;
  margin-top: var(--seccion);
}
.pie a { color: #fff; }
.pie h2, .pie h3 { color: #fff; font-size: 1.05rem; margin: 0 0 .8rem; }
.pie__grid {
  display: grid;
  gap: 2.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}
.pie ul { list-style: none; margin: 0; padding: 0; }
.pie li { margin-bottom: .5rem; }
.pie address { font-style: normal; line-height: 1.8; }
.pie__legal {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, .16);
  font-size: .88rem;
  opacity: .8;
}
.pie__legal p { max-width: 46rem; }

/* --------------------------------------------------------- Utilidades --- */

.migas {
  font-size: .92rem;
  color: var(--tinta-suave);
  padding-block: 1.1rem;
}
.migas ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; }
.migas li::after { content: "›"; margin-left: .4rem; color: var(--beige); }
.migas li:last-child::after { content: ""; }

.lista-marcada { list-style: none; padding: 0; }
.lista-marcada li {
  position: relative;
  padding-left: 1.9rem;
  margin-bottom: .7rem;
}
.lista-marcada li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--lima);
}

.pasos { counter-reset: paso; list-style: none; padding: 0; }
.pasos li {
  counter-increment: paso;
  position: relative;
  padding-left: 3.2rem;
  margin-bottom: 1.3rem;
  min-height: 2.2rem;
}
.pasos li::before {
  content: counter(paso);
  position: absolute;
  left: 0;
  top: -.15em;
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  background: var(--verde);
  color: #fff;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1rem;
}

.idiomas { display: flex; gap: .4rem; align-items: center; }
.idiomas a {
  padding: .4rem .7rem;
  border-radius: var(--radio-pildora);
  text-decoration: none;
  font-weight: 700;
  font-size: .85rem;
  color: var(--tinta-suave);
  border: 1px solid var(--borde);
}
.idiomas a[aria-current="true"] { background: var(--verde); color: #fff; border-color: var(--verde); }

.visualmente-oculto {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  .cabecera, .nav, .acciones, .cinta { display: none; }
  body { background: #fff; font-size: 11pt; }
}
