:root {
  --bg:        #fffaf3;
  --card:      #ffffff;
  --text:      #241a10;
  --muted:     #8a7660;
  --accent:    #ff7a1a;
  --accent2:   #ffb020;
  --btn:       #e35d00;
  --border:    #f1e4d3;
  --chip-bg:   #fdf0e4;
  --danger:    #d1373d;
  --ok:        #0ea968;
}

* { box-sizing: border-box; }

/* [hidden] debe ganarle siempre a display:flex de las clases de abajo
   (misma especificidad, y el orden del archivo hace que si no, las clases
   .checkout-state / .page / etc ganen y el elemento quede visible aunque
   tenga el atributo hidden puesto por JS). */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2 { font-family: 'Space Grotesk', sans-serif; margin: 0 0 4px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

a { color: var(--btn); }

/* ─── Botones ─────────────────────────────────────────────── */

.btn-primary, .btn-ghost, .btn-guest {
  border-radius: 11px;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: filter .15s ease, background .15s ease, transform .1s ease;
  font-family: 'Space Grotesk', sans-serif;
}
.btn-primary { background: var(--btn); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: .6; cursor: default; filter: none; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: rgba(0,0,0,0.03); }
.btn-guest { background: var(--ok); color: #fff; margin-top: 10px; }
.btn-guest:hover { filter: brightness(1.08); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 9px; }

/* ─── Gate de login/registro ─────────────────────────────────── */

.view-auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 24px;
}
.auth-blob {
  position: absolute;
  top: -120px; right: -120px;
  width: 360px; height: 360px;
  border-radius: 50%;
  background: var(--accent2);
  opacity: .16;
}
.auth-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  animation: riseIn .5s ease both;
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-center { flex-direction: column; margin-bottom: 28px; }
.brand-logo { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; box-shadow: 0 10px 28px -12px rgba(255,122,26,.35); }
.brand-logo-sm { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.brand-name { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 20px; letter-spacing: .3px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px 24px;
  box-shadow: 0 16px 40px -22px rgba(255,122,26,.28);
}

.auth-card form { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; }
.auth-card label { font-size: 11.5px; color: var(--muted); margin: 10px 0 2px; }
.auth-card input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: #fcfcfc;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.auth-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,122,26,.15); }
.auth-card button[type="submit"] { margin-top: 16px; }

.divider { display: flex; align-items: center; gap: 10px; margin: 16px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.divider span { font-size: 11px; color: var(--muted); }

.form-error { color: var(--danger); font-size: 12.5px; margin: 8px 0 0; }

/* ─── Comprar sin cuenta — pantalla de credenciales generadas ────── */

.guest-success-card { text-align: center; }
.guest-success-icon {
  font-size: 40px; width: 72px; height: 72px; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--chip-bg); border-radius: 50%;
}
.guest-creds-box {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 16px; padding: 18px 20px; margin: 18px 0;
  display: flex; flex-direction: column; gap: 12px;
}
.guest-creds-row { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.guest-creds-label { font-size: 11px; color: rgba(255,255,255,.85); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.guest-creds-value { font-family: 'Space Grotesk', sans-serif; font-size: 20px; font-weight: 700; color: #fff; letter-spacing: .5px; }

/* ─── App (post-login) ───────────────────────────────────────── */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.topnav { display: flex; align-items: center; gap: 6px; }
.nav-btn {
  border: none; background: transparent; color: var(--muted);
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 13.5px;
  padding: 8px 14px; border-radius: 9px; cursor: pointer;
}
.nav-btn:hover { background: var(--chip-bg); color: var(--text); }
.nav-btn.active { background: var(--accent); color: #fff; }
.nav-btn-ghost { color: var(--muted); }
.nav-support-btn {
  display: inline-flex; align-items: center;
  background: #25D366; color: #fff; text-decoration: none;
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 13.5px;
  padding: 8px 14px; border-radius: 9px; margin-left: 2px;
}
.nav-support-btn:hover { filter: brightness(1.05); }

.content { max-width: 980px; margin: 0 auto; padding: 28px 20px 60px; }
.page { animation: fadeIn .35s ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ─── Catálogo ────────────────────────────────────────────────── */

.section-chip {
  display: inline-block;
  background: var(--chip-bg);
  color: var(--accent);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: .4px;
  padding: 7px 16px;
  border-radius: 999px;
  margin: 26px 0 14px;
}
.section-chip:first-child { margin-top: 0; }
.section-chip-exclusive {
  background: linear-gradient(135deg, #ffd76a, #e35d00);
  color: #fff;
}
.section-chip-combos {
  background: linear-gradient(135deg, #7b3fe4, #e35d00);
  color: #fff;
  font-size: 14px;
  padding: 9px 20px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

/* Anuales — centrada, no estirada a lo ancho, para que se sienta */
/* como una vitrina aparte y no una columna más del grid normal.  */
.product-grid-exclusive {
  grid-template-columns: repeat(auto-fit, minmax(220px, 260px));
  justify-content: center;
}
.product-card-exclusive {
  border: 1px solid #f0c86a;
  box-shadow: 0 10px 26px -16px rgba(227,93,0,.45);
}
.badge-exclusive {
  background: linear-gradient(135deg, #ffd76a, #e35d00); color: #fff;
  font-size: 9.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; letter-spacing: .3px;
}

/* Sin stock — se mantiene visible (no desaparece del catálogo) pero */
/* apagada, para que quede claro que no se puede comprar ahora mismo. */
.product-card-outofstock { opacity: .55; cursor: default; }
.product-card-outofstock:hover { transform: none; box-shadow: none; }
.product-price-banner-off { background: var(--muted); }
.product-price-banner-off .product-price { font-size: 13px; }

.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  animation: cardIn .4s ease forwards;
  transition: transform .15s ease, box-shadow .15s ease;
  cursor: pointer;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -18px rgba(255,122,26,.35); }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.product-img-wrap { width: 100%; aspect-ratio: 16/10; background: var(--chip-bg); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.product-img-fallback { font-family: 'Space Grotesk', sans-serif; font-weight: 700; color: var(--accent); font-size: 22px; }

.product-body { padding: 14px 14px 10px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-title-row { display: flex; align-items: center; justify-content: center; text-align: center; gap: 6px; flex-wrap: wrap; }
.product-title { font-weight: 700; font-size: 14.5px; }
.badge-annual {
  background: var(--accent); color: #fff; font-size: 9.5px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px; letter-spacing: .3px;
}
.product-price-banner {
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  padding: 6px 14px;
}
.product-price-banner .product-price { font-size: 14px; }
.product-price { font-family: 'Space Grotesk', sans-serif; font-weight: 700; color: #fff; font-size: 17px; }

/* ─── Modal de detalle de producto ───────────────────────────── */

.detail-img-wrap {
  width: 100%; aspect-ratio: 16/10; border-radius: 14px; overflow: hidden;
  background: var(--chip-bg); display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.detail-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.detail-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-title-row h2 { font-size: 19px; }
#detail-desc { font-size: 13.5px; margin: 8px 0 0; }
.detail-canva-email { margin-top: 14px; text-align: left; }
.detail-canva-email label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.detail-canva-email input {
  width: 100%; padding: 11px 13px; border-radius: 11px;
  border: 1px solid var(--border); background: #fcfcfc; color: var(--text);
  font-size: 14px; font-family: inherit; box-sizing: border-box;
}
.detail-canva-email input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,122,26,.15); }

.detail-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; }
.detail-footer .product-price { font-size: 19px; color: var(--accent); }

.detail-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.detail-list li { font-size: 13.5px; color: var(--text); }

/* ─── Soporte dentro del checkout ─────────────────────────────── */

.yape-info {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--chip-bg); border-radius: 12px; padding: 12px 14px; margin: 4px 0;
}
.yape-info-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.yape-info-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.yape-info-value { font-size: 13.5px; color: var(--text); font-weight: 700; flex: 1; text-align: right; }

.yape-copy-btn {
  border: 1px solid var(--border); background: #fff; border-radius: 8px;
  padding: 4px 8px; font-size: 13px; line-height: 1; cursor: pointer; flex-shrink: 0;
}
.yape-copy-btn:hover { background: var(--chip-bg); }
.yape-copy-btn-amount { margin-left: 8px; }

.checkout-support-row {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); width: 100%;
}
.checkout-wrong-amount { font-size: 12.5px; color: var(--danger); font-weight: 600; text-align: center; }
.checkout-wa-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: #25D366; color: #fff; font-size: 12.5px; font-weight: 700;
  padding: 8px 16px; border-radius: 999px; text-decoration: none;
}
.checkout-wa-btn:hover { filter: brightness(1.05); }

/* ─── Mis cuentas ─────────────────────────────────────────────── */

.dashboard-request-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 20px;
  padding: 32px 24px; margin-top: 18px; max-width: 380px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
}
.dashboard-request-icon {
  font-size: 32px; width: 64px; height: 64px; margin-bottom: 4px;
  display: flex; align-items: center; justify-content: center;
  background: var(--chip-bg); border-radius: 50%;
}

/* ─── Modal de checkout ───────────────────────────────────────── */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(36,26,16,.45);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100;
  animation: fadeIn .2s ease both;
}
.modal-card {
  background: var(--card); border-radius: 20px; padding: 28px 24px;
  width: 100%; max-width: 380px; position: relative;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.35);
  animation: riseIn .25s ease both;
}
.modal-card--wide { max-width: 520px; max-height: 88vh; overflow-y: auto; text-align: left; }
.modal-close {
  position: absolute; top: 14px; right: 14px; border: none; background: transparent;
  color: var(--muted); font-size: 16px; cursor: pointer; padding: 4px;
}
.checkout-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.checkout-amount-row { display: flex; align-items: center; justify-content: center; margin: 6px 0; }
.checkout-amount { font-family: 'Space Grotesk', sans-serif; font-size: 30px; font-weight: 700; color: var(--accent); }
.checkout-qr { width: 190px; height: 190px; object-fit: contain; border: 1px solid var(--border); border-radius: 14px; padding: 8px; margin: 4px 0; }
.checkout-waiting { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--muted); font-size: 13px; }
.success-check {
  width: 56px; height: 56px; border-radius: 50%; background: var(--ok); color: #fff;
  font-size: 28px; display: flex; align-items: center; justify-content: center; margin-bottom: 6px;
}

.checkout-success-accounts { width: 100%; display: flex; flex-direction: column; gap: 10px; margin: 6px 0 4px; }
.success-account-card {
  background: var(--chip-bg); border-radius: 14px; padding: 14px 16px;
  text-align: left; display: flex; flex-direction: column; gap: 4px;
}
.success-account-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.success-account-platform { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 14px; }
.success-account-row { font-size: 13px; color: var(--text); word-break: break-all; }

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
.spinner-sm { width: 13px; height: 13px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 480px) {
  .topbar { padding: 12px 14px; }
  .nav-btn { font-size: 12px; padding: 7px 10px; }
  .brand-name { font-size: 16px; }
}

/* ─── Renovaciones (público, sin login) ──────────────────────── */

.renewal-accounts-list { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; text-align: left; }
.renewal-account-card {
  background: var(--chip-bg); border-radius: 14px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.renewal-account-card-due { border: 1.5px solid var(--accent); }
.renewal-account-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.renewal-account-platform { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 14px; }
.renewal-account-status { font-size: 12px; color: var(--muted); }
.renewal-account-card-due .renewal-account-status { color: var(--btn); font-weight: 600; }
.renewal-account-email { font-size: 13px; color: var(--text); word-break: break-all; }
.renewal-account-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.renewal-account-price { font-family: 'Space Grotesk', sans-serif; font-weight: 700; color: var(--btn); }

.dashboard-subtitle { font-size: 15px; margin: 18px 0 8px; color: var(--muted); }
.dashboard-subtitle:first-of-type { margin-top: 0; }

/* ─── Códigos ─────────────────────────────────────────────────── */

.codes-value {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 22px;
  letter-spacing: 2px; color: var(--btn); background: rgba(0,0,0,.04);
  border-radius: 10px; padding: 6px 10px; text-align: center;
}
.codes-meta { font-size: 12px; color: var(--muted); }
.codes-remaining { font-size: 12px; color: var(--muted); }

/* ─── Arma tu combo (carrito interactivo) ────────────────────── */

.build-combo-prompt {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center; margin: 20px 0 8px; padding: 22px 18px;
  background: var(--chip-bg); border-radius: 16px; border: 1.5px dashed var(--accent);
}
.build-combo-prompt-text { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 16px; margin: 0; }

.build-combo-catalog {
  display: flex; flex-direction: column; gap: 8px; max-height: 240px;
  overflow-y: auto; margin: 12px 0 18px; padding-right: 2px;
}
.build-combo-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; background: var(--chip-bg); border-radius: 12px;
}
.build-combo-item-name { font-weight: 600; font-size: 13.5px; flex: 1; }
.build-combo-item-price {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; color: var(--btn);
  font-size: 13px; white-space: nowrap;
}

.build-combo-cart { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 4px; }
.build-combo-cart h3 { font-size: 15px; margin: 0 0 8px; }
.build-combo-cart-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.build-combo-cart-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.build-combo-remove-btn {
  border: none; background: transparent; color: var(--danger); cursor: pointer;
  font-size: 14px; padding: 2px 6px; line-height: 1;
}
.build-combo-summary { display: flex; align-items: center; justify-content: space-between; margin: 10px 0; gap: 10px; }
.build-combo-discount-label { font-size: 12.5px; color: var(--muted); }
.build-combo-total { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 18px; color: var(--btn); }
