/* ==========================================================================
   Alex vxntas — Sistema de diseño base
   Tokens, reset, tipografía, iconos, botones, cabecera, pie y avisos.
   Compartido por la tienda, la cuenta y el panel de administración.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Superficies */
  --ink-950: #04060a;
  --ink-900: #070a10;
  --ink-850: #0b0f16;
  --ink-800: #101620;
  --ink-750: #151c28;
  --ink-700: #1b2430;

  /* Líneas */
  --line-soft: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  /* Texto */
  --text: #f4f6f9;
  --text-soft: #b9c3cf;
  --text-muted: #8b96a5;
  --text-dim: #788391;

  /* Marca */
  --brand: #e93b2d;
  --brand-light: #ff6558;
  --brand-dark: #b31f1a;
  --brand-deep: #7a100f;

  /* Confianza */
  --lime: #c8ff4d;
  --lime-dark: #8fbe22;

  /* Estado */
  --warn: #f0a500;
  --danger: #ff7a72;

  /* Radios */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* Sombras */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.36);
  --shadow-lg: 0 24px 52px rgba(0, 0, 0, 0.46);
  --glow-brand: 0 8px 24px rgba(233, 59, 45, 0.26);

  /* Espaciado */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 22px;
  --s-6: 30px;
  --s-7: 42px;
  --s-8: 60px;
  --s-9: 84px;

  /* Layout */
  --shell: 1220px;
  --gutter: 24px;
  --header-h: 72px;

  /* Tipografía */
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', 'DM Sans', system-ui, sans-serif;

  /* Movimiento */
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --dur: 180ms;
}

/* ==========================================================================
   Reset
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--ink-950);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.reveal {
  opacity: 0;
  transform: translateY(24px) scale(0.985);
  transition:
    opacity 700ms cubic-bezier(0.2, 0.7, 0.3, 1),
    transform 700ms cubic-bezier(0.2, 0.7, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@keyframes ambientDrift {
  0% {
    transform: scale(1) translate3d(0, 0, 0);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.08) translate3d(1.2%, -1.4%, 0);
    opacity: 1;
  }
  100% {
    transform: scale(1.14) translate3d(-1.6%, 1.8%, 0);
    opacity: 0.96;
  }
}

@keyframes gridPulse {
  0%,
  100% {
    opacity: 0.72;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.02);
  }
}

/* Textura de fondo controlada: resplandor de marca + retícula técnica.
   Sustituye a las franjas diagonales que se dibujaban sobre toda la página. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(920px 520px at 6% -6%, rgba(233, 59, 45, 0.22), transparent 68%),
    radial-gradient(760px 440px at 90% 12%, rgba(255, 118, 92, 0.12), transparent 64%),
    radial-gradient(1100px 640px at 50% 118%, rgba(38, 74, 132, 0.18), transparent 72%),
    linear-gradient(180deg, #05070b 0%, #04060a 100%);
  animation: ambientDrift 18s ease-in-out infinite alternate;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.021) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.021) 1px, transparent 1px);
  background-size: 66px 66px;
  -webkit-mask-image: radial-gradient(115% 72% at 50% 0%, #000 8%, transparent 76%);
  mask-image: radial-gradient(115% 72% at 50% 0%, #000 8%, transparent 76%);
  animation: gridPulse 18s ease-in-out infinite;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
}

::selection {
  background: rgba(233, 59, 45, 0.34);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--brand-light);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* ==========================================================================
   Tipografía
   ========================================================================== */

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.35rem);
}

h2 {
  font-size: clamp(1.5rem, 2.5vw, 2.1rem);
}

h3 {
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

.lede {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Etiqueta superior de sección */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 var(--s-4);
  color: var(--brand-light);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: '';
  width: 22px;
  height: 2px;
  flex: 0 0 auto;
  background: var(--brand);
}

.eyebrow b {
  margin-left: auto;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.shell {
  width: min(var(--shell), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

.page {
  display: block;
  padding-bottom: var(--s-8);
}

/* ==========================================================================
   Iconos — conjunto SVG coherente (trazo 1.75, viewBox 24)
   ========================================================================== */

.icon {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-solid {
  fill: currentColor;
  stroke: none;
}

/* ==========================================================================
   Botones
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
  transition:
    transform var(--dur) var(--ease),
    background var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    filter var(--dur) var(--ease);
}

.btn .icon {
  font-size: 1.15rem;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-light), var(--brand-dark));
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: var(--glow-brand);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.btn-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--line-strong);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.32);
}

.btn-quiet {
  color: var(--text-soft);
  background: transparent;
  border-color: var(--line);
}

.btn-quiet:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.7rem;
}

.btn:disabled {
  opacity: 0.5;
  transform: none;
  filter: none;
}

/* ==========================================================================
   Avisos flotantes
   ========================================================================== */

.toast {
  position: fixed;
  left: var(--gutter);
  bottom: var(--s-5);
  z-index: 80;
  max-width: min(370px, calc(100% - var(--gutter) * 2));
  padding: 14px 18px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--brand);
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, rgba(22, 28, 38, 0.98), rgba(11, 15, 21, 0.98));
  box-shadow: var(--shadow-lg);
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   Preferencias de movimiento
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
/* ==========================================================================
   Cabecera
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 9, 14, 0.82);
  backdrop-filter: blur(16px) saturate(1.25);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  min-height: var(--header-h);
}

.header-panel {
  display: contents;
}

/* Marca ------------------------------------------------------------------ */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  text-decoration: none;
}

.brand-badge {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(233, 59, 45, 0.4);
  border-radius: var(--r-md);
  background:
    radial-gradient(115% 115% at 32% 18%, rgba(233, 59, 45, 0.38), rgba(7, 10, 15, 0.94) 64%),
    #080b11;
  box-shadow: 0 0 22px rgba(233, 59, 45, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.brand-badge img {
  width: 100%;
  height: 100%;
  padding: 3px;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1;
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.brand-text small {
  color: var(--text-dim);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

/* Navegación ------------------------------------------------------------- */

.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
  margin-left: var(--s-2);
}

.main-nav a {
  position: relative;
  padding: 9px 12px;
  border-radius: var(--r-xs);
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

/* Indicador de servicio -------------------------------------------------- */

.header-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px rgba(200, 255, 77, 0.75);
  animation: status-pulse 2.4s var(--ease) infinite;
}

@keyframes status-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.78);
  }
}

/* Acciones de cuenta ----------------------------------------------------- */

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

/* Menú móvil ------------------------------------------------------------- */

.menu-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.menu-button {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.03);
}

.menu-button span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

/* ==========================================================================
   Pie de página
   ========================================================================== */

.site-footer {
  margin-top: var(--s-8);
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(6, 9, 14, 0), rgba(6, 9, 14, 0.72));
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--s-6);
  align-items: start;
  padding: var(--s-7) 0 var(--s-6);
}

.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  max-width: 400px;
}

.footer-brand .brand-badge {
  width: 42px;
  height: 42px;
}

.footer-brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.footer-brand p {
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.footer-col {
  display: grid;
  gap: 9px;
  align-content: start;
}

.footer-col h4 {
  margin-bottom: 3px;
  color: var(--text);
  font-size: 0.7rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.footer-col a {
  width: fit-content;
  color: var(--text-muted);
  font-size: 0.84rem;
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

.footer-col a:hover,
.footer-col a:focus-visible {
  color: var(--text);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  /* Reserva espacio para que el botón flotante de soporte no tape el texto. */
  padding: var(--s-4) 0 84px;
  border-top: 1px solid var(--line-soft);
  color: var(--text-dim);
  font-size: 0.76rem;
}

.footer-bottom .icon {
  font-size: 1rem;
  color: var(--lime);
}

.footer-bottom span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   Botón flotante de soporte
   ========================================================================== */

.whatsapp-support {
  position: fixed;
  right: var(--gutter);
  bottom: var(--s-5);
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 20px 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, #23c55e, #12803c);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform var(--dur) var(--ease), filter var(--dur) var(--ease);
}

.whatsapp-support:hover {
  transform: translateY(-3px);
  filter: brightness(1.06);
}

.whatsapp-support .icon {
  font-size: 1.55rem;
}

/* ==========================================================================
   Adaptación
   ========================================================================== */

@media (max-width: 1180px) {
  .header-status {
    display: none;
  }
}

@media (max-width: 1000px) {
  .brand {
    order: 1;
  }

  .header-actions {
    order: 2;
    margin-left: auto;
  }

  .menu-button {
    display: flex;
    order: 3;
  }

  .header-panel {
    position: absolute;
    top: calc(var(--header-h) + 6px);
    left: var(--gutter);
    right: var(--gutter);
    z-index: 60;
    display: none;
    flex-direction: column;
    gap: var(--s-4);
    padding: var(--s-4);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-md);
    background: rgba(9, 12, 18, 0.985);
    box-shadow: var(--shadow-lg);
  }

  .menu-toggle:checked ~ .header-panel {
    display: flex;
  }

  .main-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 0;
  }

  .main-nav a {
    padding: 13px 14px;
    border-radius: var(--r-sm);
    font-size: 0.82rem;
  }

  .header-status {
    display: inline-flex;
    align-self: flex-start;
  }

  .header-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin: 0;
  }

  .menu-toggle:checked ~ .menu-button span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .menu-toggle:checked ~ .menu-button span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle:checked ~ .menu-button span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

@media (max-width: 860px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
    max-width: none;
  }
}

@media (max-width: 560px) {
  :root {
    --gutter: 18px;
    --header-h: 66px;
  }

  .brand-text small {
    display: none;
  }

  .brand-badge {
    width: 42px;
    height: 42px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: var(--s-5);
    padding-top: var(--s-6);
  }

  .whatsapp-support {
    padding: 0;
    width: 54px;
    justify-content: center;
  }

  .whatsapp-label {
    display: none;
  }

  .toast {
    right: var(--gutter);
    bottom: 88px;
    max-width: none;
  }
}
