/* =========================================================
   ABS Industrial · Tarjeta digital
   Paleta: verde, amarillo y negro (según la referencia)
   ========================================================= */

:root {
  --verde-950: #031a0e;
  --verde-900: #062a17;
  --verde-800: #0a3d22;
  --verde-700: #0f5130;
  --verde-600: #15803d;
  --verde-500: #22a14c;
  --amarillo: #ffd21f;
  --amarillo-intenso: #f2b705;
  --negro: #0b0b0b;
  --blanco: #ffffff;
  --gris-borde: #d9dde0;

  --radio: 16px;
  --sombra: 0 6px 18px rgba(0, 0, 0, .35);
  --foco: 0 0 0 3px var(--verde-950), 0 0 0 6px var(--amarillo);

  --fuente: "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  --fuente-lema: Georgia, "Times New Roman", serif;

  /* Las fotos de fondo se asignan desde app.js según config.js */
  --foto-superior: none;
  --foto-central: none;
  --foto-inferior: none;

  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  font-family: var(--fuente);
  line-height: 1.3;
  color: var(--blanco);
  background-color: var(--verde-950);
  background-image: radial-gradient(120% 60% at 50% 0%, #1b6b3c 0%, var(--verde-800) 45%, var(--verde-950) 100%);
}

/* ---------- Fondo fotográfico por capas (composición de la referencia) ----------
   Superior: planta/maquinaria detrás del logo, visible pero oscurecida.
   Central: detrás de los botones, muy oscurecida.
   Inferior: piso/maquinaria detrás del QR y el pie.
   Cada capa lleva su propia veladura verde oscura y se funde con las vecinas. */
.fondo {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.fondo__foto {
  position: absolute;
  left: 0;
  right: 0;
  background-repeat: no-repeat;
  background-size: cover;
}

.fondo__foto--superior {
  top: 0;
  height: 640px;
  background-image:
    linear-gradient(180deg, rgba(3, 26, 14, .42) 0%, rgba(4, 32, 17, .6) 45%, rgba(6, 42, 23, .82) 100%),
    var(--foto-superior);
  background-position: center, 58% 40%;
  -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 72%, transparent 100%);
}

.fondo__foto--central {
  top: 500px;
  height: 640px;
  background-image:
    linear-gradient(180deg, rgba(4, 32, 17, .86), rgba(4, 32, 17, .9)),
    var(--foto-central);
  background-position: center, 55% center;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
}

.fondo__foto--inferior {
  bottom: 0;
  height: 620px;
  background-image:
    linear-gradient(180deg, rgba(3, 26, 14, .9) 0%, rgba(3, 26, 14, .76) 40%, rgba(3, 26, 14, .84) 100%),
    var(--foto-inferior);
  background-position: center, 40% 75%;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 28%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 28%);
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.icono { width: 1em; height: 1em; }

/* ---------- Contenedor ---------- */
.tarjeta {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---------- Encabezado ---------- */
.marca { text-align: center; padding-top: 4px; }

.marca__logo {
  width: min(76%, 340px);
  margin: 0 auto 6px;
  aspect-ratio: 1672 / 940;   /* proporción exacta del logo original */
  display: grid;
  place-items: center;
}

.marca__logo img {
  width: 100%;
  height: auto;
  /* Solo una sombra exterior para separarlo de la foto; el logo no se recorta, deforma ni recolorea */
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .5));
}

.marca__nombre {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .7);
}

.marca__linea1 {
  font-size: clamp(1.65rem, 8.6vw, 2.45rem);
  font-weight: 800;
  letter-spacing: -.005em;
  line-height: 1.05;
}

.marca__linea2 {
  margin-top: 4px;
  font-size: clamp(.82rem, 4vw, 1.12rem);
  font-weight: 700;
  letter-spacing: .2em;
}

.marca__nombre::after {
  content: "";
  display: block;
  width: 110px;
  height: 4px;
  margin: 10px auto 6px;
  border-radius: 2px;
  background: var(--amarillo);
}

.marca__lema {
  margin: 0;
  font-family: var(--fuente-lema);
  font-style: italic;
  font-size: clamp(1.15rem, 6vw, 1.6rem);
  color: var(--amarillo);
  text-shadow: 0 2px 8px rgba(0, 0, 0, .75);
}

/* ---------- Marcadores pendientes ---------- */
.pendiente {
  margin: 0;
  display: grid;
  place-items: center;
  gap: 4px;
  text-align: center;
  font-size: .82rem;
  font-weight: 600;
  border: 2px dashed rgba(255, 210, 31, .75);
  border-radius: 12px;
  background: rgba(3, 26, 14, .6);
  color: var(--amarillo);
}

.pendiente small { font-weight: 400; color: rgba(255, 255, 255, .85); }

.pendiente--logo { width: 100%; height: 100%; padding: 12px; }

/* ---------- Perfil ---------- */
.perfil {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 16px 16px;
  border: 1.5px solid rgba(255, 210, 31, .85);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(10, 61, 34, .92), rgba(6, 42, 23, .95));
  box-shadow: var(--sombra);
}

.perfil__avatar {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2.5px solid var(--amarillo);
  background: var(--verde-700);
  font-size: 34px;
  color: var(--blanco);
}

.perfil::before { /* divisor amarillo entre avatar y texto */
  content: "";
  grid-column: 2;
  grid-row: 1;
  width: 2px;
  height: 52px;
  background: var(--amarillo);
}

.perfil__avatar { grid-column: 1; grid-row: 1; }
.perfil__texto { grid-column: 3; grid-row: 1; min-width: 0; }

.perfil__nombre {
  margin: 0;
  font-size: clamp(1.2rem, 6.4vw, 1.85rem);
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
}

.perfil__cargo {
  margin: 4px 0 0;
  font-size: clamp(.8rem, 3.9vw, 1.05rem);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--amarillo);
}

/* ---------- Botones de contacto ---------- */
.acciones__lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.accion {
  min-height: 64px;               /* objetivo táctil holgado (> 48 px) */
  height: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radio);
  border: 1.5px solid transparent;
  box-shadow: var(--sombra);
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s ease, filter .15s ease;
}

.accion:hover { filter: brightness(1.06); }
.accion:active { transform: scale(.98); }
.accion:focus-visible { outline: none; box-shadow: var(--foco); }

.accion__icono { width: 34px; height: 34px; flex: none; }
.accion__flecha { width: 20px; height: 20px; opacity: .9; }

.accion__texto { display: flex; flex-direction: column; min-width: 0; }

.accion__titulo { font-size: 1.12rem; font-weight: 700; line-height: 1.15; }

.accion__detalle {
  margin-top: 2px;
  font-size: .86rem;
  line-height: 1.2;
  overflow-wrap: break-word;
}

/* Correo y web disponen de una línea completa para el dato de contacto. */
.acciones__fila-completa { grid-column: 1 / -1; }
.accion.accion--amplia {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 4px 12px;
}
.accion--amplia .accion__texto { display: contents; }
.accion--amplia .accion__icono { grid-column: 1; grid-row: 1; }
.accion--amplia .accion__titulo { grid-column: 2; grid-row: 1; }
.accion--amplia .accion__flecha { display: block; grid-column: 3; grid-row: 1; }
.accion--amplia .accion__detalle {
  grid-column: 1 / -1;
  grid-row: 2;
  margin-top: 0;
  font-size: .9375rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* Variantes (todos los pares texto/fondo superan 4.5:1) */
.accion--whatsapp {
  background: linear-gradient(180deg, var(--verde-600), #0e6430);
  border-color: #3ee07a;
  color: var(--blanco);
}

.accion--claro {
  background: linear-gradient(180deg, #ffffff, #eef0f2);
  border-color: var(--gris-borde);
  color: var(--negro);
}

.accion--correo {
  background: linear-gradient(180deg, var(--amarillo), var(--amarillo-intenso));
  border-color: #ffe56b;
  color: var(--negro);
}

.accion--instagram {
  background: linear-gradient(100deg, #c2410c 0%, #be185d 52%, #7e22ce 100%);
  border-color: #f472b6;
  color: var(--blanco);
}

.accion--facebook {
  background: linear-gradient(180deg, #1565d8, #0d4fb5);
  border-color: #4f8ff0;
  color: var(--blanco);
}

.accion--tiktok {
  background: var(--negro);
  border-color: var(--amarillo);
  color: var(--blanco);
}

/* ---------- QR + Agregar a contactos ---------- */
.compartir {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 14px;
  margin-top: 4px;
}

.compartir__divisor { width: 1.5px; background: rgba(255, 210, 31, .6); margin: 12px 0; }

.qr {
  margin: 0;
  aspect-ratio: 1;
  padding: 10px;
  border-radius: 18px;
  background: var(--blanco);
  box-shadow: var(--sombra);
  display: grid;
  place-items: center;
}

.qr a { display: block; width: 100%; border-radius: 8px; }
.qr a:focus-visible { outline: none; box-shadow: var(--foco); }
.qr img { display: block; width: 100%; height: auto; image-rendering: pixelated; }

.pendiente--qr {
  width: 100%;
  height: 100%;
  border-color: var(--verde-600);
  background: #f3f6f4;
  color: var(--verde-900);
  font-size: .85rem;
}

.pendiente--qr .icono { width: 40px; height: 40px; color: var(--verde-700); }
.pendiente--qr small { color: #33463a; font-size: .72rem; padding: 0 4px; }

.agregar {
  min-height: 64px;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
  border: 2px solid var(--amarillo);
  background: linear-gradient(180deg, var(--verde-800), var(--verde-900));
  color: var(--blanco);
  font: inherit;
  cursor: pointer;
  box-shadow: var(--sombra);
  transition: transform .15s ease, filter .15s ease;
}

.agregar:hover { filter: brightness(1.12); }
.agregar:active { transform: scale(.98); }
.agregar:focus-visible { outline: none; box-shadow: var(--foco); }

.agregar__icono { width: clamp(48px, 18vw, 76px); height: clamp(48px, 18vw, 76px); }

.agregar__texto {
  font-size: clamp(1rem, 5vw, 1.4rem);
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
}

.aviso {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 210, 31, .15);
  border: 1px solid var(--amarillo);
  font-size: .85rem;
}

/* ---------- Pie ---------- */
.valores { margin-top: 6px; }

.valores__lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.valor {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  text-align: center;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #eef5f0;
}

.valor + .valor { border-left: 1.5px solid rgba(255, 255, 255, .45); }

.valor__icono { width: 36px; height: 36px; flex: none; }

/* ---------- Pantallas más anchas: dos columnas como la referencia ---------- */
@media (min-width: 400px) {
  .acciones__lista { grid-template-columns: 1fr 1fr; }
  .accion { gap: 10px; padding: 10px 12px; }
  .accion__icono { width: 32px; height: 32px; }
  .accion__flecha { display: none; }
  .accion__titulo { font-size: 1.02rem; }
  .accion__detalle { font-size: .8rem; }
}

@media (min-width: 440px) {
  .valor { flex-direction: row; text-align: left; justify-content: center; gap: 10px; }
}

@media (min-width: 480px) {
  .accion__flecha { display: block; width: 16px; height: 16px; }
  .accion__icono { width: 34px; height: 34px; }
  .accion__titulo { font-size: 1.08rem; }
}

/* ---------- Pantallas muy angostas (320 px) ---------- */
@media (max-width: 359px) {
  .perfil { gap: 10px; padding: 14px 12px; }
  .perfil__avatar { width: 52px; height: 52px; font-size: 28px; }
  .perfil::before { height: 44px; }
  .compartir { gap: 10px; }
  .valor { font-size: .64rem; padding: 4px 3px; }
}

@media (prefers-reduced-motion: reduce) {
  .accion, .agregar { transition: none; }
  .accion:active, .agregar:active { transform: none; }
}

@media (forced-colors: active) {
  .accion, .agregar, .perfil, .qr { border: 2px solid CanvasText; }
}
