/* =========================================================
   Farmacia El Ángel · components.css
   Componentes reutilizables: botones, estados, tarjetas, etiquetas,
   listas, pasos, arco/aureola, CTA, avisos, texto largo, migas.
   ========================================================= */
/* ---------- Componentes ---------- */
/* Íconos: <svg class="ico"><use href="#i-nombre"/></svg> (sprite local, ver assets/img/icons/sprite.svg) */
.ico { display: inline-block; width: 1em; height: 1em; flex: none; vertical-align: -.125em; fill: currentColor; overflow: visible; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Botones: mínimo 48px de alto (objetivo táctil > 44px) */
.btn {
  --btn-bg: var(--c-navy-700); --btn-fg: var(--c-white); --btn-bd: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 48px; padding: .75rem 1.4rem;
  font-family: var(--f-body); font-size: 1rem; font-weight: 700; line-height: 1.2;
  text-decoration: none; text-align: center;
  color: var(--btn-fg); background: var(--btn-bg);
  border: 2px solid var(--btn-bd); border-radius: var(--r-pill);
  transition: transform var(--t-fast) var(--ease), background-color var(--t-fast), box-shadow var(--t-fast);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--sh-2); }
.btn:active { transform: translateY(0); }
.btn .ico { font-size: 1.15em; }
.btn--wa { --btn-bg: var(--c-wa); }
.btn--wa:hover { --btn-bg: var(--c-wa-hover); }
.btn--primary:hover { --btn-bg: var(--c-navy-900); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--c-navy-700); --btn-bd: var(--c-navy-700); }
.btn--ghost:hover { --btn-bg: var(--c-navy-700); --btn-fg: var(--c-white); }
.btn--light { --btn-bg: var(--c-white); --btn-fg: var(--c-navy-700); }
.btn--outline-light { --btn-bg: transparent; --btn-fg: var(--c-white); --btn-bd: rgb(255 255 255 / .55); }
.btn--outline-light:hover { --btn-bg: var(--c-white); --btn-fg: var(--c-navy-900); }
.btn--sm { min-height: 44px; padding: .55rem 1rem; font-size: var(--fs-sm); }
.btn--block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

/* Enlace con flecha */
.link-arrow {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 44px;
  font-weight: 700; color: var(--c-navy-700); text-decoration: none;
}
.link-arrow::after { content: "→"; transition: transform var(--t-fast) var(--ease); }
.link-arrow:hover::after { transform: translateX(4px); }
.link-arrow:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Indicador de estado (abierto/cerrado) */
.status {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 700; font-size: var(--fs-sm);
}
.status__dot {
  width: .6rem; height: .6rem; flex: none; border-radius: 50%;
  background: var(--c-ink-soft); position: relative;
}
.status[data-state="open"] .status__dot { background: var(--c-open); }
.status[data-state="closed"] .status__dot { background: var(--c-closed); }
.status[data-state="open"] .status__dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: inherit; animation: pulse 2.2s var(--ease) infinite;
}
/* Variante en píldora blanca (encabezados de página) */
.status--pill { color: var(--c-ink); justify-self: start; align-self: center; padding: .6rem 1rem; border-radius: var(--r-pill); background: var(--c-white); box-shadow: var(--sh-1); }

/* Tarjeta base */
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--c-white); border: 1px solid var(--c-line);
  border-radius: var(--r-lg); box-shadow: var(--sh-2);
  overflow: hidden;
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--sh-3); }
.card__media { aspect-ratio: 16 / 10; background: var(--c-aqua-100); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease); }
.card:hover .card__media img { transform: scale(1.04); }
.card__body { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-5); flex: 1; }
.card__body > .btn, .card__body > .link-arrow { margin-top: auto; align-self: flex-start; }
.card__body p { color: var(--c-ink-soft); }
.card h3 { font-size: var(--fs-h4); }

/* Etiqueta pequeña */
.tag {
  display: inline-flex; align-self: flex-start; align-items: center; gap: .35rem;
  padding: .2rem .65rem; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .02em;
  color: var(--c-aqua-600); background: var(--c-aqua-100);
}
.tag--gold { color: var(--c-halo-ink); background: var(--c-halo-100); }

/* Ícono en círculo */
.icon-badge {
  display: grid; place-items: center; flex: none;
  width: 3rem; height: 3rem; border-radius: 50%;
  font-size: 1.2rem; color: var(--c-navy-900); background: var(--c-aqua-400);
}
.icon-badge--lg { width: 3.75rem; height: 3.75rem; font-size: 1.5rem; }
.on-dark .icon-badge { color: var(--c-navy-900); background: var(--c-aqua-400); }

/* Fila de dato con ícono (dirección, horario, teléfono) */
.info-row { display: flex; gap: var(--sp-3); align-items: flex-start; }
.info-row .ico { width: 1.25rem; margin-top: .25rem; color: var(--c-aqua-600); text-align: center; flex: none; }

/* Lista con palomitas */
.list-check { display: grid; gap: var(--sp-3); padding: 0; list-style: none; }
.list-check li { display: flex; gap: .7rem; align-items: flex-start; }
.list-check li::before {
  content: ""; flex: none; width: 1.35rem; height: 1.35rem; margin-top: .15rem; border-radius: 50%;
  background: var(--c-aqua-100) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23224c63' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 70% no-repeat;
}

/* Pasos numerados */
.steps { display: grid; gap: var(--sp-5); counter-reset: paso; padding: 0; list-style: none; }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { position: relative; padding: var(--sp-5); padding-top: calc(var(--sp-7) + .9rem); box-shadow: var(--sh-1); background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--r-md); }
.step::before {
  counter-increment: paso; content: counter(paso);
  position: absolute; top: var(--sp-4); left: var(--sp-5);
  display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  font-family: var(--f-display); font-size: 1.2rem; font-weight: 900; line-height: 1;
  color: var(--c-navy-900); background: var(--c-aqua-400);
}
.step h3 { font-size: var(--fs-h4); margin-bottom: var(--sp-2); }
.step p { color: var(--c-ink-soft); }

/* Marco en arco (motivo de marca: ventana / nicho con aureola) */
.arch {
  position: relative; border-radius: var(--r-arch); overflow: hidden;
  background: var(--c-aqua-100);
}
.arch img { width: 100%; height: 100%; object-fit: cover; }
.halo {
  position: absolute; left: 50%; translate: -50% 0; pointer-events: none;
  width: 46%; aspect-ratio: 4 / 1; border: 3px solid var(--c-aqua-400); border-radius: 50%;
}

/* Bloque CTA final reutilizable */
.cta-band {
  display: grid; gap: var(--sp-5); align-items: center;
  padding: clamp(1.5rem, 1rem + 3vw, 3rem);
  border-radius: var(--r-lg); color: var(--c-on-dark);
  background: linear-gradient(120deg, var(--c-navy-700), var(--c-navy-900));
  position: relative; overflow: hidden; box-shadow: var(--sh-3);
}
.cta-band h2 { color: var(--c-white); font-size: var(--fs-h3); }
.cta-band::before {
  content: ""; position: absolute; right: -4rem; bottom: -3rem; width: 16rem; aspect-ratio: 2.4 / 1;
  border: 2px solid var(--c-aqua-400); border-radius: 50%; opacity: .5; pointer-events: none;
}
@media (min-width: 768px) { .cta-band { grid-template-columns: 1fr auto; } }

/* Aviso */
.note {
  display: flex; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-md); background: var(--c-halo-100); color: var(--c-ink);
  border-left: 4px solid var(--c-halo);
}
.note .ico { color: var(--c-halo-ink); margin-top: .25rem; }

/* Texto largo (legales y políticas) */
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: var(--sp-4); }
.prose h2 { font-size: var(--fs-h3); margin-top: var(--sp-7); }
.prose ul { padding-left: 1.25rem; display: grid; gap: var(--sp-2); }
.prose li::marker { color: var(--c-aqua-600); }


/* ---------- Bot de ayuda (Dr. Ángel) ---------- */
.bot {
  position: fixed; z-index: 70; right: max(.75rem, env(safe-area-inset-right));
  bottom: calc(var(--mobile-bar-h) + .75rem + env(safe-area-inset-bottom));
  width: min(380px, calc(100vw - 1.5rem)); height: min(560px, calc(100dvh - var(--mobile-bar-h) - 6rem));
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--r-lg); background: var(--c-white); box-shadow: var(--sh-3), 0 0 0 1px var(--c-line);
}
.bot[hidden] { display: none; }
@media (min-width: 768px) { .bot { right: 1.5rem; bottom: 1.5rem; height: min(600px, calc(100dvh - 3rem)); } }
.bot__head { display: flex; align-items: center; gap: var(--sp-3); padding: .75rem .75rem .75rem 1rem; color: var(--c-white); background: linear-gradient(120deg, var(--c-navy-700), var(--c-navy-900)); }
.bot__head img { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--c-aqua-400); object-fit: cover; object-position: 50% 15%; background: var(--c-aqua-200); }
.bot__head > div { flex: 1; min-width: 0; }
.bot__title { font-family: var(--f-display); font-weight: 900; font-size: 1.1rem; line-height: 1.1; }
.bot__sub { font-size: var(--fs-xs); color: var(--c-on-dark); }
.bot__close { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgb(255 255 255 / .1); color: var(--c-white); font-size: 1.2rem; }
.bot__close:hover { background: rgb(255 255 255 / .2); }
.bot__log { flex: 1; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: .6rem; padding: 1rem; background: var(--c-aqua-50); }
.bot__msg { max-width: 88%; padding: .65rem .85rem; border-radius: 16px; font-size: .975rem; line-height: 1.45; }
.bot__msg--bot { align-self: flex-start; background: var(--c-white); border: 1px solid var(--c-line); border-bottom-left-radius: 4px; }
.bot__msg--user { align-self: flex-end; color: var(--c-white); background: var(--c-navy-700); border-bottom-right-radius: 4px; }
.bot__msg p + p, .bot__msg p + ul, .bot__msg ul + p { margin-top: .4rem; }
.bot__msg ul { margin: 0; padding-left: 1.1rem; }
.bot__msg a:not(.btn) { color: var(--c-navy-700); font-weight: 700; }
.bot__msg .btn { margin-top: .5rem; }
.bot__msg .btn-row { margin-top: .5rem; gap: .4rem; }
.bot__msg .btn-row .btn { margin-top: 0; }
.bot__typing { display: inline-flex; gap: 4px; padding: .8rem .9rem; }
.bot__typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--c-aqua-600); }
.bot__chips { display: flex; gap: .4rem; padding: .6rem .75rem; overflow-x: auto; border-top: 1px solid var(--c-line); scrollbar-width: none; }
.bot__chips button {
  flex: none; min-height: 40px; padding: .4rem .85rem; border-radius: var(--r-pill);
  border: 1px solid var(--c-aqua-300); background: var(--c-white); color: var(--c-navy-700);
  font-size: var(--fs-sm); font-weight: 700; white-space: nowrap;
}
.bot__chips button:hover { background: var(--c-aqua-100); border-color: var(--c-aqua-600); }
/* Touch: fila deslizable con degradado a la derecha que indica "hay más" */
.bot__chips { padding-right: 2rem; -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); }
/* Mouse/trackpad: no se puede deslizar con el dedo → se muestran todos en varias filas */
@media (hover: hover) and (pointer: fine) {
  .bot__chips { flex-wrap: wrap; overflow: visible; padding-right: .75rem; -webkit-mask-image: none; mask-image: none; }
  .bot__chips button { min-height: 34px; padding: .3rem .75rem; font-size: var(--fs-xs); transition: background-color var(--t-fast), border-color var(--t-fast), transform var(--t-fast) var(--ease); }
  .bot__chips button:hover { transform: translateY(-1px); }
}
.bot__form { display: flex; gap: .5rem; padding: .25rem .75rem .5rem; }
.bot__form input {
  flex: 1; min-width: 0; min-height: 46px; padding: 0 1rem; border-radius: var(--r-pill);
  border: 1px solid var(--c-line); background: var(--c-paper); font: inherit; font-size: 1rem; color: var(--c-ink);
}
.bot__form input:focus-visible { outline: 3px solid var(--c-aqua-600); outline-offset: 1px; }
.bot__form button { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border: 0; border-radius: 50%; background: var(--c-navy-700); color: var(--c-white); }
.bot__legal { padding: 0 1rem .6rem; font-size: .75rem; color: var(--c-ink-soft); text-align: center; }
