/* Tarjeta digital pública — los colores vienen de variables CSS inyectadas
   por PHP según la plantilla de la industria (ver tarjeta.php). */

body.tf-fondo-tarjeta{
  background:#EDE7DC; display:flex; justify-content:center; padding:16px 12px;
  font-family:var(--fuente-base);
}

.tf-telefono{
  width:100%; max-width:392px; border-radius:42px; padding:9px; background:#16181C;
  box-shadow:0 34px 64px -22px rgba(22,24,28,.45);
}
.tf-tarjeta{
  border-radius:34px; overflow:hidden; background:var(--fondo); color:var(--tinta);
  animation:tf-pop .4s ease both;
  transform-origin: center center;
  will-change: transform;
}
@keyframes tf-pop{ from{ opacity:0; transform:translateY(14px) scale(.985);} to{ opacity:1; transform:none;} }
@keyframes tf-pulso{ 0%{ box-shadow:0 0 0 0 rgba(214,74,34,.35);} 70%{ box-shadow:0 0 0 14px rgba(214,74,34,0);} 100%{ box-shadow:0 0 0 0 rgba(214,74,34,0);} }

.tf-tarjeta__barra{ display:none; }
/* ── HEADER ── overflow:visible permite que el avatar se solape */
.tf-tarjeta__header{
  height:84px; background:var(--cabecera); position:relative;
  display:flex; align-items:flex-start; justify-content:flex-start;
  padding:9px; overflow:hidden;
}
/* El patrón decorativo se sigue recortando solo él */
.tf-tarjeta__patron{
  position:absolute; inset:0; display:flex; flex-wrap:wrap; gap:14px; padding:10px;
  opacity:.12; overflow:hidden; border-radius:inherit; pointer-events:none;
}
.tf-tarjeta__patron .material-symbols-rounded{ font-size:28px; color:var(--tinta); }
.tf-tarjeta__tema{
  position:relative; display:inline-flex; align-items:center; gap:8px;
  background:rgba(0,0,0,.42); backdrop-filter:blur(4px);
  border-radius:999px; padding:6px 12px; align-self:flex-start;
}
.tf-tarjeta__tema .material-symbols-rounded{ font-size:15px; color:#fff; }
.tf-tarjeta__tema span.nombre{ font-size:11px; font-weight:600; letter-spacing:.04em; color:#fff; }

/* Contador de visitas — lado izquierdo, parte inferior del header */
.tf-tarjeta__vistas-badge {
  position: absolute; bottom: 9px; left: 12px;
  display: inline-flex; align-items: center; gap: 3px;
  background: rgba(0,0,0,.32); backdrop-filter: blur(4px);
  color: rgba(255,255,255,.82); font-size: 9.5px;
  font-family: var(--fuente-mono); letter-spacing: .04em;
  padding: 3px 8px; border-radius: 999px;
  white-space: nowrap; user-select: none; pointer-events: none;
}
.tf-tarjeta__vistas-badge .material-symbols-rounded { font-size: 11px; }

/* Logo empresa — caja fija de 55%×70px en top-right del header */
.tf-tarjeta__header-logo {
  position: absolute; top: 7px; right: 8px;
  width: auto; max-width: 54%; height: 66px;
  object-fit: contain; border-radius: 8px;
  background: rgba(255,255,255,.14);
  backdrop-filter: blur(6px);
  padding: 4px 10px; box-sizing: border-box;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,.3));
  animation: tf-slide-up .4s .3s ease both;
}

/* ── CUERPO ── */
.tf-tarjeta__cuerpo{ padding:0 14px 16px; display:flex; flex-direction:column; gap:8px; }

/* Identidad con avatar solapado en el borde del header */
.tf-tarjeta__identidad{
  display:flex; flex-direction:column; gap:4px; align-items:center; text-align:center;
  padding-top:4px; margin-top:-36px; position:relative; z-index:2;
}
.tf-tarjeta__identidad-texto { display:flex; flex-direction:column; align-items:center; gap:2px; }
.tf-tarjeta__avatar{
  width:72px; height:72px; border-radius:999px; background:var(--acento); display:flex;
  align-items:center; justify-content:center; flex:none; overflow:hidden;
  box-shadow: 0 0 0 3px var(--fondo-solid, var(--fondo)), 0 0 0 5px var(--acento),
              0 6px 20px rgba(0,0,0,.22);
  animation: tf-avatar-in .5s .2s cubic-bezier(.34,1.4,.64,1) both;
}
@keyframes tf-avatar-in {
  from { transform: scale(.5) translateY(16px); opacity:0; }
  to   { transform: none; opacity:1; }
}
.tf-tarjeta__avatar .material-symbols-rounded{ font-size:34px; color:var(--ink-acento); }
.tf-tarjeta__avatar-img{
  width:100%; height:100%; object-fit:cover; display:block;
}
.tf-tarjeta__persona{
  font-family:var(--fuente-titulo); font-size:22px; line-height:1.08;
  animation: tf-slide-up .4s .35s ease both;
}
.tf-tarjeta__cargo{
  font-size:12px; opacity:.7;
  animation: tf-slide-up .4s .45s ease both;
}
.tf-tarjeta__negocio{
  font-family:var(--fuente-mono); font-size:10px; letter-spacing:.12em;
  text-transform:uppercase; color:var(--tinta); font-weight:700;
  background: color-mix(in srgb, var(--tinta) 10%, transparent);
  padding: 2px 9px; border-radius: 999px; align-self: center;
  animation: tf-slide-up .4s .55s ease both;
}
@keyframes tf-slide-up {
  from { opacity:0; transform:translateY(10px); }
  to   { opacity:1; transform:none; }
}
.tf-tarjeta__video-wrap{
  position:relative; width:100%; aspect-ratio:16/9; border-radius:14px; overflow:hidden;
  background:#000; cursor:pointer;
}
.tf-tarjeta__video-wrap iframe{
  position:absolute; inset:0; width:100%; height:100%; border:none;
}
.tf-video-thumb {
  position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block;
}
.tf-video-play {
  position:absolute; inset:0; width:100%; height:100%;
  display:flex; align-items:center; justify-content:center;
  background:rgba(0,0,0,.28); border:none; cursor:pointer;
  transition:background .2s;
}
.tf-video-play:hover { background:rgba(0,0,0,.44); }
.tf-video-play .material-symbols-rounded {
  font-size:64px; color:#fff;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.55));
  transition:transform .2s cubic-bezier(.34,1.4,.64,1);
}
.tf-video-play:hover .material-symbols-rounded { transform:scale(1.15); }

/* ── ACCIONES — tarjeta unificada ── */
.tf-tarjeta__acciones-card {
  border: 1px solid var(--linea); border-radius: 18px; overflow: hidden;
}
.tf-tarjeta__accion-principal {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--acento); color: var(--ink-acento);
  border: none; cursor: pointer; width: 100%; box-sizing: border-box;
  padding: 13px 16px; font-family: var(--fuente-base); font-size: 14.5px; font-weight: 700;
  text-decoration: none; letter-spacing: .01em;
  animation: tf-pulso 2.8s ease-out 1s infinite;
  transition: filter .15s;
}
.tf-tarjeta__accion-principal:hover { filter: brightness(1.08); }

/* ── CHIPS (carrusel horizontal — contacto + QR + instalar) ── */
.tf-tarjeta__chips-scroll {
  display: flex; align-items: flex-start;
  padding: 8px 2px 10px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-top: 1px solid var(--linea);
  scrollbar-width: none;
}
.tf-tarjeta__chips-scroll::-webkit-scrollbar { display: none; }
.tf-tarjeta__chip-btn {
  flex: 1 0 44px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  text-decoration: none; background: none !important; border: none !important; padding: 0 2px; margin: 0;
  cursor: pointer; font-family: var(--fuente-base);
  -webkit-tap-highlight-color: transparent; color: inherit;
  -webkit-appearance: none; appearance: none;
  outline: none;
  -moz-appearance: none;
  -webkit-box-shadow: none;
  box-shadow: none;
}
.tf-tarjeta__chip-ico {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,.85) !important;
  border: 1.5px solid rgba(0,0,0,.08) !important;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s cubic-bezier(.34,1.4,.64,1), background .15s;
  box-shadow: none !important;
  outline: none !important;
}
@media (hover: hover) {
  .tf-tarjeta__chip-btn:hover .tf-tarjeta__chip-ico {
    transform: scale(1.12) translateY(-2px);
    background: color-mix(in srgb, var(--acento) 14%, transparent);
  }
  .tf-tarjeta__chip-btn:hover .tf-tarjeta__chip-lbl { opacity: 1; }
}
.tf-tarjeta__chip-btn:active .tf-tarjeta__chip-ico {
  transform: scale(.88);
  background: color-mix(in srgb, var(--acento) 22%, transparent);
}
.tf-tarjeta__chip-ico .material-symbols-rounded { font-size: 20px; color: var(--acento); }
/* QR e Instalar — fondo neutro fijo, nunca hereda el acento */
.tf-tarjeta__chip-ico--qr,
.tf-tarjeta__chip-ico--pwa {
  background: rgba(255,255,255,.90) !important;
  border-color: rgba(0,0,0,.10) !important;
}
.tf-tarjeta__chip-ico--qr { overflow: hidden; }
.tf-tarjeta__chip-qr-thumb { width: 28px; height: 28px; border-radius: 2px; object-fit: contain; display: block; }
.tf-tarjeta__chip-lbl { font-size: 9px; font-weight: 500; color: var(--tinta); opacity: .7; white-space: nowrap; }

/* QR overlay — posición absoluta dentro de .tf-tarjeta (will-change crea containing block) */
.tf-qr-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.52); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .22s; z-index: 50;
}
.tf-qr-overlay--visible { opacity: 1; pointer-events: auto; }
.tf-qr-popup {
  position: relative; background: #fff; border-radius: 22px;
  padding: 28px 24px 18px; display: flex; flex-direction: column;
  align-items: center; gap: 10px;
  max-width: 240px; width: 82%; animation: tf-slide-up .22s ease;
}
.tf-qr-popup__img { width: 210px; height: 210px; border-radius: 10px; }
.tf-qr-popup__hint { font-size: 11px; color: #555; text-align: center; margin: 0; }
.tf-qr-popup__close {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,.09); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.tf-qr-popup__close .material-symbols-rounded { font-size: 16px; color: #333; }

.tf-tarjeta__bloque{ display:flex; flex-direction:column; gap:6px; }
.tf-tarjeta__eyebrow{ font-family:var(--fuente-mono); font-size:9.5px; letter-spacing:.16em; text-transform:uppercase; opacity:.5; }
.tf-tarjeta__texto{ margin:0; font-size:13.5px; line-height:1.5; }

/* ── CARRUSEL COVERFLOW 3D ──────────────────────────── */
.tf-carrusel-wrap {
  width: 100%;
  position: relative;
  padding: 4px 0 10px;
  user-select: none;
}

/* pista de scroll */
.tf-carrusel-pista {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 10px 32px;
  perspective: 700px;

  /* ocultar scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tf-carrusel-pista::-webkit-scrollbar { display: none; }

/* cada card */
.tf-carrusel-item {
  flex: 0 0 120px;
  height: 158px;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  scroll-snap-align: center;
  border: 2px solid rgba(255,255,255,.12);
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  transform: scale(.84) rotateY(18deg);
  opacity: .65;
  transition: transform .45s cubic-bezier(.25,.8,.25,1),
              opacity   .45s cubic-bezier(.25,.8,.25,1),
              box-shadow .45s,
              border-color .45s;
  will-change: transform;
}
.tf-carrusel-item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.tf-carrusel-item .tf-carrusel-placeholder {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  background: var(--acento); color: var(--ink-acento);
}
.tf-carrusel-item .tf-carrusel-placeholder .material-symbols-rounded { font-size: 40px; }
.tf-carrusel-item .tf-carrusel-placeholder .titulo-item {
  font-size: 11px; font-weight: 700; text-align: center; padding: 0 10px; opacity: .92;
}

/* gradiente + etiqueta inferior */
.tf-carrusel-label {
  position: absolute; inset: auto 0 0 0;
  padding: 28px 10px 10px;
  background: linear-gradient(to top, rgba(0,0,0,.75) 0%, transparent 100%);
  color: #fff; font-size: 11px; font-weight: 700;
  text-align: center; line-height: 1.3; letter-spacing: .02em;
  pointer-events: none;
}

/* brillo "toque" de luz */
.tf-carrusel-item::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.18) 0%, transparent 60%);
  pointer-events: none; border-radius: inherit;
  opacity: 0; transition: opacity .3s;
}
.tf-carrusel-item:hover::after { opacity: 1; }

/* ítem activo (centrado) */
.tf-carrusel-item.activo {
  transform: scale(1) rotateY(0deg);
  opacity: 1;
  border-color: var(--acento);
  box-shadow: 0 0 0 2px var(--acento),
              0 20px 44px rgba(0,0,0,.38);
}

/* ítem a la izquierda del activo */
.tf-carrusel-item.prev-1 {
  transform: scale(.88) rotateY(22deg);
  opacity: .75;
}
/* ítem a la derecha del activo */
.tf-carrusel-item.next-1 {
  transform: scale(.88) rotateY(-22deg);
  opacity: .75;
}

/* indicadores de puntos */
.tf-carrusel-dots {
  display: flex; justify-content: center; gap: 6px; margin-top: 10px;
}
.tf-carrusel-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--linea); transition: background .3s, transform .3s;
}
.tf-carrusel-dots span.activo {
  background: var(--acento); transform: scale(1.35);
}

/* flechas */
.tf-carrusel-flechas {
  display: flex; justify-content: center; gap: 10px; margin-top: 10px;
}
.tf-carrusel-flechas button {
  margin: 0; width: 36px; height: 36px; padding: 0; border-radius: 50%;
  background: var(--acento); color: var(--ink-acento);
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 20px; box-shadow: 0 4px 12px rgba(0,0,0,.2);
  transition: transform .15s, box-shadow .15s;
}
.tf-carrusel-flechas button:hover { transform: scale(1.14); box-shadow: 0 6px 18px rgba(0,0,0,.28); }

/* Play badge en items de video del carrusel */
.tf-carrusel-play-badge {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -60%);
  font-size: 32px; color: rgba(255,255,255,.92);
  filter: drop-shadow(0 3px 8px rgba(0,0,0,.55));
  pointer-events: none; z-index: 2;
  transition: transform .3s, opacity .3s;
}
.tf-carrusel-item.activo .tf-carrusel-play-badge {
  font-size: 40px; transform: translate(-50%, -60%);
  animation: tf-play-pulse 2s ease-in-out infinite;
}
@keyframes tf-play-pulse {
  0%, 100% { opacity:1; filter:drop-shadow(0 3px 8px rgba(0,0,0,.55)); }
  50%       { opacity:.75; filter:drop-shadow(0 3px 16px rgba(0,0,0,.8)); }
}
/* Iframe inline muted en carrusel */
.tf-carrusel-item iframe.tf-inline-video {
  border-radius: 18px;
}

/* ── MODAL DETALLE ─────────────────────────────────── */
.tf-modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.72); backdrop-filter: blur(8px);
  align-items: center; justify-content: center;
  padding: 20px;
}
.tf-modal-overlay.visible { display: flex; animation: tf-modal-in .28s ease both; }
@keyframes tf-modal-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.tf-modal {
  background: var(--fondo); border-radius: 24px; width: 100%; max-width: 360px;
  overflow: hidden; box-shadow: 0 32px 80px rgba(0,0,0,.5);
  animation: tf-modal-card .32s cubic-bezier(.34,1.4,.64,1) both;
}
@keyframes tf-modal-card {
  from { transform: scale(.82) translateY(30px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.tf-modal__img-wrap {
  width: 100%; aspect-ratio: 4/3; position: relative; overflow: hidden; background: #111;
}
.tf-modal__img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tf-modal__img-wrap iframe {
  width: 100%; height: 100%; border: none; display: block;
}
.tf-modal__img-wrap .tf-modal__placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: var(--acento); color: var(--ink-acento);
}
.tf-modal__img-wrap .tf-modal__placeholder .material-symbols-rounded { font-size: 56px; }
.tf-modal__cuerpo { padding: 20px 22px 22px; }
.tf-modal__titulo { font-family: var(--fuente-titulo); font-size: 20px; margin: 0 0 6px; line-height: 1.2; }
.tf-modal__desc { font-size: 14px; line-height: 1.55; color: var(--tinta); opacity: .8; margin: 0 0 16px; }
.tf-modal__acciones { display: flex; gap: 10px; }
.tf-modal__cta {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px; border-radius: 14px; background: var(--acento); color: var(--ink-acento);
  font-weight: 700; font-size: 14px; text-decoration: none; border: none; cursor: pointer;
  font-family: var(--fuente-base);
}
.tf-modal__cerrar {
  width: 48px; flex: none; display: flex; align-items: center; justify-content: center;
  border-radius: 14px; background: #f1f5f9; color: #374151;
  font-size: 22px; border: none; cursor: pointer; font-family: var(--fuente-base);
}

/* ── TILT 3D en la tarjeta ─────────────────────────── */
.tf-telefono {
  perspective: 1000px;
  will-change: transform;
}
.tf-telefono.tilt-activo .tf-tarjeta {
  transition: transform .08s linear;
}

.tf-tarjeta__redes{ display:flex; flex-wrap:wrap; gap:6px; }
.tf-tarjeta__chip-red{
  display:flex; align-items:center; gap:6px; border:1px solid var(--linea); border-radius:999px; padding:6px 11px;
  font-size:12px; opacity:.9; text-decoration:none; color:var(--tinta);
}
.tf-tarjeta__chip-red .material-symbols-rounded{ font-size:15px; }

/* ── Reglas antiguas eliminadas: pwa-compact, qr-mini, pwa-hint, btn-instalar ── */

.tf-tarjeta__publicidad{
  display:flex; align-items:center; justify-content:space-between; gap:12px; padding:15px 22px;
  background:var(--tinta-oscura); color:var(--crema); font-size:13px; text-decoration:none;
}
.tf-tarjeta__publicidad span.marca{ font-family:var(--fuente-mono); letter-spacing:.06em; }
.tf-tarjeta__publicidad span.cta{ font-weight:600; color:#FF8A5C; }

.tf-tarjeta__vistas{ text-align:center; font-size:12px; color:#8A8478; margin-top:14px; font-family:var(--fuente-mono); }

.tf-tarjeta__error{
  max-width:420px; margin:80px auto; text-align:center; font-family:var(--fuente-base); color:#3E3B35;
}
