:root {
  --bg: #060913;
  --card: #0e1424;
  --border: rgba(255, 255, 255, 0.09);
  --text: #f8fafc;
  --muted: #94a3b8;
  --gold: #f59e0b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.4;
}

/* Fondo aurora en movimiento */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 12%, rgba(56, 189, 248, 0.18) 0%, transparent 45%),
    radial-gradient(circle at 82% 20%, rgba(168, 85, 247, 0.17) 0%, transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(245, 158, 11, 0.11) 0%, transparent 50%),
    linear-gradient(180deg, #060913 0%, #0a1122 50%, #060913 100%);
  animation: auroraShift 12s ease-in-out infinite alternate;
}

@keyframes auroraShift {
  0% { transform: scale(1) translateY(0); }
  100% { transform: scale(1.06) translateY(-12px); }
}

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* Partículas de destello al tocar */
.spark-dot {
  position: fixed;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  animation: sparkFly 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes sparkFly {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0.2);
  }
}

/* Toast flotante */
.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translate(-50%, -120px);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1100;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
}

.toast.show {
  transform: translate(-50%, 0);
}

.toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
}

/* Hero */
.hero {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 16px 14px;
  text-align: center;
}

.badge-top {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: #e2e8f0;
  margin-bottom: 10px;
}

.brand-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #ffffff 20%, #38bdf8 50%, #a855f7 80%, #ffffff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine 3.8s linear infinite;
}

@keyframes shine {
  to { background-position: 200% center; }
}

.hero-sub {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 6px auto 14px;
  max-width: 460px;
}

.legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 16px;
}

.search-wrap {
  position: relative;
  max-width: 520px;
  margin: 0 auto 18px;
}

.search-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.search-wrap input {
  width: 100%;
  padding: 13px 16px 13px 42px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(14, 20, 36, 0.92);
  color: #fff;
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-wrap input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

/* Cuadrícula de categorías 3 arriba y 3 abajo */
.tabs-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  max-width: 560px;
  margin: 0 auto;
  padding: 6px;
  background: rgba(14, 20, 36, 0.88);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(12px);
}

.tab-glider {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.28), rgba(168, 85, 247, 0.28));
  border: 1px solid rgba(56, 189, 248, 0.55);
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.22);
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), width 0.26s ease, height 0.26s ease;
  pointer-events: none;
  z-index: 1;
}

.tab-btn {
  position: relative;
  z-index: 2;
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 10px 6px;
  border-radius: 12px;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.15s ease;
  white-space: nowrap;
}

.tab-btn:active {
  transform: scale(0.95);
}

.tab-btn.active {
  color: #ffffff;
}

/* Contenedor principal */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 14px 54px;
}

.catalog-section {
  margin-top: 26px;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.catalog-section.switching {
  opacity: 0;
  transform: translateY(8px);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.section-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ec-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.16);
  color: #fde047;
  border: 1px solid rgba(250, 204, 21, 0.35);
}

.count-pill, .vip-pill, .ff-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #cbd5e1;
  white-space: nowrap;
}

.vip-pill {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.ff-pill {
  background: rgba(14, 165, 233, 0.16);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.35);
}

/* Medios de pago Free Fire */
.payment-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  background: rgba(14, 20, 36, 0.85);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.pay-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #cbd5e1;
}

.pay-chip {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
}

.pay-chip.pichincha {
  background: rgba(250, 204, 21, 0.16);
  color: #fde047;
  border: 1px solid rgba(250, 204, 21, 0.35);
}

.pay-chip.guayaquil {
  background: rgba(236, 72, 153, 0.16);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.35);
}

.pay-chip.binance {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

/* Cuadrícula estricta de 2 columnas con centrado automático para impares */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* Tarjeta impar de una misma marca (ej. MAX 3ra opción, CapCut, 5to paquete FF) baja centrada en medio */
.card.centered-odd {
  grid-column: 1 / -1;
  width: calc(50% - 6px);
  justify-self: center;
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease, box-shadow 0.2s ease;
  animation: cardPop 0.28s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

@keyframes cardPop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent, #38bdf8);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.55);
}

.card:active {
  transform: scale(0.96);
}

/* Letrero / Banner superior */
.card-banner {
  position: relative;
  height: 74px;
  background: linear-gradient(135deg, var(--accent, #38bdf8) 0%, #0b0f1c 140%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.card-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.24), transparent 62%);
  pointer-events: none;
}

.card-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.banner-brand {
  position: relative;
  z-index: 2;
  font-family: 'Outfit', sans-serif;
  font-size: clamp(0.98rem, 3.4vw, 1.2rem);
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
}

.banner-sub {
  position: relative;
  z-index: 2;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.44);
  color: #f8fafc;
  padding: 2px 8px;
  border-radius: 999px;
  margin-top: 4px;
}

/* Contenido de la tarjeta */
.card-content {
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  flex: 1;
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-title {
  font-weight: 700;
  font-size: 0.84rem;
  color: #f1f5f9;
  line-height: 1.3;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: uppercase;
}

.tag-perfil {
  background: rgba(249, 115, 22, 0.16);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.35);
}

.tag-completa {
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.tag-panel {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.tag-zapping {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.tag-ff {
  background: rgba(14, 165, 233, 0.16);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.35);
}

.note {
  font-size: 0.68rem;
  color: var(--muted);
}

.card-price-box {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 8px;
}

.price {
  font-family: 'Outfit', sans-serif;
  font-size: 1.24rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}

.copy-hint {
  font-size: 0.64rem;
  color: #38bdf8;
  font-weight: 700;
}

/* Modal Emergente */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 14, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 390px;
  background: #0f1628;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
  transform: scale(0.86) translateY(18px);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-backdrop.open .modal-card {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 10;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.modal-banner {
  height: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--modal-accent, #38bdf8) 0%, #0b0f1c 140%);
  text-align: center;
  padding: 12px;
}

.modal-body {
  padding: 18px;
}

.modal-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.22rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.modal-unit {
  font-size: 0.84rem;
  color: var(--muted);
  margin-bottom: 14px;
}

.id-field-wrap {
  margin-bottom: 14px;
}

.id-field-wrap label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 6px;
}

.id-field-wrap input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: rgba(6, 9, 19, 0.9);
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
}

.qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 12px;
  font-size: 0.88rem;
  font-weight: 600;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.qty-controls button {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
}

.qty-controls span {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  min-width: 20px;
  text-align: center;
}

.total-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  margin-bottom: 16px;
}

.total-box strong {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  color: #38bdf8;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-copy, .btn-wa {
  padding: 12px 10px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease;
}

.btn-copy:active, .btn-wa:active {
  transform: scale(0.96);
}

.btn-copy {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.btn-wa {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  box-shadow: 0 6px 18px rgba(34, 197, 94, 0.35);
}

.footer {
  text-align: center;
  padding: 20px 16px 42px;
  color: var(--muted);
  font-size: 0.8rem;
}