/* Tarjeta digital vistosa: cabecera de color con foto, botones de marca y animaciones.
   Los colores del giro vienen del tema (temas/*.css); los de cada red son fijos. */

@font-face {
  font-family: "Atkinson Next";
  src: url("fuentes/atkinson-next-var.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("fuentes/barlow-condensed-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --letra: "Atkinson Next", system-ui, sans-serif;
  --letra-titulo: "Barlow Condensed", "Arial Narrow", sans-serif;
  --radio: 1.125rem;
  --radio-tarjeta: 1.75rem;
  --hueco: clamp(1rem, 4.5vw, 1.5rem);
  --salida: cubic-bezier(0.16, 1, 0.3, 1);
  --rebote: cubic-bezier(0.34, 1.56, 0.64, 1);
  --sombra-color: 15 42 58;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--fondo);
  color: var(--texto);
  font-family: var(--letra);
  font-size: 106.25%;
  line-height: 1.45;
  accent-color: var(--primario);
}

body { margin: 0; min-height: 100svh; padding: clamp(0rem, 4vw, 2.5rem) clamp(0rem, 3vw, 1.5rem); overflow-x: hidden; }

::selection { background: var(--primario); color: #fff; }
a { color: inherit; text-underline-offset: 0.2em; }
:focus-visible { outline: 3px solid var(--hero-3); outline-offset: 3px; border-radius: 6px; }
h1, h2, p, ul, figure { margin: 0; }
.icono { width: 1em; height: 1em; display: block; flex: none; }

/* ---------- Ambiente: luces suaves que se mueven detrás de la tarjeta ---------- */
.ambiente { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.ambiente span {
  position: absolute;
  width: 42vmax;
  height: 42vmax;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.45;
  animation: flotar 22s ease-in-out infinite alternate;
}
.ambiente span:nth-child(1) { background: var(--hero-3); top: -12vmax; left: -10vmax; }
.ambiente span:nth-child(2) { background: var(--hero-1); bottom: -16vmax; right: -12vmax; animation-delay: -7s; }
.ambiente span:nth-child(3) { background: #ffffff; top: 30%; left: 45%; width: 30vmax; height: 30vmax; opacity: 0.6; animation-delay: -14s; }

@keyframes flotar {
  to { transform: translate3d(6vmax, 4vmax, 0) scale(1.12); }
}

/* ---------- La tarjeta ---------- */
.tarjeta {
  position: relative;
  max-width: 30rem;
  margin: 0 auto;
  background: var(--superficie);
  border-radius: var(--radio-tarjeta);
  box-shadow: 0 2px 4px rgb(var(--sombra-color) / 0.06), 0 30px 60px -30px rgb(var(--sombra-color) / 0.45);
  overflow: hidden;
  animation: aparecer 700ms var(--salida) both;
}

@keyframes aparecer {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
}

.aviso { position: relative; z-index: 2; padding: 0.5rem var(--hueco); font-size: 0.8125rem; color: var(--texto-suave); background: var(--suave); }
.aviso--vista { color: #fff; background: var(--cerrado); font-weight: 700; }

/* ---------- Cabecera ---------- */
.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0.35rem;
  padding: 1.5rem var(--hueco) 3.75rem;
  color: #fff;
  background:
    radial-gradient(120% 80% at 100% 0%, rgb(255 255 255 / 0.22), transparent 55%),
    radial-gradient(90% 70% at 0% 100%, color-mix(in srgb, var(--hero-3) 55%, transparent), transparent 60%),
    linear-gradient(155deg, var(--hero-1), var(--hero-2));
}

/* Trama de puntos muy tenue que se desvanece hacia los bordes */
.hero__fondo {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.14;
  background: radial-gradient(circle, #fff 1.2px, transparent 1.6px) 0 0 / 22px 22px;
  -webkit-mask: radial-gradient(circle at 50% 30%, #000 0 40%, transparent 75%);
  mask: radial-gradient(circle at 50% 30%, #000 0 40%, transparent 75%);
}

.hero__marca {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem 0.35rem 0.4rem;
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgb(255 255 255 / 0.14);
  border: 1px solid rgb(255 255 255 / 0.28);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  animation: subir 600ms 150ms var(--salida) both;
}
.hero__emblema {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  font-size: 1.05rem;
  color: var(--hero-1);
  background: #fff;
  border-radius: 50%;
}

.hero__retrato {
  position: relative;
  width: 9.5rem;
  aspect-ratio: 1;
  margin: 1rem 0 0.6rem;
  animation: retrato 800ms 200ms var(--rebote) both;
}
.hero__retrato img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 14px 30px -12px rgb(0 0 0 / 0.5);
}
/* Aro de luz que gira alrededor de la foto */
.hero__aro {
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--hero-3), #fff, transparent 40%, var(--hero-3) 70%, #fff, var(--hero-3));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  animation: girar 9s linear infinite;
}

@keyframes retrato {
  from { opacity: 0; transform: scale(0.6) rotate(-8deg); }
}
@keyframes girar {
  to { transform: rotate(1turn); }
}
@keyframes subir {
  from { opacity: 0; transform: translateY(14px); }
}

.hero__datos { animation: subir 650ms 320ms var(--salida) both; }
.hero__nombre {
  font-family: var(--letra-titulo);
  font-weight: 700;
  font-size: clamp(2.125rem, 9vw, 2.75rem);
  line-height: 1;
  letter-spacing: 0.005em;
  text-wrap: balance;
  text-shadow: 0 2px 12px rgb(0 0 0 / 0.18);
}
.hero__titulo {
  display: inline-block;
  margin-top: 0.55rem;
  padding: 0.25rem 0.85rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--hero-2);
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 6px 16px -8px rgb(0 0 0 / 0.45);
}
.hero__cedula { margin-top: 0.45rem; font-size: 0.8125rem; color: rgb(255 255 255 / 0.85); font-variant-numeric: tabular-nums; }
.hero__lema {
  max-width: 24rem;
  margin-top: 0.5rem;
  font-size: 1.0625rem;
  font-style: italic;
  color: rgb(255 255 255 / 0.95);
  text-wrap: balance;
  animation: subir 650ms 420ms var(--salida) both;
}

.hero__ola { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 3.25rem; }
.hero__ola-atras { fill: var(--superficie); opacity: 0.35; animation: ola 7s ease-in-out infinite alternate; transform-origin: center; }
.hero__ola-frente { fill: var(--superficie); }
@keyframes ola {
  to { transform: translateX(-4%) scaleY(1.15); }
}

/* ---------- Cuerpo ---------- */
.cuerpo { display: grid; gap: 1.25rem; padding: 0.25rem var(--hueco) var(--hueco); }

.divisor {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.25rem 0 0.25rem;
  font-family: var(--letra-titulo);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primario-oscuro);
}
.divisor::before, .divisor::after { content: ""; flex: 1; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--borde)); }
.divisor::after { background: linear-gradient(90deg, var(--borde), transparent); }
.divisor span { white-space: nowrap; }

/* ---------- Botones de marca ---------- */
.botones { display: grid; gap: 0.75rem; }

.boton {
  --b1: var(--primario);
  --b2: var(--primario-oscuro);
  --b-sombra: 8 71 92;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 4.5rem;
  padding: 0.6rem 0.9rem 0.6rem 0.6rem;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, var(--b1), var(--b2));
  border-radius: var(--radio);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.35),
    inset 0 -2px 0 rgb(0 0 0 / 0.12),
    0 12px 22px -14px rgb(var(--b-sombra) / 0.9);
  transition: transform 260ms var(--salida), box-shadow 260ms var(--salida), filter 260ms var(--salida);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  animation: entrar 600ms var(--salida) both;
}
/* Brillo de cristal en la mitad de arriba */
.boton::before {
  content: "";
  position: absolute;
  inset: 0 0 50% 0;
  z-index: -1;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.22), rgb(255 255 255 / 0));
}
/* Destello que recorre el botón */
.boton::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 45%;
  z-index: 1;
  background: linear-gradient(100deg, transparent, rgb(255 255 255 / 0.45), transparent);
  transform: skewX(-18deg);
  opacity: 0;
  pointer-events: none;
}
.boton:active { transform: scale(0.97); filter: brightness(0.95); }

.boton__icono {
  display: grid;
  place-items: center;
  flex: none;
  width: 3.1rem;
  height: 3.1rem;
  font-size: 1.6rem;
  color: var(--b2);
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 4px 10px -4px rgb(0 0 0 / 0.35);
}
.boton__texto {
  display: grid;
  flex: 1;
  min-width: 0;
  padding-left: 0.85rem;
  border-left: 1px solid rgb(255 255 255 / 0.4);
  line-height: 1.15;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.2);
}
.boton__texto strong { font-size: 1.125rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.boton__texto small { margin-top: 0.2rem; font-size: 0.8125rem; opacity: 0.95; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.boton__flecha { font-size: 1.5rem; opacity: 0.9; transition: transform 260ms var(--salida); }

.boton--whatsapp { --b1: #12803f; --b2: #0a5f2f; --b-sombra: 11 110 54; min-height: 5rem; }
.boton--whatsapp .boton__icono { width: 3.4rem; height: 3.4rem; font-size: 1.85rem; }
.boton--whatsapp::after { animation: destello 4.5s 1.6s ease-in-out infinite; }
.boton--llamar { --b1: #087683; --b2: var(--hero-2); }
.boton--mapa { --b1: #2360cf; --b2: #1a46a8; --b-sombra: 26 70 168; }
.boton--facebook { --b1: #1565d8; --b2: #0d4fb8; --b-sombra: 13 82 196; }
.boton--instagram { --b1: #e1306c; --b2: #833ab4; --b-sombra: 131 58 180; background: linear-gradient(120deg, #c42a6a 0%, #b02f86 45%, #8a33b0 75%, #6a3bc0 100%); }
.boton--instagram .boton__icono { color: #c13584; }
.boton--tiktok { --b1: #2a2a2e; --b2: #050507; --b-sombra: 0 0 0; }
.boton--tiktok .boton__icono { color: #050507; }
.boton--correo { --b1: #52667a; --b2: #2d3d4e; --b-sombra: 45 61 78; }

@keyframes destello {
  0% { left: -60%; opacity: 0; }
  12% { opacity: 1; }
  30%, 100% { left: 120%; opacity: 0; }
}
@keyframes entrar {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
}

/* Entrada escalonada de los botones */
.botones > :nth-child(2) { animation-delay: 380ms; }
.botones > :nth-child(3) { animation-delay: 460ms; }
.botones > :nth-child(4) { animation-delay: 540ms; }
.botones > :nth-child(5) { animation-delay: 620ms; }
.botones > :nth-child(6) { animation-delay: 700ms; }
.botones > :nth-child(7) { animation-delay: 780ms; }
.botones > :nth-child(8) { animation-delay: 860ms; }

@media (hover: hover) {
  .boton:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.35), inset 0 -2px 0 rgb(0 0 0 / 0.12), 0 18px 30px -14px rgb(var(--b-sombra) / 1); }
  .boton:hover::after { animation: destello 900ms ease-out; }
  .boton:hover .boton__flecha { transform: translateX(4px); }
  .boton:active { transform: scale(0.97); }
}

/* ---------- Paneles (horario, servicios, QR) ---------- */
.panel {
  padding: 1.1rem;
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: 1.25rem;
  box-shadow: 0 10px 26px -20px rgb(var(--sombra-color) / 0.5);
  animation: subir 700ms 650ms var(--salida) both;
}
.panel__cabeza { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 0.85rem; }
.panel__icono {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.15rem;
  color: #fff;
  background: linear-gradient(135deg, var(--hero-1), var(--hero-2));
  border-radius: 0.75rem;
}
.panel h2 { font-family: var(--letra-titulo); font-weight: 700; font-size: 1.25rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--primario-oscuro); }

/* Horario */
.hoy {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.25rem 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.85rem 0.95rem;
  background: var(--suave);
  border-radius: 0.9rem;
}
.hoy[hidden] { display: none; }
.hoy__etiqueta { grid-column: 1; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--primario); }
.hoy__turnos { grid-column: 1; font-weight: 800; font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.hoy__turnos span { display: block; white-space: nowrap; }
.estado {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.8rem;
  font-weight: 800;
  font-size: 0.875rem;
  color: #fff;
  background: var(--abierto);
  border-radius: 999px;
  box-shadow: 0 8px 18px -10px var(--abierto);
  white-space: nowrap;
}
.estado::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #fff;
  animation: latido 1.6s ease-out infinite;
}
.estado[data-estado="cerrado"] { background: var(--cerrado); box-shadow: 0 8px 18px -10px var(--cerrado); }
.estado[data-estado="cerrado"]::before { animation: none; opacity: 0.8; }
.estado[data-estado] { animation: sello 520ms var(--rebote) both; }

@keyframes latido {
  0% { box-shadow: 0 0 0 0 rgb(255 255 255 / 0.9); }
  100% { box-shadow: 0 0 0 0.6rem rgb(255 255 255 / 0); }
}
@keyframes sello {
  from { opacity: 0; transform: scale(0.6); }
}

.horario__tabla { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.horario__tabla th, .horario__tabla td { padding: 0.5rem 0.25rem; text-align: left; vertical-align: baseline; border-top: 1px solid var(--borde); }
.horario__tabla tr:first-child th, .horario__tabla tr:first-child td { border-top: 0; }
.horario__tabla th { font-weight: 600; width: 42%; }
.horario__tabla td { color: var(--texto-suave); }
.horario__tabla td span { display: block; white-space: nowrap; }
.horario__tabla tr.es-hoy th, .horario__tabla tr.es-hoy td { color: var(--primario); font-weight: 800; }

/* Servicios como etiquetas */
.servicios ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.servicios li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.8rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--primario-oscuro);
  background: var(--suave);
  border: 1px solid var(--borde);
  border-radius: 999px;
}
.servicios li::before { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--hero-1); }

/* QR */
.qr { display: grid; grid-template-columns: 8.75rem 1fr; gap: 1rem; align-items: center; }
.qr__codigo {
  position: relative;
  overflow: hidden;
  padding: 0.55rem;
  background: #fff;
  border-radius: 1rem;
  border: 3px solid transparent;
  background-image: linear-gradient(#fff, #fff), linear-gradient(135deg, var(--hero-3), var(--hero-2));
  background-origin: border-box;
  background-clip: padding-box, border-box;
}
.qr__codigo svg { display: block; width: 100%; height: auto; }
.qr__escaner {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: var(--hero-3);
  box-shadow: 0 0 12px 3px color-mix(in srgb, var(--hero-3) 70%, transparent);
  animation: escanear 2.8s ease-in-out infinite;
}
@keyframes escanear {
  0%, 100% { transform: translateY(0.4rem); opacity: 0; }
  10%, 90% { opacity: 1; }
  50% { transform: translateY(7.8rem); }
}
.qr h2 { font-size: 1.125rem; }
.qr__url { margin-top: 0.35rem; font-size: 0.875rem; color: var(--texto-suave); overflow-wrap: anywhere; }
.qr__descarga { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 800; color: var(--primario); }

.qr__acciones { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.accion {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 3.75rem;
  padding: 0.6rem 0.75rem;
  font: inherit;
  text-align: left;
  text-decoration: none;
  color: var(--texto);
  background: var(--superficie);
  border: 2px solid var(--borde);
  border-radius: 1rem;
  cursor: pointer;
  transition: border-color 220ms var(--salida), transform 220ms var(--salida), background-color 220ms var(--salida);
  -webkit-tap-highlight-color: transparent;
}
.accion:active { transform: scale(0.97); background: var(--suave); }
.accion__icono { font-size: 1.35rem; color: var(--primario); }
.accion__texto { display: grid; line-height: 1.15; min-width: 0; }
.accion__texto strong { font-size: 0.9375rem; }
.accion__texto small { font-size: 0.75rem; color: var(--texto-suave); }
@media (hover: hover) {
  .accion:hover { border-color: var(--primario); transform: translateY(-1px); }
}

/* ---------- Pie ---------- */
.pie {
  padding: 1rem var(--hueco) 1.1rem;
  text-align: center;
  color: #fff;
  background: linear-gradient(155deg, var(--hero-1), var(--hero-2));
}
.pie__negocio { font-weight: 700; font-size: 0.8125rem; letter-spacing: 0.32em; text-transform: uppercase; }
.pie__credito { margin-top: 0.3rem; font-size: 0.75rem; opacity: 0.85; }

/* ---------- Celular: la tarjeta es la pantalla completa ---------- */
@media (max-width: 30rem) {
  body { padding: 0; }
  .tarjeta { border-radius: 0; box-shadow: none; }
}

@media (max-width: 22rem) {
  .qr { grid-template-columns: 1fr; }
  .qr__codigo { max-width: 10rem; }
  .qr__acciones { grid-template-columns: 1fr; }
  .boton__texto small { white-space: normal; }
}

/* ---------- Tableta ---------- */
@media (min-width: 48rem) and (max-width: 63.99rem) {
  .tarjeta { max-width: 36rem; }
}

/* ---------- PC: pantalla completa en dos columnas ---------- */
@media (min-width: 64rem) {
  body { display: grid; align-content: center; padding: 2.5rem 2rem; }
  .tarjeta {
    max-width: 76rem;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(22rem, 0.9fr) 2fr;
    grid-template-rows: auto 1fr auto;
  }
  .aviso { grid-column: 1 / -1; }
  .hero { grid-row: 2 / span 2; align-content: center; padding: 3rem 2.25rem; }
  .hero__ola { display: none; }
  .hero__retrato { width: 13rem; }
  .hero__nombre { font-size: clamp(2.75rem, 3.6vw, 3.5rem); }
  .cuerpo {
    grid-column: 2;
    grid-row: 2;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "botones horario" "qr servicios";
    align-content: start;
    gap: 1.25rem 1.5rem;
    padding: 2rem 2.25rem;
  }
  .botones { grid-area: botones; align-content: start; }
  .horario { grid-area: horario; align-self: start; }
  .servicios { grid-area: servicios; align-self: start; }
  .qr { grid-area: qr; align-self: start; }
  .horario__tabla th { width: 34%; }
  .horario__tabla td span { display: inline; }
  .horario__tabla td span + span::before { content: " · "; }
  .pie { grid-column: 2; grid-row: 3; }
}

@media (min-width: 90rem) {
  html { font-size: 112.5%; }
}

/* ---------- Movimiento reducido: todo quieto y visible ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  .ambiente, .hero__ola { display: none; }
  body { padding: 0; }
  .tarjeta { box-shadow: none; }
}
