/* ============================================================
   REY CLUB CARD — Design System v2.0
   Temas: claro | oscuro | rey
   Fuente: SF Pro / system-ui stack (Apple nativa)
   ============================================================ */

/* ── Google Fonts ──────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&display=swap');

/* ── TEMA CLARO (default) ──────────────────────────────────── */
:root,
[data-theme="claro"] {
  /* Superficies */
  --bg-app:        #f2f2f7;
  --bg-card:       #ffffff;
  --bg-card-2:     #f9f9fb;
  --bg-input:      #f2f2f7;
  --bg-navbar:     rgba(255,255,255,0.85);
  --bg-bottom-nav: rgba(255,255,255,0.92);

  /* Texto */
  --text-primary:   #1c1c1e;
  --text-secondary: #636366;
  --text-tertiary:  #aeaeb2;
  --text-inverse:   #ffffff;

  /* Marca */
  --accent:         #0071e3;
  --accent-hover:   #005ecb;
  --accent-active:  #004aaa;
  --accent-soft:    rgba(0,113,227,0.10);

  /* Rey Gold */
  --gold:           #d4a017;
  --gold-light:     #f5c842;
  --gold-soft:      rgba(212,160,23,0.12);

  /* Sistema */
  --success:  #34c759;
  --warning:  #ff9f0a;
  --danger:   #ff3b30;
  --info:     #5ac8fa;

  /* Bordes y sombras */
  --border:         rgba(0,0,0,0.08);
  --border-strong:  rgba(0,0,0,0.15);
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:      0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg:      0 12px 40px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-card:    0 2px 12px rgba(0,0,0,0.06);

  /* Blur */
  --blur-nav:   blur(20px) saturate(180%);

  /* Radio */
  --r-xs:   6px;
  --r-sm:   10px;
  --r-md:   14px;
  --r-lg:   20px;
  --r-xl:   28px;
  --r-full: 999px;

  /* Transición */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur:  0.22s;

  /* Bottom nav */
  --bottom-nav-h: 72px;
  --bottom-nav-icon-active: var(--accent);
  --bottom-nav-icon-inactive: var(--text-tertiary);
}

/* ── TEMA OSCURO ───────────────────────────────────────────── */
[data-theme="oscuro"] {
  --bg-app:        #000000;
  --bg-card:       #1c1c1e;
  --bg-card-2:     #2c2c2e;
  --bg-input:      #2c2c2e;
  --bg-navbar:     rgba(28,28,30,0.90);
  --bg-bottom-nav: rgba(18,18,20,0.95);

  --text-primary:   #f5f5f7;
  --text-secondary: #98989d;
  --text-tertiary:  #48484a;
  --text-inverse:   #1c1c1e;

  --accent:         #0a84ff;
  --accent-hover:   #409cff;
  --accent-active:  #6eb4ff;
  --accent-soft:    rgba(10,132,255,0.15);

  --gold:           #ffd60a;
  --gold-light:     #ffe566;
  --gold-soft:      rgba(255,214,10,0.12);

  --border:         rgba(255,255,255,0.08);
  --border-strong:  rgba(255,255,255,0.14);
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:      0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:      0 12px 40px rgba(0,0,0,0.6);
  --shadow-card:    0 2px 12px rgba(0,0,0,0.35);

  --bottom-nav-icon-active: var(--accent);
  --bottom-nav-icon-inactive: #48484a;
}

/* ── TEMA REY (dorado) ─────────────────────────────────────── */
[data-theme="rey"] {
  --bg-app:        #0d0a00;
  --bg-card:       #1a1500;
  --bg-card-2:     #241d00;
  --bg-input:      #241d00;
  --bg-navbar:     rgba(13,10,0,0.92);
  --bg-bottom-nav: rgba(13,10,0,0.96);

  --text-primary:   #fff9e6;
  --text-secondary: #c9a84c;
  --text-tertiary:  #6b5a20;
  --text-inverse:   #0d0a00;

  --accent:         #d4a017;
  --accent-hover:   #f5c842;
  --accent-active:  #ffd860;
  --accent-soft:    rgba(212,160,23,0.18);

  --gold:           #d4a017;
  --gold-light:     #f5c842;
  --gold-soft:      rgba(212,160,23,0.18);

  --border:         rgba(212,160,23,0.15);
  --border-strong:  rgba(212,160,23,0.30);
  --shadow-sm:      0 1px 4px rgba(0,0,0,0.5);
  --shadow-md:      0 4px 20px rgba(0,0,0,0.6), 0 0 0 1px rgba(212,160,23,0.08);
  --shadow-lg:      0 12px 48px rgba(0,0,0,0.7), 0 0 0 1px rgba(212,160,23,0.10);
  --shadow-card:    0 2px 16px rgba(0,0,0,0.5);

  --bottom-nav-icon-active: var(--gold-light);
  --bottom-nav-icon-inactive: #4a3d10;
}

/* ============================================================
   BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  padding-top: 60px;         /* espacio navbar top */
  padding-bottom: var(--bottom-nav-h); /* espacio bottom nav */
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

/* ============================================================
   NAVBAR TOP
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1050;
  height: 60px;
  background: var(--bg-navbar) !important;
  backdrop-filter: var(--blur-nav);
  -webkit-backdrop-filter: var(--blur-nav);
  border-bottom: 1px solid var(--border);
  box-shadow: none !important;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background var(--dur) var(--ease);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary) !important;
  text-decoration: none;
  letter-spacing: -0.2px;
}

.navbar-brand img {
  height: 26px;
  width: auto;
}

.navbar-brand .brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

/* Notificaciones en navbar */
.nav-notif {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
  text-decoration: none;
}

.nav-notif:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.nav-notif .badge-notif {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 1.5px solid var(--bg-app);
}

/* ============================================================
   BOTTOM NAVIGATION
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1050;
  height: var(--bottom-nav-h);
  background: var(--bg-bottom-nav);
  backdrop-filter: var(--blur-nav);
  -webkit-backdrop-filter: var(--blur-nav);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  /* Notch safe area */
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  text-decoration: none;
  color: var(--bottom-nav-icon-inactive);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
  padding: 8px 4px 6px;
  background: none;
  border: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--dur) var(--ease);
  position: relative;
}

.bottom-nav-item i {
  font-size: 22px;
  transition: transform 0.18s var(--ease), color var(--dur) var(--ease);
  line-height: 1;
}

.bottom-nav-item span {
  line-height: 1;
  transition: color var(--dur) var(--ease);
}

.bottom-nav-item.activo,
.bottom-nav-item.active {
  color: var(--bottom-nav-icon-active);
}

.bottom-nav-item.activo i,
.bottom-nav-item.active i {
  transform: translateY(-1px);
}

/* Indicador activo sutil */
.bottom-nav-item.activo::before,
.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 2.5px;
  border-radius: 0 0 3px 3px;
  background: var(--bottom-nav-icon-active);
}

/* Botón central destacado (Ticket/Acción) */
.bottom-nav-item.central {
  position: relative;
}

.bottom-nav-item.central .nav-center-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 16px rgba(0,113,227,0.35);
  margin-bottom: 2px;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

[data-theme="rey"] .bottom-nav-item.central .nav-center-btn {
  background: var(--gold);
  box-shadow: 0 4px 16px rgba(212,160,23,0.4);
}

.bottom-nav-item.central:active .nav-center-btn {
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(0,113,227,0.25);
}

.bottom-nav-item.central span {
  font-size: 9.5px;
  color: var(--bottom-nav-icon-inactive);
}

/* ============================================================
   SECCIONES DE CONTENIDO
   ============================================================ */
.contenido {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: var(--bottom-nav-h);
  background: var(--bg-app);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0;
  z-index: 10;
  transition: opacity var(--dur) var(--ease);
}

.contenido.activo {
  display: block;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.card-glass {
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: var(--r-lg);
}

[data-theme="oscuro"] .card-glass {
  background: rgba(40,40,44,0.7);
  border-color: rgba(255,255,255,0.10);
}

[data-theme="rey"] .card-glass {
  background: rgba(26,21,0,0.75);
  border-color: rgba(212,160,23,0.20);
}

/* Tarjeta de saldo */
.tarjeta-saldo {
  background: linear-gradient(135deg, var(--accent) 0%, #0051a0 100%);
  border-radius: var(--r-xl);
  padding: 28px 24px 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,113,227,0.3);
}

[data-theme="rey"] .tarjeta-saldo {
  background: linear-gradient(135deg, #b8860b 0%, #8b6508 60%, #5a3e00 100%);
  box-shadow: 0 8px 32px rgba(180,130,0,0.4);
}

[data-theme="oscuro"] .tarjeta-saldo {
  background: linear-gradient(135deg, #0a84ff 0%, #0051b4 100%);
  box-shadow: 0 8px 32px rgba(10,132,255,0.25);
}

.tarjeta-saldo::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
}

.tarjeta-saldo::after {
  content: '';
  position: absolute;
  bottom: -60px;
  right: 20px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}

.tarjeta-saldo .saldo-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 4px;
}

.tarjeta-saldo .saldo-valor {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1;
  margin-bottom: 2px;
}

.tarjeta-saldo .saldo-moneda {
  font-size: 16px;
  font-weight: 600;
  opacity: 0.8;
}

.tarjeta-saldo .saldo-nombre {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.8;
  margin-top: 14px;
}

.tarjeta-saldo .saldo-clasificacion {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.18);
  border-radius: var(--r-full);
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  margin-top: 8px;
}

/* ============================================================
   ACCIONES RÁPIDAS (grid de íconos debajo del saldo)
   ============================================================ */
.acciones-rapidas {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 12px 0;
}

.accion-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 4px;
}

.accion-icono {
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--accent);
  box-shadow: var(--shadow-sm);
  transition: transform 0.14s var(--ease), background var(--dur) var(--ease);
}

[data-theme="rey"] .accion-icono {
  color: var(--gold);
}

.accion-item:active .accion-icono {
  transform: scale(0.90);
  background: var(--accent-soft);
}

.accion-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.2;
}

/* ============================================================
   QR
   ============================================================ */
.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.qr_img,
.qr-usuario {
  border-radius: var(--r-md);
  background: #fff; /* QR siempre en fondo blanco para legibilidad */
  padding: 10px;
  box-shadow: var(--shadow-sm);
  max-width: 220px;
  height: auto;
  display: block;
  margin: 0 auto;
  transition: transform 0.18s var(--ease);
}

.qr-usuario:hover,
.qr-usuario:active {
  transform: scale(1.02);
}

/* ============================================================
   BOTONES
   ============================================================ */

/* Píldora principal */
.boton-pildora {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--r-full);
  cursor: pointer;
  transition: background var(--dur) var(--ease), transform 0.14s var(--ease), box-shadow var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  width: 100%;
  max-width: 340px;
  margin: 0.5rem auto;
}

.boton-pildora:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 14px rgba(0,113,227,0.25);
}

.boton-pildora:active {
  background: var(--accent-active);
  transform: scale(0.97);
  box-shadow: none;
}

.boton-pildora:disabled {
  background: var(--text-tertiary);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Variante claro */
.boton-pildora.claro {
  background: var(--bg-card-2);
  color: var(--accent);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.boton-pildora.claro:hover {
  background: var(--bg-input);
  box-shadow: var(--shadow-sm);
}

/* Variante negro */
.boton-pildora.negro {
  background: var(--text-primary);
  color: var(--bg-card);
}

.boton-pildora.negro:hover {
  background: #333;
}

/* Variante peligro */
.boton-pildora.peligro {
  background: var(--danger);
  color: #fff;
}

/* Link como botón */
a.boton-pildora {
  text-decoration: none;
}

/* Botón icono circular */
.btn-icono {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--bg-card-2);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: background var(--dur) var(--ease), transform 0.14s var(--ease);
}

.btn-icono:hover {
  background: var(--bg-input);
}

.btn-icono:active {
  transform: scale(0.90);
}

/* Bootstrap overrides */
.btn {
  font-family: inherit;
  font-weight: 600;
  border-radius: var(--r-md);
  transition: all var(--dur) var(--ease);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
}

.btn-light {
  background: var(--bg-card-2);
  color: var(--text-primary);
  border-color: var(--border);
}

/* ============================================================
   FORMULARIOS (Apple style)
   ============================================================ */
.form-apple {
  text-align: center;
}

.form-apple input[type="text"],
.form-apple input[type="tel"],
.form-apple input[type="email"],
.form-apple input[type="password"],
.input-apple {
  display: block;
  width: 100%;
  max-width: 360px;
  margin: 0.6rem auto;
  padding: 14px 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-full);
  font-size: 16px;
  font-family: inherit;
  font-weight: 500;
  background: var(--bg-input);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
  appearance: none;
  -webkit-appearance: none;
}

.form-apple input::placeholder,
.input-apple::placeholder {
  color: var(--text-tertiary);
}

.form-apple input:focus,
.input-apple:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  background: var(--bg-card);
}

/* Input con botón interno */
.input-with-action {
  position: relative;
  width: 100%;
  max-width: 360px;
  margin: 0.6rem auto;
}

.input-with-action input {
  width: 100%;
  padding-right: 3.2rem;
}

.input-with-action > button {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 17px;
  transition: background var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.input-with-action > button:hover {
  background: var(--bg-input);
}

/* Código OTP */
.otp-inputs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 1.5rem auto;
}

.otp-inputs input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-input);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  appearance: none;
  -webkit-appearance: none;
  caret-color: var(--accent);
}

.otp-inputs input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ============================================================
   TIPOGRAFÍA
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: inherit;
  color: var(--text-primary);
  line-height: 1.25;
  letter-spacing: -0.3px;
}

h1 { font-size: 2.2rem; font-weight: 800; }
h2 { font-size: 1.75rem; font-weight: 700; }
h3 { font-size: 1.4rem; font-weight: 700; }
h4 { font-size: 1.15rem; font-weight: 600; }
h5 { font-size: 1rem; font-weight: 600; }
h6 { font-size: 0.9rem; font-weight: 600; color: var(--text-secondary); }

.titulo-central {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.titulo-slogan {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
}

.p, .texto-descripcion {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  font-weight: 400;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.saldo-text, .saldo-textn {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.valor-saldo, .valor-saldon {
  color: var(--text-primary);
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
}

/* ============================================================
   HISTORIAL / LISTAS
   ============================================================ */
.movimiento-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--dur) var(--ease);
  background: var(--bg-card);
}

.movimiento-item:last-child {
  border-bottom: none;
}

.movimiento-item:active {
  background: var(--bg-card-2);
}

.movimiento-icono {
  width: 42px;
  height: 42px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.movimiento-icono.cargo   { background: rgba(255,59,48,0.1);  color: var(--danger); }
.movimiento-icono.abono   { background: rgba(52,199,89,0.1);  color: var(--success); }
.movimiento-icono.neutro  { background: var(--accent-soft);   color: var(--accent); }

.movimiento-info { flex: 1; min-width: 0; }
.movimiento-desc { font-size: 14px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.movimiento-fecha { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.movimiento-monto { font-size: 15px; font-weight: 700; }
.movimiento-monto.cargo  { color: var(--danger); }
.movimiento-monto.abono  { color: var(--success); }

/* ============================================================
   CAROUSEL / PROMOS
   ============================================================ */
.carousel-inner {
  border-radius: var(--r-lg);
  overflow: hidden;
}

.carousel-item img {
  width: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--r-lg);
}

.banner-superior {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: white;
  padding: 24px 16px 14px;
  font-size: 13px;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* ============================================================
   SWITCH / TOGGLE
   ============================================================ */
.form-check-input {
  width: 50px;
  height: 28px;
  border-radius: var(--r-full);
  background: var(--danger);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  transition: background var(--dur) var(--ease);
  flex-shrink: 0;
}

.form-check-input::after {
  content: '';
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  margin: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform var(--dur) var(--ease);
}

.form-check-input:checked {
  background: var(--success);
}

.form-check-input:checked::after {
  transform: translateX(22px);
}

.form-check-label {
  color: var(--text-primary);
  font-weight: 500;
  cursor: pointer;
  margin-left: 8px;
}

/* ============================================================
   THEME SWITCHER
   ============================================================ */
.theme-switcher {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.theme-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.14s var(--ease), border-color 0.14s var(--ease);
  outline: none;
}

.theme-btn:active { transform: scale(0.88); }

.theme-btn.active {
  border-color: var(--text-primary);
  transform: scale(1.1);
}

.theme-btn[data-t="claro"] { background: #f2f2f7; border-color: #ccc; }
.theme-btn[data-t="oscuro"] { background: #1c1c1e; }
.theme-btn[data-t="rey"]    { background: linear-gradient(135deg, #d4a017, #8b6508); }

/* ============================================================
   SECCIÓN HEADER (dentro de contenido)
   ============================================================ */
.seccion-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-app);
  position: sticky;
  top: 0;
  z-index: 5;
}

.seccion-header h4 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.seccion-header .btn-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--dur) var(--ease);
  flex-shrink: 0;
}

/* ============================================================
   TARJETAS ESPECIALES
   ============================================================ */
.tarjeta-real1,
.tarjeta-real2,
.tarjeta-real3 {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  text-align: center;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

/* ============================================================
   LOGO / SPLASH
   ============================================================ */
.logo {
  width: 90px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-app);
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; pointer-events: none; }
}

/* ============================================================
   DROPDOWN / NOTIFICACIONES
   ============================================================ */
.dropdown-menu {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  padding: 4px 0;
}

.dropdown-item {
  color: var(--text-primary);
  font-weight: 500;
  padding: 10px 16px;
  transition: background var(--dur) var(--ease);
}

.dropdown-item:hover {
  background: var(--bg-card-2);
  color: var(--text-primary);
}

.dropdown-menu li {
  border-bottom: 1px solid var(--border);
  display: block;
  padding: 0;
}

.dropdown-menu li:last-child {
  border-bottom: none;
}

.eliminar-not {
  color: var(--danger);
  background: none;
  border: none;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 6px;
}

/* ============================================================
   TOASTS
   ============================================================ */
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
}

/* ============================================================
   IFRAME SECCIONES
   ============================================================ */
.seccion-iframe {
  width: 100%;
  height: calc(100vh - 60px - var(--bottom-nav-h) - 52px); /* viewport - navbar - bottomnav - header */
  border: none;
  display: block;
}

/* ============================================================
   BLUR UTILITY
   ============================================================ */
.blur {
  filter: blur(5px);
  pointer-events: none;
  transition: filter 0.3s var(--ease);
}

/* ============================================================
   ANIMACIONES
   ============================================================ */
@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); }
  50%       { box-shadow: 0 0 0 8px var(--accent-soft); }
}

.animate-up {
  animation: slideUpFade 0.35s var(--ease) both;
}

/* ============================================================
   CONTENEDOR MÓVIL
   ============================================================ */
.contenedor-movil {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ============================================================
   RESPONSIVE SAFE AREAS (iPhone notch)
   ============================================================ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
  }

  body {
    padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
  }
}

/* ============================================================
   UTILIDADES
   ============================================================ */
.text-accent    { color: var(--accent); }
.text-gold      { color: var(--gold); }
.text-muted-rc  { color: var(--text-secondary); }
.bg-card-rc     { background: var(--bg-card); }
.border-rc      { border: 1px solid var(--border); }
.rounded-rc-lg  { border-radius: var(--r-lg); }
.rounded-rc-xl  { border-radius: var(--r-xl); }
.shadow-rc      { box-shadow: var(--shadow-card); }

.divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

.separador {
  height: 8px;
  background: var(--bg-app);
}

/* ============================================================
   RESPONSIVE: pantallas >= 768px (centrado tipo móvil)
   ============================================================ */
@media (min-width: 768px) {
  body {
    /* En tablet/desktop, simular contenedor móvil */
  }

  .bottom-nav {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-radius: var(--r-md) var(--r-md) 0 0;
  }

  .navbar {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }

  .contenido {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* ============================================================
   PRINT / A11y
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}