/* ============================================================
   components.css — Piezas reutilizables
   Iconos · botones · enlaces · eyebrow · encabezado de sección ·
   tile de icono · estado abierto/cerrado · chips · formularios ·
   pestañas · migas de pan · prosa legal
   ============================================================ */

/* ---------- Iconos (sprite SVG en cada página: <svg class="i"><use href="#i-..."/></svg>) ---------- */
.i {
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.i--fill { fill: currentColor; stroke: none; }

/* ---------- Botones ---------- */
.btn {
  --btn-bg: var(--blue);
  --btn-fg: var(--on-dark);
  --btn-bd: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.005em;
  line-height: 1;
  white-space: nowrap;
  transition:
    background-color var(--t-base) var(--ease),
    border-color var(--t-base) var(--ease),
    color var(--t-base) var(--ease),
    box-shadow var(--t-base) var(--ease),
    transform var(--t-base) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn .i { width: 18px; height: 18px; }
.btn .i--arrow { transition: transform var(--t-base) var(--ease); }
.btn:hover .i--arrow { transform: translateX(3px); }
.btn:active { transform: translateY(0) scale(0.98); }

.btn--primary { box-shadow: 0 1px 2px rgba(8, 75, 120, 0.2), 0 6px 18px rgba(10, 111, 174, 0.22); }
.btn--primary:hover {
  --btn-bg: var(--blue-hover);
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(8, 75, 120, 0.2), 0 12px 28px rgba(10, 111, 174, 0.28);
}
.btn--secondary { --btn-bg: var(--bg); --btn-fg: var(--ink); --btn-bd: var(--line-strong); }
.btn--secondary:hover { --btn-bd: var(--blue); --btn-fg: var(--blue); transform: translateY(-2px); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--blue); padding: 0 6px; min-height: 44px; }
.btn--ghost:hover { --btn-fg: var(--blue-hover); }
.btn--light { --btn-bg: var(--bg); --btn-fg: var(--navy); }
.btn--light:hover { --btn-bg: var(--blue-50); transform: translateY(-2px); }
.btn--outline-light { --btn-bg: transparent; --btn-fg: var(--on-dark); --btn-bd: rgba(255, 255, 255, 0.35); }
.btn--outline-light:hover { --btn-bd: var(--on-dark); --btn-bg: rgba(255, 255, 255, 0.08); transform: translateY(-2px); }
.btn--whatsapp { --btn-bg: var(--whatsapp); }
.btn--whatsapp:hover { --btn-bg: #0B6534; transform: translateY(-2px); }
.btn--sm { min-height: 44px; padding: 0 20px; font-size: 0.9375rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.65; cursor: wait; transform: none; }

/* Botón solo icono (llamar, WhatsApp en barras) */
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--line-strong);
  color: var(--ink);
  background: var(--bg);
  transition: border-color var(--t-base) var(--ease), color var(--t-base) var(--ease), background-color var(--t-base) var(--ease);
}
.icon-btn:hover { border-color: var(--blue); color: var(--blue); }
.icon-btn .i { width: 20px; height: 20px; }

/* ---------- Enlaces con subrayado animado ---------- */
.link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue);
  font-weight: 650;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.5px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  padding-bottom: 2px;
  transition: background-size var(--t-base) var(--ease), color var(--t-base) var(--ease);
}
.link:hover { background-size: 100% 1.5px; color: var(--blue-hover); }
.link .i { width: 18px; height: 18px; transition: transform var(--t-base) var(--ease); }
.link:hover .i--arrow { transform: translateX(3px); }
.link:hover .i--external { transform: translate(2px, -2px); }

/* ---------- Eyebrow (etiqueta sobre titulares) ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-caption);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
}
.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(31, 160, 218, 0.16);
}
.eyebrow--light { color: #8FD3F2; }
.eyebrow--light::before { box-shadow: 0 0 0 4px rgba(31, 160, 218, 0.25); }

/* ---------- Encabezado de sección ---------- */
.sec-head { display: grid; gap: var(--s-4); max-width: 760px; margin-bottom: clamp(40px, 5vw, 64px); }
.sec-head h2 { margin-top: 4px; }
.sec-head p { font-size: var(--fs-lead); }
.sec-head--center { margin-inline: auto; text-align: center; justify-items: center; }
/* Variante en dos columnas: título a la izquierda, texto/acción a la derecha */
.sec-head--split { max-width: none; grid-template-columns: 1fr; align-items: end; }
@media (min-width: 960px) {
  .sec-head--split { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: var(--s-10); }
  .sec-head--split > :last-child { justify-self: end; max-width: 460px; }
}

/* ---------- Tile de icono ---------- */
.icon-tile {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--blue-100);
  color: var(--blue);
  transition: background-color var(--t-base) var(--ease), color var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}
.icon-tile .i { width: 22px; height: 22px; }
.icon-tile--lg { width: 56px; height: 56px; border-radius: 16px; }
.icon-tile--lg .i { width: 26px; height: 26px; }

/* ---------- Estado abierto/cerrado (main.js lo calcula con la hora de RD) ---------- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 4px 12px 4px 10px;
  border-radius: var(--r-full);
  font-size: var(--fs-caption);
  font-weight: 650;
  background: var(--closed-bg);
  color: var(--closed);
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.status.is-open { background: var(--success-bg); color: var(--success); }
.status.is-open::before { animation: status-pulse 2.4s var(--ease-in-out) 3; } /* 3 pulsos y se detiene */
.status[hidden] { display: none; }
@keyframes status-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(18, 128, 92, 0.35); }
  50% { box-shadow: 0 0 0 5px rgba(18, 128, 92, 0); }
}

/* ---------- Chips ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-full);
  background: var(--blue-100);
  color: var(--blue-deep);
  font-size: var(--fs-caption);
  font-weight: 650;
}
.chip .i { width: 15px; height: 15px; }

/* ---------- Lista de horarios ---------- */
.hours { display: grid; gap: 2px; font-size: var(--fs-small); }
.hours > div {
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}
.hours > div:last-child { border-bottom: 0; }
.hours dt { color: var(--ink); font-weight: 600; }
.hours dd { color: var(--text); font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- Formularios ---------- */
.form { display: grid; gap: var(--s-5); }
.form-row { display: grid; gap: var(--s-5); }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 8px; }
.field label { font-size: var(--fs-small); font-weight: 600; color: var(--ink); }
.field .req { color: var(--blue); margin-left: 2px; }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 52px;
  padding: 13px 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 14px;
  background: var(--bg);
  color: var(--ink);
  font-size: 1rem;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235B6B7E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 44px;
}
.field textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
.field input::placeholder, .field textarea::placeholder { color: #8A98A8; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #B9C8D6; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(10, 111, 174, 0.14);
}
.field input[type="file"] { padding: 12px; min-height: 0; cursor: pointer; }
.field input[type="file"]::file-selector-button {
  margin-right: 14px;
  padding: 9px 16px;
  border: 0;
  border-radius: var(--r-full);
  background: var(--blue-100);
  color: var(--blue-deep);
  font-weight: 650;
  cursor: pointer;
}
.field__hint { font-size: var(--fs-caption); color: var(--text-soft); }
.field__error { display: none; font-size: var(--fs-caption); font-weight: 600; color: var(--error); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--error); }
.field.has-error .field__error { display: block; }
.form__note { font-size: var(--fs-caption); color: var(--text-soft); }

.form__success,
.form__send-error {
  display: none;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 14px;
  font-weight: 600;
  font-size: var(--fs-small);
}
.form__success { background: var(--success-bg); color: var(--success); }
.form__send-error { background: var(--error-bg); color: var(--error); }
.form__success.is-visible, .form__send-error.is-visible { display: flex; }
/* Campo trampa anti-spam: invisible para personas */
.form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
/* Indicador de envío elegante (form.js cambia el texto a "Enviando…") */
.form [type="submit"][disabled]::after {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Pestañas (mapa de sucursales) ---------- */
.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border-radius: var(--r-full);
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}
.tab {
  min-height: 42px;
  padding: 0 18px;
  border-radius: var(--r-full);
  font-size: var(--fs-small);
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
  transition: background-color var(--t-base) var(--ease), color var(--t-base) var(--ease);
}
.tab:hover { color: var(--ink); background: var(--surface); }
.tab[aria-selected="true"] { background: var(--navy); color: var(--on-dark); }

/* ---------- Migas de pan ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--fs-caption); font-weight: 600; color: var(--text-soft); }
.crumbs a { transition: color var(--t-fast) var(--ease); }
.crumbs a:hover { color: var(--blue); }
.crumbs .i { width: 14px; height: 14px; opacity: 0.6; }
.crumbs [aria-current] { color: var(--ink); }

/* ---------- Prosa (páginas legales) ---------- */
.prose { max-width: 70ch; color: var(--text); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 {
  font-size: clamp(1.3rem, 1.15rem + 0.6vw, 1.6rem);
  margin-top: 2.4em;
  padding-top: 0.2em;
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.2em; display: grid; gap: 0.5em; }
.prose li::marker { color: var(--brand); }
.prose a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Fila de redes sociales (fondos claros) ---------- */
.social-row { display: flex; flex-wrap: wrap; gap: 10px; }
.social-row .icon-btn .i { width: 18px; height: 18px; }
