/* =====================================================================
   TARJETERO · Efectos
   Fondos con profundidad, botones animados y transiciones.
   Todo usa los colores de la paleta (css/paletas.css).
   Si alguien tiene activado "reducir movimiento", las animaciones se apagan.
   ===================================================================== */

:root {
  --curva: cubic-bezier(.2, .8, .2, 1);
  --grano: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>");
}

/* ---------- Textura muy sutil en toda la página ---------- */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: var(--grano); opacity: .045;
}

/* ---------- Encabezado de vidrio ---------- */
.cabecera {
  background: color-mix(in srgb, var(--fondo) 76%, transparent);
  -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px);
  transition: border-color .25s ease, box-shadow .3s ease;
}
.cabecera.con-borde { box-shadow: 0 10px 30px -18px rgba(10, 14, 24, .35); }
.menu a { position: relative; transition: color .2s ease; }
.menu a:hover { background: transparent; color: var(--primario); }
.menu a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px; border-radius: 2px;
  background: var(--primario); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--curva);
}
.menu a:hover::after { transform: scaleX(1); }

/* ---------- Portada: luces de color que se mueven despacio ---------- */
.portada { position: relative; isolation: isolate; overflow: hidden; }
.portada::before {
  content: ""; position: absolute; z-index: -1; inset: -25% -15% -10% -15%; pointer-events: none;
  background:
    radial-gradient(34% 40% at 76% 44%, color-mix(in srgb, var(--primario) 30%, transparent), transparent 70%),
    radial-gradient(26% 32% at 14% 10%, color-mix(in srgb, var(--acento) 26%, transparent), transparent 70%),
    radial-gradient(30% 34% at 50% 98%, color-mix(in srgb, var(--primario) 14%, transparent), transparent 70%);
  animation: deriva 18s ease-in-out infinite alternate;
}
.portada::after {
  content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(color-mix(in srgb, var(--texto) 6%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--texto) 6%, transparent) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(60% 70% at 70% 40%, #000 0%, transparent 75%);
  mask-image: radial-gradient(60% 70% at 70% 40%, #000 0%, transparent 75%);
}
@keyframes deriva {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-4%, 3%, 0) scale(1.08); }
}
.portada__telefono { position: relative; }
.portada__telefono::before {
  content: ""; position: absolute; inset: 8% -12% 4%; z-index: -1; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--primario) 38%, transparent), transparent);
  filter: blur(24px);
}

/* ---------- Secciones claras con brillo de color en las esquinas ---------- */
.seccion--blanca {
  background:
    radial-gradient(48% 60% at 100% 0%, color-mix(in srgb, var(--primario) 8%, transparent), transparent 70%),
    radial-gradient(40% 55% at 0% 100%, color-mix(in srgb, var(--acento) 8%, transparent), transparent 70%),
    var(--superficie);
}
#que-recibes, #precios, #como-pagar {
  background:
    radial-gradient(45% 55% at 0% 0%, color-mix(in srgb, var(--primario) 9%, transparent), transparent 70%),
    radial-gradient(40% 50% at 100% 100%, color-mix(in srgb, var(--acento) 9%, transparent), transparent 70%);
}

/* ---------- Vitrina oscura con luz arriba, puntos y textura ---------- */
.vitrina {
  position: relative; isolation: isolate;
  background:
    radial-gradient(60% 45% at 50% -8%, color-mix(in srgb, var(--primario) 42%, transparent), transparent 72%),
    radial-gradient(40% 40% at 100% 100%, color-mix(in srgb, var(--acento) 14%, transparent), transparent 70%),
    radial-gradient(35% 35% at 0% 60%, color-mix(in srgb, var(--primario) 16%, transparent), transparent 70%),
    linear-gradient(180deg, var(--oscuro), color-mix(in srgb, var(--oscuro) 82%, #000));
}
.vitrina::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(color-mix(in srgb, var(--sobre-oscuro) 16%, transparent) 1px, transparent 1.6px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(75% 55% at 50% 0%, #000, transparent 78%);
  mask-image: radial-gradient(75% 55% at 50% 0%, #000, transparent 78%);
}
.vitrina::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: var(--grano); opacity: .07; mix-blend-mode: soft-light;
}

/* ---------- Tarjeta de pago y pie con degradado ---------- */
.cuenta {
  position: relative; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(70% 60% at 100% 0%, color-mix(in srgb, var(--primario) 38%, transparent), transparent 65%),
    radial-gradient(50% 50% at 0% 100%, color-mix(in srgb, var(--acento) 14%, transparent), transparent 70%),
    linear-gradient(160deg, var(--oscuro-2), var(--oscuro));
  box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--primario) 60%, transparent);
}
.pie {
  background:
    radial-gradient(50% 80% at 85% 0%, color-mix(in srgb, var(--primario) 22%, transparent), transparent 70%),
    linear-gradient(180deg, var(--oscuro), color-mix(in srgb, var(--oscuro) 85%, #000));
}

/* ---------- Cierre como panel destacado ---------- */
.cierre__caja {
  position: relative; overflow: hidden; isolation: isolate;
  padding: clamp(32px, 5vw, 60px); border-radius: 30px; color: var(--sobre-oscuro); --foco: var(--acento);
  background:
    radial-gradient(55% 80% at 100% 100%, color-mix(in srgb, var(--primario) 55%, transparent), transparent 70%),
    radial-gradient(35% 60% at 0% 0%, color-mix(in srgb, var(--acento) 22%, transparent), transparent 70%),
    linear-gradient(135deg, var(--oscuro), var(--oscuro-2));
  box-shadow: 0 40px 80px -40px color-mix(in srgb, var(--primario) 70%, transparent);
}
.cierre__caja::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: var(--grano); opacity: .08; mix-blend-mode: soft-light;
}
.cierre__caja .boton--secundario { color: var(--sobre-oscuro); }

/* ---------- Botones ---------- */
.boton {
  position: relative; overflow: hidden; isolation: isolate;
  transition: transform .28s var(--curva), box-shadow .28s ease, background-color .2s ease, color .2s ease;
}
.boton .ico { transition: transform .3s var(--curva); }
.boton:hover { transform: translateY(-2px); }
.boton:hover .ico { transform: scale(1.14) rotate(-8deg); }
.boton:active { transform: translateY(0) scale(.97); transition-duration: .08s; }
.boton--primario { box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--primario) 65%, transparent); }
.boton--primario:hover { box-shadow: 0 16px 30px -10px color-mix(in srgb, var(--primario) 75%, transparent); }
.boton--primario::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .4) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .75s ease;
}
.boton--primario:hover::after { transform: translateX(120%); }
.boton--secundario:hover { color: var(--primario); box-shadow: inset 0 0 0 1.5px var(--primario); background: color-mix(in srgb, var(--primario) 7%, transparent); }
.cierre__caja .boton--secundario:hover { color: var(--sobre-oscuro); box-shadow: inset 0 0 0 1.5px var(--sobre-oscuro); background: color-mix(in srgb, var(--sobre-oscuro) 10%, transparent); }
.boton--claro:hover { box-shadow: 0 14px 28px -12px rgba(0, 0, 0, .45); }

/* Botón flotante de WhatsApp: late cada pocos segundos */
.wa-flotante { transition: transform .3s var(--curva), box-shadow .3s ease; }
.wa-flotante::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  animation: latido 3.2s ease-out 2s infinite;
}
.wa-flotante:hover { transform: scale(1.08) rotate(-6deg); }
@keyframes latido {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primario) 60%, transparent); }
  70% { box-shadow: 0 0 0 20px color-mix(in srgb, var(--primario) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* Botones de profesión y filtros */
.giro, .categoria { transition: transform .22s var(--curva), background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .22s ease; }
.giro:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--primario) 70%, transparent); border-color: var(--primario); }
.categoria:hover { transform: translateY(-2px); }
.giro[aria-pressed="true"], .categoria[aria-pressed="true"] { box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .5); }

/* ---------- Tarjetas de la vitrina ---------- */
.ej .telefono { transition: transform .4s var(--curva), box-shadow .4s ease; }
.ej:hover .telefono, .ej:focus-within .telefono {
  transform: translateY(-10px) rotate(-.6deg);
  box-shadow: inset 0 0 0 1px #2c3331, 0 44px 70px -26px color-mix(in srgb, var(--primario) 65%, transparent), 0 16px 30px -14px rgba(0, 0, 0, .55);
}
.ej__btn { transition: transform .3s var(--curva), box-shadow .3s ease; }
.ej:hover .ej__btn { transform: translateY(-4px); box-shadow: 0 14px 26px -8px color-mix(in srgb, var(--primario) 75%, transparent); }

/* ---------- Paquetes: el combo tiene un borde de luz que gira ---------- */
@property --giro-borde { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.paquete { transition: transform .35s var(--curva), box-shadow .35s ease; }
.paquete:hover { transform: translateY(-6px); box-shadow: inset 0 0 0 1px var(--linea), 0 30px 50px -28px rgba(10, 14, 24, .35); }
.paquete--destacado {
  border: 2px solid transparent;
  background:
    linear-gradient(160deg, var(--oscuro-2), var(--oscuro)) padding-box,
    conic-gradient(from var(--giro-borde), var(--primario), var(--acento), color-mix(in srgb, var(--primario) 40%, var(--oscuro)), var(--primario)) border-box;
  box-shadow: 0 36px 70px -34px color-mix(in srgb, var(--primario) 75%, transparent);
  animation: borde-giro 7s linear infinite;
}
.paquete--destacado:hover { box-shadow: 0 44px 80px -34px color-mix(in srgb, var(--primario) 85%, transparent); }
@keyframes borde-giro { to { --giro-borde: 360deg; } }

/* Pasos y funciones */
.paso { transition: transform .35s var(--curva), background-color .3s ease, box-shadow .35s ease; }
.paso:hover { transform: translateY(-5px); background: color-mix(in srgb, var(--primario) 7%, var(--fondo)); box-shadow: 0 24px 40px -28px rgba(10, 14, 24, .35); }
.funcion__ico { transition: transform .35s var(--curva), background-color .3s ease, color .3s ease; }
.funcion:hover .funcion__ico { transform: rotate(-8deg) scale(1.1); background: var(--primario); color: var(--sobre-primario); }

/* ---------- Ventana de ejemplo ---------- */
.ventana[open] .ventana__caja { animation: entrar-ventana .4s var(--curva) both; }
.ventana[open]::backdrop { animation: fundido .3s ease both; }
#v-lienzo > * { animation: entrar-suave .35s var(--curva) both; }
.pestanas button { transition: background-color .2s ease, color .2s ease; }
.ventana__cerrar { transition: transform .25s var(--curva); }
.ventana__cerrar:hover { transform: rotate(90deg); }
@keyframes entrar-ventana { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes entrar-suave { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fundido { from { opacity: 0; } to { opacity: 1; } }

/* Aviso flotante */
.toast { transition: opacity .25s ease, transform .35s var(--curva); }

/* ---------- Preguntas: se despliegan suavemente ---------- */
.preguntas details { interpolate-size: allow-keywords; }
.preguntas details::details-content { block-size: 0; overflow: clip; transition: block-size .35s var(--curva), content-visibility .35s allow-discrete; }
.preguntas details[open]::details-content { block-size: auto; }
.preguntas summary { transition: color .2s ease; }
.preguntas summary:hover { color: var(--primario); }

/* ---------- Aparecer al hacer scroll ---------- */
.js [data-revelar] { opacity: 0; transform: translateY(26px); }
.js [data-revelar].visible {
  opacity: 1; transform: none;
  transition: opacity .8s var(--curva), transform .8s var(--curva);
  transition-delay: var(--retraso, 0ms);
}
/* La portada entra sola al cargar */
.js .portada__texto > * { animation: entrar-portada .9s var(--curva) both; }
.js .portada__texto > :nth-child(2) { animation-delay: .12s; }
.js .portada__texto > :nth-child(3) { animation-delay: .24s; }
.js .portada__texto > :nth-child(4) { animation-delay: .36s; }
@keyframes entrar-portada { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

/* ---------- Respeta "reducir movimiento" ---------- */
@media (prefers-reduced-motion: reduce) {
  .portada::before, .wa-flotante::before, .paquete--destacado { animation: none !important; }
  .js [data-revelar] { opacity: 1; transform: none; transition: none; }
  .js .portada__texto > * { animation: none; }
  .boton:hover, .giro:hover, .categoria:hover, .paquete:hover, .paso:hover,
  .ej:hover .telefono, .ej:focus-within .telefono, .ej:hover .ej__btn { transform: none; }
}
