/* ───────── Tokens ───────── */
:root {
  --bosque: #0A5128;      /* verde oscuro del logo */
  --bosque-2: #083F1F;
  --menta: #5FCC9C;       /* verde menta del logo */
  --menta-soft: #D7F3E5;
  --escarcha: #EEF8F2;    /* fondo suave */
  --tinta: #10251A;       /* texto */
  --tinta-2: #4A6153;
  --sol: #FFC53D;         /* estrellas */
  --blanco: #FFFFFF;

  --f-display: "Bricolage Grotesque", system-ui, sans-serif;
  --f-body: "Figtree", system-ui, sans-serif;
  --f-brand: "Nunito", system-ui, sans-serif;

  --radius: 22px;
  --wrap: 1180px;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--blanco);
  color: var(--tinta);
  font: 400 1.0625rem/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--f-display); letter-spacing: -.02em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

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

.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--bosque); color: var(--blanco); padding: 10px 16px; border-radius: 999px;
  text-decoration: none; transition: top .2s;
}
.skip:focus { top: 12px; }

/* Eyebrow: el "F A R M A C I A" espaciado del logo */
.eyebrow {
  font: 500 .78rem/1 var(--f-body);
  letter-spacing: .38em;
  text-transform: uppercase;
  color: var(--tinta-2);
  margin-bottom: 18px;
}
.eyebrow--light { color: var(--menta); }

.section-title {
  font-size: clamp(2rem, 4.2vw, 3.3rem);
  line-height: 1.02;
  font-weight: 750;
  color: var(--bosque);
  font-variation-settings: "opsz" 96;
}

/* ───────── Botones ───────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 15px 26px;
  border-radius: 999px;
  background: var(--bosque);
  color: var(--blanco);
  font: 600 1rem/1 var(--f-body);
  text-decoration: none;
  border: 2px solid var(--bosque);
  transition: transform .35s var(--ease-spring), background-color .2s, color .2s, box-shadow .3s;
}
.btn:hover { transform: translateY(-3px) rotate(-1.5deg); box-shadow: 0 10px 24px -10px rgba(10, 81, 40, .55); }
.btn:active { transform: translateY(0) scale(.97); }
.btn--small { padding: 10px 18px; font-size: .95rem; }
.btn--ghost { background: transparent; color: var(--bosque); }
.btn--ghost:hover { background: var(--menta-soft); }
.btn--light { background: var(--menta); border-color: var(--menta); color: var(--bosque-2); }
.btn--outline-light { background: transparent; border-color: rgba(255,255,255,.5); color: var(--blanco); }
.btn--outline-light:hover { border-color: var(--blanco); }

.link {
  color: var(--bosque); font-weight: 600; text-decoration: none;
  background: linear-gradient(var(--menta), var(--menta)) 0 100% / 100% 2px no-repeat;
  padding-bottom: 2px; transition: background-size .3s var(--ease-out);
}
.link:hover { background-size: 100% 100%; }

/* ───────── Cabecera ───────── */
.top {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.top.is-scrolled { border-bottom-color: #E2EFE7; }
.top__inner { display: flex; align-items: center; gap: 24px; height: 76px; }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--bosque); }
.brand__mark { width: 44px; height: 44px; animation: sprout 1.1s var(--ease-spring) both; }
.brand:hover .brand__mark { animation: wiggle .7s var(--ease-out); }
.brand__word { display: flex; flex-direction: column; line-height: 1; }
.brand__pre { font: 300 .62rem/1 var(--f-brand); letter-spacing: .52em; text-transform: uppercase; color: var(--tinta); margin-bottom: 4px; }
.brand__name { font: 800 1.45rem/1 var(--f-brand); letter-spacing: .01em; text-transform: uppercase; }
.brand--light { color: var(--blanco); }
.brand--light .brand__pre { color: var(--menta-soft); }

.nav { display: flex; gap: 6px; margin-left: auto; }
.nav a {
  text-decoration: none; font-weight: 500; padding: 8px 14px; border-radius: 999px;
  transition: background-color .2s, color .2s;
}
.nav a:hover { background: var(--escarcha); color: var(--bosque); }

@keyframes sprout {
  from { transform: scale(.2) rotate(-90deg); opacity: 0; }
  to   { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-14deg); }
  60% { transform: rotate(10deg); }
}

/* ───────── Hero ───────── */
.hero { padding: clamp(40px, 7vw, 96px) 0 clamp(56px, 8vw, 110px); position: relative; }
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 5vw, 72px); align-items: center; }

/* Logotipo del hero: "FARMACIA" fino y espaciado sobre "CASTILLO", como en el logo */
.wordmark {
  --wm: clamp(3.4rem, 9.4vw, 7.2rem);
  display: inline-flex; flex-direction: column; align-items: flex-start;
  margin: 0 0 30px; font-family: var(--f-brand); letter-spacing: 0;
}
.wordmark__pre {
  font-weight: 300; font-size: calc(var(--wm) * .3); line-height: 1;
  letter-spacing: .78em; margin-right: -.78em; /* compensa el espacio tras la última letra */
  text-transform: uppercase; color: #2A2F2C;
  margin-bottom: calc(var(--wm) * .12); padding-left: .04em;
}
.wordmark__name {
  font-weight: 800; font-size: var(--wm); line-height: .9;
  letter-spacing: .005em; text-transform: uppercase; color: var(--bosque);
}
.hero__lede { font-size: clamp(1.1rem, 1.6vw, 1.3rem); max-width: 34ch; color: var(--tinta-2); margin-bottom: 26px; }

.status {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 16px 9px 12px; border-radius: 999px;
  background: var(--escarcha); color: var(--bosque);
  font-weight: 600; margin-bottom: 30px;
}
.status__dot { width: 10px; height: 10px; border-radius: 50%; background: #9AA9A0; position: relative; }
.status.is-open .status__dot { background: #1FBF6A; }
.status.is-open .status__dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: #1FBF6A; animation: ping 1.8s var(--ease-out) infinite;
}
.status.is-closed { background: #F3F4F3; color: var(--tinta-2); }
@keyframes ping { from { transform: scale(1); opacity: .7; } to { transform: scale(3.2); opacity: 0; } }

.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; }

/* Degradado difuminado + trama de puntos */
.hero { overflow: clip; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background-image: radial-gradient(rgba(16, 37, 26, .13) 1px, transparent 1.4px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent);
          mask-image: linear-gradient(180deg, #000 60%, transparent);
}
.aura { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.aura__blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: drift 18s ease-in-out infinite alternate; }
.aura__blob--a { width: 46vw; height: 46vw; max-width: 620px; max-height: 620px; left: -14vw; top: -10vw; background: var(--menta); }
.aura__blob--b { width: 34vw; height: 34vw; max-width: 480px; max-height: 480px; right: -6vw; top: -8vw; background: #8FDCCB; animation-duration: 22s; }
.aura__blob--c { width: 40vw; height: 40vw; max-width: 540px; max-height: 540px; right: -10vw; bottom: -18vw; background: #FFD98A; opacity: .5; animation-duration: 26s; }
.aura--soft .aura__blob { opacity: .32; }
.aura--soft .aura__blob--b { top: 10%; left: -12vw; right: auto; }
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(4vw, 3vw) scale(1.12); }
}

.grad {
  background: linear-gradient(95deg, var(--bosque) 0%, #179656 52%, #2DB57A 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  padding-right: .06em;
}

/* Escenario del hero: emblema + pila de bocadillos */
.stage { position: relative; min-height: 470px; width: min(100%, 470px); justify-self: center; }
.stage__emblem {
  position: absolute; right: 2%; top: -24px; z-index: 4;
  width: 190px; height: 190px;
  animation: emblem-in 1.5s .2s var(--ease-out) both;
}
.stage__emblem img {
  width: 100%; height: 100%;
  filter: drop-shadow(0 14px 22px rgba(10, 81, 40, .2));
  animation: heartbeat 5s 1.8s ease-in-out infinite;
}
/* Entrada: giro de un cuarto de vuelta (la forma encaja consigo misma) y pulso */
@keyframes emblem-in {
  0%   { transform: rotate(-90deg) scale(.55); opacity: 0; }
  55%  { transform: rotate(6deg) scale(1.08); opacity: 1; }
  75%  { transform: rotate(-2deg) scale(.97); }
  100% { transform: rotate(0) scale(1); opacity: 1; }
}
/* Latido suave: dos pulsos cortos y una pausa larga */
@keyframes heartbeat {
  0%, 30%, 100% { transform: scale(1); }
  8%  { transform: scale(1.06); }
  15% { transform: scale(1); }
  22% { transform: scale(1.035); }
}
.stage__stack { position: absolute; left: 0; right: 12%; top: 190px; }
.stage__stack > li {
  position: absolute; left: 0; right: 0; top: 0;
  transition: transform .9s var(--ease-spring), opacity .6s var(--ease-out);
  transform-origin: 20% 100%;
}
.stage__stack > li[data-pos="0"] { z-index: 3; transform: translate(0, 0) rotate(-3deg); }
.stage__stack > li[data-pos="1"] { z-index: 2; transform: translate(22px, -22px) rotate(3deg) scale(.95); }
.stage__stack > li[data-pos="2"] { z-index: 1; transform: translate(42px, -42px) rotate(-3deg) scale(.9); opacity: .8; }
.stage__stack > li[data-pos="out"] { z-index: 4; transform: translate(-60px, 60px) rotate(-12deg) scale(.92); opacity: 0; }
.stage__stack > li[data-pos="in"] { z-index: 0; transform: translate(60px, -60px) rotate(-6deg) scale(.85); opacity: 0; transition: none; }
.stage__stack > li:not([data-pos="0"]) .who { visibility: hidden; }
/* Los bocadillos de detrás muestran líneas en lugar de texto */
.stage__stack .bubble__text { transition: color .4s; }
.stage__stack > li:not([data-pos="0"]) .bubble__text {
  color: transparent;
  background: repeating-linear-gradient(180deg, #E4ECE7 0 .62em, transparent .62em 1.38em);
  border-radius: 6px;
}


/* ───────── Servicios ───────── */
.services { background: var(--escarcha); padding: clamp(64px, 9vw, 120px) 0; border-radius: 40px 40px 0 0; }
.section-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 60px); }

.svc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.svc__item {
  display: flex; flex-direction: column; gap: 20px; align-items: flex-start;
  background: var(--blanco); border-radius: var(--radius); padding: 28px;
  transition: transform .4s var(--ease-spring), box-shadow .3s;
}
.svc__item:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -24px rgba(10, 81, 40, .4); }
.svc__item h3 { font-size: 1.45rem; font-weight: 700; color: var(--bosque); margin-bottom: 6px; }
.svc__item p { color: var(--tinta-2); }
.svc__icon {
  flex: none; width: 58px; height: 58px; border-radius: 18px;
  display: grid; place-items: center;
  background: var(--menta-soft); color: var(--bosque);
  transition: transform .5s var(--ease-spring), background-color .3s;
}
.svc__icon svg { width: 32px; height: 32px; }
.svc__item:hover .svc__icon { transform: rotate(-10deg) scale(1.08); background: var(--menta); }

.tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.tags li {
  font-size: .92rem; font-weight: 500; color: var(--bosque);
  border: 1.5px solid rgba(10, 81, 40, .22); border-radius: 999px; padding: 7px 14px;
}

/* ───────── Opiniones ───────── */
.reviews { padding: clamp(72px, 10vw, 130px) 0; position: relative; overflow: clip; isolation: isolate; }
.reviews .section-head { margin-bottom: clamp(20px, 3vw, 32px); }
.reviews__more { margin-top: 8px; }

/* Bocadillo: compartido por el hero y el carrusel */
.bubble {
  position: relative; margin: 0;
  background: var(--blanco);
  border-radius: 24px;
  padding: 22px 24px;
  box-shadow: 0 1px 2px rgba(16, 37, 26, .06), 0 22px 44px -22px rgba(16, 37, 26, .32);
}
.bubble::after {
  content: ""; position: absolute; left: 30px; bottom: -9px;
  width: 22px; height: 22px; background: var(--blanco);
  border-radius: 0 0 6px 0; transform: rotate(45deg);
  box-shadow: 6px 6px 12px -8px rgba(16, 37, 26, .25);
}
.bubble__text {
  font: 600 1.12rem/1.38 var(--f-display); letter-spacing: -.01em; color: var(--tinta);
  font-variation-settings: "opsz" 24; position: relative; z-index: 1;
}
.who { display: flex; align-items: center; gap: 10px; margin: 16px 0 0 18px; }
.who__avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--bosque); color: var(--blanco); font: 700 .9rem/1 var(--f-body);
}
.who__name { font-weight: 700; font-size: .92rem; line-height: 1.2; }
.who__stars { display: block; color: #E9A800; font-size: .78rem; letter-spacing: .08em; }

/* Carrusel en dos filas, sentidos opuestos */
.marquee {
  display: grid; gap: 22px; padding: 24px 0 36px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.marquee__row { display: flex; align-items: flex-start; width: max-content; animation: marquee 90s linear infinite; }
.marquee__row--rev { animation-direction: reverse; animation-duration: 110s; }
.marquee:hover .marquee__row,
.marquee:focus-within .marquee__row { animation-play-state: paused; }
.marquee__row > li { padding: 14px 26px 6px 0; width: clamp(270px, 28vw, 360px); flex: none; }
.marquee__row > li.is-long { width: clamp(300px, 34vw, 440px); }
.marquee__row > li.is-short { width: auto; min-width: 200px; }
.marquee .bubble { animation: bob 6s ease-in-out infinite; animation-delay: var(--d, 0s); transform: rotate(var(--r, 0deg)); }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50% { transform: translateY(-9px) rotate(calc(var(--r, 0deg) * -1)); }
}


/* ───────── Visita ───────── */
.visit {
  background: var(--bosque); color: var(--blanco);
  padding: clamp(72px, 10vw, 120px) 0;
  border-radius: 40px 40px 0 0;
}
.visit .section-title { color: var(--blanco); margin-bottom: 28px; }
.visit__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 80px); }

.hours { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.hours th, .hours td { padding: 13px 10px; text-align: left; border-bottom: 1px solid rgba(255,255,255,.14); font-weight: 400; }
.hours th { font-weight: 600; padding-left: 14px; }
.hours tr.is-today { background: rgba(95, 204, 156, .18); }
.hours tr.is-today th::after {
  content: "Hoy"; margin-left: 10px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  background: var(--menta); color: var(--bosque-2); padding: 3px 8px; border-radius: 999px; vertical-align: 2px;
}
.hours__note { margin-top: 18px; font-size: .92rem; color: var(--menta-soft); opacity: .85; }

.place__addr { font-style: normal; font-size: clamp(1.4rem, 2.4vw, 1.8rem); line-height: 1.3; font-family: var(--f-display); margin-bottom: 22px; }
.place__links { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }

.map {
  border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3;
  background: var(--bosque-2); border: 1px solid rgba(255,255,255,.12);
}
.map iframe { width: 100%; height: 100%; border: 0; display: block; }
.map__load {
  width: 100%; height: 100%; border: 0; cursor: pointer;
  background:
    radial-gradient(circle at 50% 45%, rgba(95,204,156,.18), transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 38px, rgba(255,255,255,.05) 38px 39px),
    repeating-linear-gradient(90deg, transparent 0 38px, rgba(255,255,255,.05) 38px 39px);
  color: var(--blanco); font: 600 1.05rem/1.3 var(--f-body);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
}
.map__load img { transition: transform .5s var(--ease-spring); }
.map__load:hover img { transform: translateY(-6px) rotate(45deg); }
.map__load small { font-weight: 400; font-size: .82rem; opacity: .7; }

/* ───────── Pie ───────── */
.foot { background: var(--bosque-2); color: var(--menta-soft); padding: 40px 0 48px; }
.foot__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; }
.foot__info { font-size: .92rem; }
.foot__info a { color: var(--blanco); }
.foot .brand { margin-right: auto; }
.foot .brand__mark { animation: none; }

/* ───────── Revelado al hacer scroll ───────── */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease-out), transform .8s var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }
.hero .reveal:nth-child(2) { transition-delay: .08s; }
.hero .reveal:nth-child(3) { transition-delay: .16s; }
.hero .reveal:nth-child(4) { transition-delay: .24s; }
.hero .reveal:nth-child(5) { transition-delay: .32s; }
.svc .reveal:nth-child(2) { transition-delay: .08s; }
.svc .reveal:nth-child(3) { transition-delay: .16s; }

/* ───────── Responsive ───────── */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .stage { min-height: 420px; }
  .svc { grid-template-columns: 1fr; }
  .visit__grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav { display: none; }
  .btn--small { margin-left: auto; }
  .top__inner { height: 66px; }
  .brand__name { font-size: 1.25rem; }
  .svc__item { padding: 22px; }
  .hero__ctas .btn { flex: 1 1 auto; justify-content: center; }
  .services, .visit { border-radius: 28px 28px 0 0; }
  .hero { padding-top: 24px; }
  .stage { min-height: 380px; }
  .stage__emblem { width: 120px; height: 120px; right: 0; top: -10px; }
  .stage__stack { top: 130px; right: 8%; }
  .bubble__text { font-size: 1.02rem; }
  .eyebrow { letter-spacing: .26em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .marquee { -webkit-mask-image: none; mask-image: none; overflow-x: auto; padding-inline: 16px; }
  .marquee__row > li[aria-hidden="true"] { display: none; }
}

/* Símbolo sobre fondos oscuros: insignia blanca para que se lean las hojas */
.brand--light .brand__mark,
.map__load img { background: var(--blanco); border-radius: 50%; padding: 5px; }
.map__load img { padding: 8px; width: 64px; height: 64px; }

