/* =========================================================
   NAUCL — Design tokens (derivados del logo)
   Paleta: magenta -> violeta -> tinta (gradiente del icono "N")
           + gris apagado y verde menta (cola del gradiente)
   Tipografia: Space Grotesk (display) / Inter (texto) /
               JetBrains Mono (precios, etiquetas, utilitario)
   ========================================================= */

/* La tipografia se carga como <link> a Google Fonts desde includes/header.php
   (unico host externo permitido por el CSP de .htaccess) - antes se usaba un
   @font-face contra cdn.jsdelivr.net que el CSP bloqueaba en silencio y el
   sitio caia a la fuente del sistema sin que se notara visualmente. */

:root {
  --ink: #120F17;
  --ink-soft: #1B1723;
  --ink-elev: #241F2E;
  --magenta: #D8409F;
  --violet: #7A2FB8;
  --mint: #9DF899;
  --slate: #8B8FA3;
  --paper: #FAFAF8;
  --line: rgba(255,255,255,0.08);
  --gradient-signature: linear-gradient(135deg, var(--magenta) 0%, var(--violet) 55%, var(--ink) 100%);

  --font-display: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --radius: 14px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* Los controles de formulario y botones NO heredan la fuente del body por
   defecto en los navegadores - hay que forzarlo para que Google Sans Flex
   se aplique tambien ahi (inputs, selects, textareas, botones). */
button, input, select, textarea, optgroup {
  font-family: inherit;
}

:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  margin: 0;
  letter-spacing: -0.01em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--mint);
  display: inline-block;
  padding: 5px 12px;
  border-radius: 6px;
  transform: rotate(-1.2deg);
  font-weight: 700;
}

/* =========================================================
   Header
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(18,15,23,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img {
  height: 42px;
  width: 42px;
  object-fit: contain;
  object-position: left center;
}

.nav-cats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-cats a {
  font-size: 13.5px;
  padding: 7px 13px;
  border-radius: 20px;
  border: 1px solid var(--line);
  color: var(--slate);
  white-space: nowrap;
}
.nav-cats a:hover { color: var(--paper); border-color: var(--magenta); }

.social-icons {
  display: flex;
  gap: 10px;
  align-items: center;
}
/* Combinador ">" (solo hijos directos) a propósito: sin esto, esta regla
   también le pegaba a los botones de adentro del menú de cuenta
   (Ver historial / Soporte / Cerrar sesión), que viven anidados varios
   niveles más adentro (.account-menu-wrap > .account-menu > a) y no deben
   verse como un ícono circular de 32px. */
.social-icons > a {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  color: var(--paper);
  transition: transform .15s ease, border-color .15s ease;
}
.social-icons > a:hover { border-color: var(--magenta); transform: translateY(-2px); }
.social-icons > a svg { width: 16px; height: 16px; }

.cart-icon-link {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  /* Esta clase también se usa en <button> (el ícono de cuenta) además de
     <a> — sin resetear background/font/cursor, el navegador le pone su
     fondo blanco de botón por defecto, tapando el ícono adentro. */
  background: none;
  font-family: inherit;
  cursor: pointer;
  color: var(--paper);
  transition: transform .15s ease, border-color .15s ease;
  margin-left: 4px;
}
.cart-icon-link:hover { border-color: var(--mint); transform: translateY(-2px); }
.cart-icon-link svg { width: 18px; height: 18px; }
.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--magenta);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  padding: 88px 0 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(216,64,159,.4), transparent 60%),
    radial-gradient(ellipse 900px 600px at 85% 10%, rgba(122,47,184,.5), transparent 60%),
    var(--ink);
}

.hero-inner {
  position: relative;
  text-align: center;
  max-width: 820px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(30px, 4.6vw, 47px);
  line-height: 1.18;
  letter-spacing: -.015em;
  margin: 0 0 14px;
  text-wrap: balance;
}

.hero h1 .accent {
  /* Degradado de solo 2 paradas (magenta -> violeta), sin el tercer
     "ink" del --gradient-signature: ese tercer tono es casi idéntico al
     fondo, así que si se usa en texto (no en un botón/superficie), la
     última letra queda prácticamente invisible sobre el fondo oscuro. */
  background: linear-gradient(90deg, var(--magenta), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  color: var(--slate);
  font-size: 17px;
  max-width: 52ch;
  margin: 0 auto 34px;
}

.hero-ctas {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-hero {
  background: var(--gradient-signature);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  padding: 18px 34px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  box-shadow: 0 18px 40px -14px rgba(122,47,184,.65);
}
.btn-hero svg { width: 17px; height: 17px; display: block; flex-shrink: 0; }
.hero-ctas .btn-ghost {
  border-radius: 100px;
  padding: 18px 30px;
}

/* Cadena de puntos degradados - firma visual del logo,
   reutilizada como indicador de "stock disponible" */
.dot-chain {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 26px;
}
.dot-chain .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot-chain .dot:nth-child(1) { background: var(--magenta); }
.dot-chain .dot:nth-child(2) { background: #b64fac; }
.dot-chain .dot:nth-child(3) { background: var(--violet); }
.dot-chain .dot:nth-child(4) { background: var(--slate); }
.dot-chain .dot:nth-child(5) { background: var(--mint); }

/* ---------- Collage decorativo de pantallas (sin logos de terceros) ---------- */
.screen-stack { position: relative; height: 380px; margin-top: 52px; }
.screen-stack .screen {
  position: absolute;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 40px 70px -30px rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
}
.screen-stack .glyph { width: 34%; height: 34%; }
.screen-stack .s1 { width: 210px; height: 265px; left: 6%; top: 18%; transform: rotate(-9deg); background: linear-gradient(150deg,#2a1533,#120F17 70%); z-index: 1; }
.screen-stack .s2 { width: 230px; height: 285px; left: 20%; top: 4%; transform: rotate(-3deg); background: linear-gradient(160deg,var(--violet),#3a1a5c 75%); z-index: 2; }
.screen-stack .s3 { width: 270px; height: 310px; left: 50%; top: -2%; transform: translateX(-50%); background: linear-gradient(165deg,var(--magenta),var(--violet) 80%); z-index: 4; }
.screen-stack .s4 { width: 230px; height: 285px; right: 20%; top: 4%; transform: rotate(3deg); background: linear-gradient(15deg,#1f7a52,#0e3a28 75%); z-index: 2; }
.screen-stack .s5 { width: 210px; height: 265px; right: 6%; top: 18%; transform: rotate(9deg); background: linear-gradient(15deg,#7a3a12,#2b1508 75%); z-index: 1; }
@media (max-width: 860px) { .screen-stack { display: none; } }

/* =========================================================
   Botones
   ========================================================= */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14.5px;
  padding: 13px 24px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--gradient-signature);
  color: #fff;
  box-shadow: 0 8px 24px rgba(216,64,159,.28);
}
.btn-primary:hover { box-shadow: 0 10px 30px rgba(122,47,184,.4); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--paper);
}
.btn-ghost:hover { border-color: var(--mint); color: var(--mint); }

.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* =========================================================
   Catalogo
   ========================================================= */
.catalog {
  padding: 64px 0 96px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 20px;
  flex-wrap: wrap;
}
.section-head h2 { font-size: 30px; letter-spacing: -.01em; }
.section-head p { color: var(--slate); font-size: 13.5px; margin: 6px 0 0; }

.search-row {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 16px;
  width: 280px;
  max-width: 100%;
}
.search-row svg { width: 16px; height: 16px; color: var(--slate); flex-shrink: 0; }
.search-row input { background: none; border: none; outline: none; color: var(--paper); font-family: var(--font-body); font-size: 13.5px; width: 100%; }
.search-row input::placeholder { color: var(--slate); }

.category-block { margin-top: 52px; }
.category-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.category-head h3 { font-size: 15px; font-weight: 700; letter-spacing: .02em; margin: 0; white-space: nowrap; }
.category-head .rule { height: 1px; flex: 1; background: var(--line); }
.category-head .count { font-family: var(--font-mono); font-size: 11px; color: var(--slate); }

.grid-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.plan-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  border: 1px solid rgba(255,255,255,.08);
  transition: transform .15s;
}
.plan-card:hover { transform: translateY(-4px); }
.plan-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(115deg, rgba(255,255,255,.07) 0 2px, transparent 2px 34px);
}
.plan-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,.55) 0%, transparent 55%);
}
.plan-card .badge-logo {
  position: relative;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,.16);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: auto;
  align-self: flex-start;
  border: 1px solid rgba(255,255,255,.3);
  overflow: hidden;
  color: #fff;
}
.plan-card .badge-logo svg { width: 22px; height: 22px; display: block; }
.plan-card .badge-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.plan-card .cat-pill {
  position: relative;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: rgba(255,255,255,.85);
  margin-bottom: 14px;
}
.plan-card h4 {
  position: relative;
  z-index: 2;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
  color: #fff;
  letter-spacing: -.01em;
  margin: 0 0 6px;
  text-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.plan-card .price-row {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.plan-card .price { font-family: var(--font-mono); font-weight: 800; font-size: 18px; color: #fff; }
.plan-card .stock {
  position: relative;
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 100px;
  background: rgba(255,255,255,.18);
  color: #fff;
  backdrop-filter: blur(6px);
  font-family: var(--font-mono);
}
.plan-card .stock.low { background: rgba(255,255,255,.92); color: #a52176; }
.plan-card .stock.out { background: rgba(0,0,0,.35); color: rgba(255,255,255,.6); }
.plan-card form { position: relative; z-index: 2; margin-top: 14px; }
.plan-card .btn-primary {
  width: 100%;
  background: rgba(255,255,255,.95);
  color: var(--ink);
  box-shadow: none;
}
.plan-card .btn-primary:hover { background: #fff; }
.plan-card .btn-ghost { width: 100%; border-color: rgba(255,255,255,.3); color: rgba(255,255,255,.75); }

/* Degradados por plataforma (ver naucl_platform_class() en functions.php) -
   mismo criterio de coincidencia que los iconos, para que color e icono
   siempre correspondan a la misma plataforma. Los productos que no calzan
   con ninguna plataforma conocida caen a uno de los 6 "p-fallback-N"
   elegidos de forma deterministica segun la categoria. */
.p-netflix { background: linear-gradient(150deg,#E50914,#3d0409 78%); }
.p-hbo { background: linear-gradient(150deg,#5822b4,#1e0b40 78%); }
.p-disney { background: linear-gradient(150deg,#113CCF,#081c66 78%); }
.p-prime { background: linear-gradient(150deg,#00A8E1,#053c50 78%); }
.p-paramount { background: linear-gradient(150deg,#0064FF,#031a52 78%); }
.p-deezer { background: linear-gradient(150deg,#a238ff,#3a1266 78%); }
.p-tnt { background: linear-gradient(150deg,#ff5b3d,#8a1f10 75%); }
.p-spotify { background: linear-gradient(150deg,#1DB954,#0c3018 78%); }
.p-vix { background: linear-gradient(150deg,#e6194f,#4a0a1c 78%); }
.p-apple { background: linear-gradient(150deg,#4a4a4d,#121214 78%); }
.p-youtube { background: linear-gradient(150deg,#FF0000,#2b0000 78%); }
.p-crunchy { background: linear-gradient(150deg,#F47521,#5c2a08 78%); }
.p-fallback-0 { background: linear-gradient(150deg,#7A2FB8,#3a1560 78%); }
.p-fallback-1 { background: linear-gradient(150deg,#D8409F,#611f47 78%); }
.p-fallback-2 { background: linear-gradient(150deg,#2f7a6e,#123832 78%); }
.p-fallback-3 { background: linear-gradient(150deg,#b8722f,#4a2c0f 78%); }
.p-fallback-4 { background: linear-gradient(150deg,#2f5db8,#14264d 78%); }
.p-fallback-5 { background: linear-gradient(150deg,#8f8f2f,#35350f 78%); }

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  color: var(--slate);
}

/* =========================================================
   Carrito
   ========================================================= */
.cart-wrap {
  padding: 48px 0 90px;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  align-items: start;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cart-line {
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.cart-line .line-info { flex: 1; min-width: 180px; }
.cart-line .line-info .cat-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #fff;
  background: var(--violet);
  padding: 2px 8px;
  border-radius: 5px;
  display: inline-block;
  margin-bottom: 6px;
  font-weight: 700;
}
.cart-line .line-info h4 { font-size: 16px; margin: 0 0 4px; }
.cart-line .line-info .unit-price { color: var(--slate); font-size: 13px; font-family: var(--font-mono); }

.cart-line .line-qty select {
  background: var(--ink);
  border: 1px solid var(--line);
  color: var(--paper);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 14px;
}

.cart-line .line-subtotal {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  min-width: 90px;
  text-align: right;
}

.cart-line .line-remove {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--slate);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
}
.cart-line .line-remove:hover { border-color: var(--magenta); color: var(--magenta); }

.cart-empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 60px 24px;
  text-align: center;
  color: var(--slate);
}
.cart-empty svg { width: 40px; height: 40px; margin: 0 auto 14px; opacity: .5; }

/* =========================================================
   Checkout
   ========================================================= */
.checkout-wrap {
  padding: 48px 0 90px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}

.checkout-form, .order-summary {
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}

/* =========================================================
   Cuenta de cliente (cuenta.php)
   ========================================================= */
.account-tabs {
  display: flex;
  gap: 8px;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 24px;
}
.account-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  background: none;
  border: none;
  color: var(--slate);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13.5px;
  padding: 10px;
  border-radius: 9px;
  cursor: pointer;
}
.account-tab.active {
  background: var(--gradient-signature);
  color: #fff;
}
.account-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 22px;
  font-size: 13.5px;
}
.account-bar a { color: var(--mint); text-decoration: underline; }
.account-bar a:hover { color: var(--paper); }

/* Menú pequeño de cuenta (header): un login rápido sin salir de la
   página, en vez de mandar a cuenta.php de entrada. */
.account-menu-wrap { position: relative; }
.account-menu {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 280px;
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 20px 44px rgba(0,0,0,.45);
  z-index: 45;
  text-align: left;
}
.account-menu.open { display: block; }
.account-menu .btn-sm { padding: 10px; font-size: 13px; }
.account-menu-link {
  display: block;
  text-align: center;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--slate);
  text-decoration: underline;
  white-space: nowrap;
}
.account-menu-link:hover { color: var(--mint); }

/* =========================================================
   Historial de pedidos (mis-pedidos.php)
   ========================================================= */
.order-card {
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.order-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.order-id { display: block; font-family: var(--font-mono); font-weight: 700; font-size: 13px; }
.order-date { display: block; color: var(--slate); font-size: 12px; margin-top: 3px; }
.order-status { font-size: 11px; font-weight: 700; padding: 5px 11px; border-radius: 100px; white-space: nowrap; }
.order-status.g { background: rgba(157,248,153,.15); color: var(--mint); }
.order-status.y { background: rgba(216,64,159,.15); color: var(--magenta); }
.order-status.r { background: rgba(216,64,159,.2); color: #ffb0d8; }
.order-status.n { background: rgba(255,255,255,.1); color: var(--slate); }
.order-card-items .summary-line:first-child { padding-top: 0; }
.order-accounts { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.order-accounts-title { font-size: 12px; font-weight: 700; color: var(--mint); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 8px; }
.order-track-link { display: inline-block; margin-top: 14px; font-size: 13px; color: var(--mint); text-decoration: underline; }
.order-track-link:hover { color: var(--paper); }

/* =========================================================
   Hilo de un ticket de soporte (ticket.php)
   ========================================================= */
.ticket-thread { display: flex; flex-direction: column; gap: 12px; }
.ticket-msg {
  border-radius: 14px;
  padding: 14px 16px;
  max-width: 88%;
  border: 1px solid var(--line);
}
.ticket-msg.from-cliente { align-self: flex-end; background: var(--ink-elev); }
.ticket-msg.from-admin { align-self: flex-start; background: rgba(157,248,153,.08); border-color: rgba(157,248,153,.25); }
.ticket-msg-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 12px; }
.ticket-msg-head strong { color: var(--paper); }
.ticket-msg-head span { color: var(--slate); white-space: nowrap; }
.ticket-msg p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--paper); white-space: pre-wrap; }
@media (max-width: 640px) { .ticket-msg { max-width: 100%; } }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--slate);
  margin-bottom: 6px;
  font-family: var(--font-mono);
}
.field input, .field select {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--paper);
  font-size: 15px;
  font-family: var(--font-body);
}
.field input:focus, .field select:focus {
  border-color: var(--magenta);
  outline: none;
}
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

.mp-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 20px;
  font-size: 13.5px;
  color: var(--slate);
}
.mp-badge strong { color: var(--paper); }

.order-summary h3 { font-size: 16px; margin-bottom: 16px; }
.summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--slate);
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.summary-line.total {
  color: var(--paper);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 17px;
  border-bottom: none;
  padding-top: 14px;
}

.alert {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
}
.alert-error { background: rgba(216,64,159,.12); border: 1px solid var(--magenta); color: #ffc9ea; }
.alert-success { background: rgba(157,248,153,.1); border: 1px solid var(--mint); color: var(--mint); }

/* =========================================================
   Resultado de pago / entrega de credenciales
   ========================================================= */
.result-wrap {
  padding: 70px 0 100px;
  max-width: 640px;
  margin: 0 auto;
}
.result-card {
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 40px;
  text-align: center;
}
.result-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}
.result-icon.ok { background: rgba(157,248,153,.15); color: var(--mint); }
.result-icon.wait { background: rgba(139,143,163,.15); color: var(--slate); }
.result-icon.fail { background: rgba(216,64,159,.15); color: var(--magenta); }

.account-box {
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px;
  text-align: left;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 14px;
}
.account-box .row { display: flex; justify-content: space-between; padding: 6px 0; }
.account-box .row span:first-child { color: var(--slate); }

/* =========================================================
   Franja de confianza (hero -> catalogo)
   ========================================================= */
.trust-strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--ink-soft);
  padding: 26px 0;
}
.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.trust-item { display: flex; align-items: center; gap: 14px; }
.trust-ic {
  width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 22px -8px rgba(122,47,184,.55), inset 0 1px 0 rgba(255,255,255,.25);
}
.trust-ic svg { width: 21px; height: 21px; color: #fff; }
.trust-ic.t1 { background: linear-gradient(150deg, var(--magenta), var(--violet)); }
.trust-ic.t2 { background: linear-gradient(150deg, var(--violet), #5a1f8c); }
.trust-ic.t3 { background: linear-gradient(150deg, var(--violet), var(--magenta)); }
.trust-ic.t4 { background: linear-gradient(150deg, #2fbf82, #1a6e4a); }
.trust-item strong { display: block; font-size: 13.5px; }
.trust-item span { font-size: 11.5px; color: var(--slate); }

/* =========================================================
   Preguntas frecuentes
   ========================================================= */
.faq-section { padding: 70px 0 90px; }
.faq-list { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: var(--ink-soft); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 18px 22px;
  font-weight: 700; font-size: 14.5px; position: relative; padding-right: 40px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  color: var(--slate); font-size: 20px; font-weight: 400; transition: transform .2s;
}
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); color: var(--magenta); }
.faq-item .faq-a { padding: 0 22px 20px; color: var(--slate); font-size: 13.5px; line-height: 1.65; margin: 0; }

/* =========================================================
   Stepper (checkout / entrega)
   ========================================================= */
.stepper { display: flex; align-items: center; justify-content: center; gap: 0; margin: 40px 0; flex-wrap: wrap; }
.step { display: flex; flex-direction: column; align-items: center; gap: 9px; }
.step .dot {
  width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--ink-elev); border: 2px solid var(--line); flex-shrink: 0;
}
.step .dot svg { display: block; width: 18px; height: 18px; color: var(--slate); }
.step .lbl { font-size: 12px; font-weight: 600; color: var(--slate); white-space: nowrap; }
.step.done .dot { background: var(--gradient-signature); border-color: transparent; box-shadow: 0 8px 20px -8px rgba(122,47,184,.6); }
.step.done .dot svg { color: #fff; }
.step.done .lbl { color: var(--paper); }
.step.active .dot { background: var(--ink); border-color: var(--magenta); box-shadow: 0 0 0 5px rgba(216,64,159,.15); }
.step.active .dot svg { color: var(--magenta); }
.step.active .lbl { color: var(--paper); font-weight: 700; }
.step-line { width: 60px; height: 2px; background: var(--line); margin: 0 8px; margin-bottom: 27px; }
.step-line.done { background: var(--gradient-signature); }

/* =========================================================
   Checkbox de aceptacion de Terminos y Condiciones (checkout)
   ========================================================= */
.tc-accept { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 18px; cursor: pointer; user-select: none; }
.tc-accept input { width: 18px; height: 18px; margin-top: 1px; flex-shrink: 0; accent-color: var(--magenta); cursor: pointer; }
.tc-accept span { font-size: 13px; color: var(--slate); line-height: 1.5; }
.tc-accept a { color: var(--paper); text-decoration: underline; font-weight: 600; }
.tc-accept.tc-accept-error span { color: #e6716d; }
.btn-disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.3); }
@keyframes tcShake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
.tc-shake { animation: tcShake .5s; }
@media (prefers-reduced-motion: reduce) { .tc-shake { animation: none; } }

/* =========================================================
   Animacion de aparicion al hacer scroll
   ========================================================= */
/* Estado inicial: solo se aplica cuando el JS de footer.php agrega esta
   clase (progressive enhancement) - si JS falla o esta desactivado, el
   contenido nunca queda oculto, simplemente no anima. */
.reveal-init { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal-in { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal-init, .reveal-in { opacity: 1; transform: none; transition: none; }
}

/* =========================================================
   Icono de entrega exitosa (pago-exitoso.php)
   ========================================================= */
.delivery-icon { position: relative; width: 84px; height: 84px; margin: 0 auto 20px; }
.delivery-icon svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.delivery-icon .ring circle {
  fill: none; stroke: var(--mint); stroke-width: 2;
  transform-origin: 40px 40px; animation: ringOut 1.1s ease-out .3s both;
}
.delivery-icon .check { animation: popIn .45s cubic-bezier(.2,1.4,.4,1) both; }
.delivery-icon .check .circle { fill: var(--mint); }
.delivery-icon .check .tick {
  fill: none; stroke: var(--ink); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 48; stroke-dashoffset: 48; animation: drawCheck .4s ease-out .4s forwards;
}
@keyframes popIn { 0% { transform: scale(0); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes ringOut { 0% { opacity: .7; transform: scale(1); } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes drawCheck { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .delivery-icon .ring circle, .delivery-icon .check, .delivery-icon .check .tick {
    animation: none !important; stroke-dashoffset: 0 !important; opacity: 1 !important; transform: none !important;
  }
}

/* =========================================================
   Carrito lateral (drawer) - incluido en includes/footer.php,
   presente en todas las paginas
   ========================================================= */
.cart-overlay {
  position: fixed; inset: 0; background: rgba(8,6,11,.6); backdrop-filter: blur(2px);
  z-index: 48; opacity: 0; pointer-events: none; transition: opacity .25s;
}
.cart-overlay.open { opacity: 1; pointer-events: auto; }
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); z-index: 49;
  background: var(--ink-soft); border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .28s cubic-bezier(.4,0,.2,1);
  box-shadow: -30px 0 60px -20px rgba(0,0,0,.5);
}
.cart-drawer.open { transform: translateX(0); }
.cart-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 22px 18px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.cart-drawer-head h3 { margin: 0; font-size: 17px; font-weight: 800; }
.cart-drawer-close { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: none; color: var(--slate); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.cart-drawer-close:hover { color: var(--paper); border-color: var(--magenta); }
.cart-drawer-close svg { width: 16px; height: 16px; }
.cart-drawer-lines { flex: 1; overflow-y: auto; padding: 6px 22px; }
.cart-drawer-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart-drawer-line:last-child { border-bottom: none; }
.cdl-info { flex: 1; min-width: 0; }
.cdl-info h4 { font-size: 13.5px; font-weight: 700; margin: 5px 0 3px; }
.cdl-unit { font-size: 11.5px; color: var(--slate); font-family: var(--font-mono); }
.cdl-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.cdl-actions select {
  background: var(--ink); border: 1px solid var(--line); color: var(--paper);
  border-radius: 7px; padding: 5px 6px; font-size: 12.5px;
}
.cdl-subtotal { font-family: var(--font-mono); font-weight: 700; font-size: 13px; min-width: 56px; text-align: right; }
.cdl-remove { background: none; border: none; color: var(--slate); cursor: pointer; padding: 4px; }
.cdl-remove:hover { color: var(--magenta); }
.cdl-remove svg { width: 15px; height: 15px; display: block; }
.cart-drawer-foot { padding: 18px 22px 24px; border-top: 1px solid var(--line); flex-shrink: 0; }
.cart-drawer-foot .summary-line.total { padding-top: 0; padding-bottom: 16px; }
.cart-drawer-fulllink { display: block; text-align: center; margin-top: 12px; font-size: 12.5px; color: var(--slate); }
.cart-drawer-fulllink:hover { color: var(--mint); }
.cart-drawer-empty { text-align: center; padding: 60px 20px; color: var(--slate); flex: 1; }
.cart-drawer-empty svg { width: 40px; height: 40px; margin-bottom: 14px; opacity: .5; }
.cart-drawer-empty .btn { margin-top: 14px; }

/* =========================================================
   Terminos y Condiciones (terminos.php)
   ========================================================= */
.tc-section { padding: 60px 0 100px; }
.tc-warning {
  max-width: 760px; margin: 0 auto 44px; background: rgba(216,64,159,.08); border: 1px solid rgba(216,64,159,.3);
  border-radius: 14px; padding: 20px 24px; display: flex; gap: 14px;
}
.tc-warning svg { width: 22px; height: 22px; color: var(--magenta); flex-shrink: 0; margin-top: 2px; }
.tc-warning strong { display: block; color: var(--paper); font-size: 14px; margin-bottom: 4px; }
.tc-warning span { color: var(--slate); font-size: 13px; line-height: 1.6; }
.tc-doc { max-width: 760px; margin: 0 auto; }
.tc-doc > h1 { font-size: 26px; font-weight: 800; text-align: center; margin: 0 0 6px; }
.tc-doc > .tc-updated { text-align: center; color: var(--slate); font-size: 12.5px; margin: 0 0 50px; }
.tc-h { font-size: 15.5px; font-weight: 700; color: var(--paper); margin: 38px 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.tc-doc > .tc-h:first-of-type { margin-top: 0; }
.tc-p { color: var(--slate); font-size: 13.5px; line-height: 1.7; margin: 0 0 12px; }
.tc-ul { margin: 0 0 12px; padding-left: 20px; color: var(--slate); font-size: 13.5px; line-height: 1.75; }
.tc-ul li { margin-bottom: 4px; }
.tc-sub { color: var(--paper); font-weight: 700; font-size: 13px; margin: 14px 0 6px; }
.tc-placeholder { background: rgba(230,168,20,.16); color: #e6c94d; padding: 1px 7px; border-radius: 5px; font-family: var(--font-mono); font-size: .92em; font-weight: 600; }
.tc-quote { background: var(--ink); border-left: 3px solid var(--violet); border-radius: 0 10px 10px 0; padding: 16px 20px; margin: 14px 0; color: var(--slate); font-size: 13.5px; line-height: 1.7; font-style: italic; }

/* =========================================================
   Footer + WhatsApp flotante
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--ink-soft);
  padding: 48px 0 28px;
  color: var(--slate);
  font-size: 13px;
}
.footer-grid { display: flex; flex-direction: column; gap: 18px; }
.footer-brand-mark { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.footer-brand-mark img { height: 30px; width: 30px; object-fit: contain; }
.footer-brand-mark span { font-family: var(--font-display); font-weight: 800; font-size: 16px; color: var(--paper); }
.footer-brand p { max-width: 46ch; margin: 0 0 14px; font-size: 13px; line-height: 1.6; }
.footer-terms-link { color: var(--slate); font-size: 12px; text-decoration: underline; }
.footer-terms-link:hover { color: var(--mint); }

.wa-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 9px;
  background: #25D366;
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
  padding: 13px 20px 13px 14px;
  border-radius: 100px;
  box-shadow: 0 10px 30px rgba(37,211,102,.45);
  animation: wa-pulse 2.4s infinite;
}
.wa-float svg { width: 22px; height: 22px; fill: #fff; flex-shrink: 0; }
@keyframes wa-pulse {
  0% { box-shadow: 0 0 0 0 rgba(37,211,102,.55); }
  70% { box-shadow: 0 0 0 16px rgba(37,211,102,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}
@media (prefers-reduced-motion: reduce) {
  .wa-float { animation: none; }
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .checkout-wrap { grid-template-columns: 1fr; }
  .nav-cats { display: none; }
  .trust-grid { grid-template-columns: 1fr 1fr; }
  .step .lbl { display: none; }
  .step-line { width: 30px; }
  .cart-drawer { width: 100vw; }
}

@media (max-width: 520px) {
  .trust-grid { grid-template-columns: 1fr; }
  .wa-float span { display: none; }
  .wa-float { padding: 14px; }
  .field-row { flex-direction: column; gap: 0; }
}
