@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

/* ==========================================================================
   CSS VARIABLES — TEMA CLARO MGM HUB
   ========================================================================== */
:root {
  --primary-navy:      #00214A;
  --primary-navy-mid:  #003a82;
  --primary-blue:      #0073e6;
  --primary-blue-lt:   #e8f0fd;
  --primary-blue-glow: rgba(0, 115, 230, 0.2);
  --accent-gold:       #FFB800;
  --accent-gold-dark:  #d99b00;
  --accent-green:      #25d366;
  --accent-red:        #ef4444;
  --accent-purple:     #7c3aed;
  --accent-orange:     #f97316;

  /* Superficies CLARAS */
  --bg-page:      #f0f4f9;
  --bg-surface:   #ffffff;
  --bg-card:      #ffffff;
  --bg-card-alt:  #f8faff;
  --border-light: #dde5f0;
  --border-mid:   #c5d1e8;

  /* Texto */
  --text-dark:    #0f1e35;
  --text-body:    #334155;
  --text-muted:   #64748b;
  --text-subtle:  #94a3b8;
  --text-white:   #ffffff;

  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   20px;
  --radius-xl:   28px;
  --radius-full: 9999px;

  --shadow-xs:   0 1px 4px rgba(0,33,74,0.06);
  --shadow-sm:   0 2px 10px rgba(0,33,74,0.08);
  --shadow-md:   0 6px 24px rgba(0,33,74,0.10);
  --shadow-lg:   0 12px 40px rgba(0,33,74,0.16);

  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top:    env(safe-area-inset-top, 0px);
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box; margin: 0; padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%; height: 100%;
  overflow-x: hidden;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-body);
  -webkit-font-smoothing: antialiased;
}

body { display: flex; flex-direction: column; min-height: 100dvh; }

#app-root {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-page);
  position: relative;
  box-shadow: 0 0 60px rgba(0, 33, 74, 0.12);
  padding-bottom: calc(140px + var(--safe-bottom));
}

/* ==========================================================================
   HEADER BLANCO MGM HUB
   ========================================================================== */
.app-header {
  position: sticky; top: 0; z-index: 500;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  background: #ffffff;
  border-bottom: 2px solid var(--border-light);
  box-shadow: 0 2px 10px rgba(0, 33, 74, 0.05);
}

.brand-wrapper { display: flex; align-items: center; gap: 10px; }
.brand-logo-img { height: 34px; width: auto; object-fit: contain; }
.brand-titles { display: flex; flex-direction: column; }

.brand-app-name {
  font-size: 16px; font-weight: 800; color: var(--primary-navy);
  display: flex; align-items: center; gap: 6px; letter-spacing: -0.02em;
}

.badge-box {
  background: var(--primary-blue);
  color: #ffffff;
  font-size: 9px; font-weight: 900;
  padding: 2px 6px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.5px;
}

.brand-tagline { font-size: 10.5px; color: var(--text-muted); font-weight: 500; }

.btn-header-wa-action {
  background: #e8f9f1;
  border: 1px solid #a7f3d0;
  color: #16a34a;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-header-wa-action:hover, .btn-header-wa-action:active {
  background: #25d366;
  color: #ffffff;
  border-color: #25d366;
  box-shadow: 0 3px 12px rgba(37, 211, 102, 0.3);
}

/* ==========================================================================
   BOTTOM NAVIGATION BAR
   ========================================================================== */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 540px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  box-shadow: 0 -4px 20px rgba(0, 33, 74, 0.08);
  display: flex; justify-content: space-around; align-items: stretch;
  padding-bottom: var(--safe-bottom);
  z-index: 900;
}

.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer; padding: 10px 0;
  transition: all 0.2s ease; position: relative;
}

.nav-icon { font-size: 18px; transition: transform 0.2s, color 0.2s; }
.nav-label { font-size: 10.5px; font-weight: 700; }

.nav-item.active { color: var(--primary-blue); }
.nav-item.active .nav-icon { transform: translateY(-2px) scale(1.15); }
.nav-item.active::after {
  content: ''; position: absolute; top: 0;
  width: 36px; height: 3px;
  background: var(--primary-blue);
  border-radius: 0 0 4px 4px;
}

/* ==========================================================================
   VIEWS & SPACING
   ========================================================================== */
.view-container {
  display: none; flex: 1;
  animation: viewIn 0.25s ease;
  padding-bottom: 24px;
}
.view-container.active { display: block; }

@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 16px 10px;
}

.section-title {
  font-size: 16px; font-weight: 800; color: var(--text-dark);
  display: flex; align-items: center; gap: 8px;
}

.section-link {
  font-size: 12px; font-weight: 700;
  color: var(--primary-blue); cursor: pointer;
}

/* ==========================================================================
   VIEW 1 — INICIO (HOME)
   ========================================================================== */

/* Banner próximo evento */
.next-event-hero {
  margin: 14px 16px 0;
  background: var(--primary-navy);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; transition: opacity 0.2s;
  box-shadow: var(--shadow-md);
}
.next-event-hero:hover { opacity: 0.92; }

.next-event-icon-box {
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(255,184,0,0.2);
  border: 1px solid rgba(255,184,0,0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--accent-gold); flex-shrink: 0;
  transition: all 0.2s ease;
}

.next-event-details { flex: 1; min-width: 0; }

.next-event-badge {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  color: var(--accent-gold); letter-spacing: 0.5px;
  display: flex; align-items: center; gap: 4px;
}

.next-event-title-text {
  font-size: 13.5px; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px;
}

.next-event-countdown { font-size: 11px; color: rgba(255,255,255,0.65); margin-top: 2px; }

/* Bento Grid de accesos rápidos */
.quick-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; padding: 0 16px;
}

.quick-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px; cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  box-shadow: var(--shadow-xs);
}
.quick-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-blue);
}

.card-icon-pill {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 10px;
}
.pill-puntos  { background: #fff8e1; color: var(--accent-gold-dark); }
.pill-agenda  { background: var(--primary-blue-lt); color: var(--primary-blue); }
.pill-promos  { background: #fff0e8; color: var(--accent-orange); }
.pill-chat    { background: #e8f9f1; color: #18a85c; }

.card-title  { font-size: 13.5px; font-weight: 800; color: var(--text-dark); margin-bottom: 3px; }
.card-desc   { font-size: 11px; color: var(--text-muted); line-height: 1.4; }

/* Slider de promos en Home */
.promos-slider-container {
  display: flex; gap: 12px;
  overflow-x: auto; padding: 4px 16px 10px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.promos-slider-container::-webkit-scrollbar { display: none; }

.promo-slide-item {
  flex: 0 0 230px; height: 140px;
  border-radius: var(--radius-md); overflow: hidden;
  position: relative; cursor: pointer;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: transform 0.2s;
}
.promo-slide-item:hover { transform: scale(1.03); }
.promo-slide-item img { width:100%; height:100%; object-fit:cover; }
.promo-slide-badge {
  position:absolute; bottom:8px; left:8px;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(6px);
  padding: 3px 8px; border-radius: 6px;
  font-size: 10px; font-weight: 700; color: #fff;
}

/* Features MGM */
.features-list {
  padding: 0 16px 20px;
  display: flex; flex-direction: column; gap: 10px;
}

.feature-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px 16px; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-xs);
}
.feature-icon { font-size: 22px; flex-shrink: 0; }
.feature-text strong { display: block; font-size: 13.5px; color: var(--text-dark); margin-bottom: 2px; }
.feature-text span   { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

/* ==========================================================================
   VIEW 2 — MGM PUNTOS (PORTAL CLIENTE)
   ========================================================================== */

.puntos-subnav {
  display: flex; gap: 4px;
  background: var(--bg-page);
  border-bottom: 1px solid var(--border-light);
  padding: 8px 12px 0;
  overflow-x: auto; scrollbar-width: none;
}
.puntos-subnav::-webkit-scrollbar { display: none; }

.puntos-subtab {
  flex-shrink: 0; background: transparent;
  border: none; border-bottom: 2px solid transparent;
  color: var(--text-muted); font-size: 12.5px; font-weight: 700;
  padding: 6px 12px 8px; cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.puntos-subtab.active {
  color: var(--primary-blue);
  border-bottom-color: var(--primary-blue);
}

.puntos-subview { display: none; padding: 16px; }
.puntos-subview.active { display: block; animation: viewIn 0.2s ease; }

.member-card {
  background: var(--primary-navy);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden; margin-bottom: 16px;
}
.member-card::before {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255,184,0,0.12); pointer-events: none;
}
.member-card-header {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 18px;
}
.card-brand-logo { height: 26px; }

.card-tier-pill {
  background: rgba(255,184,0,0.2);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  font-size: 10px; font-weight: 900; padding: 3px 10px;
  border-radius: 20px; letter-spacing: 1px; text-transform: uppercase;
}

.member-points-display { text-align: center; margin-bottom: 20px; }
.points-label { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; color: rgba(255,255,255,0.55); text-transform: uppercase; }
.points-number { font-size: 44px; font-weight: 900; line-height: 1.1; color: var(--accent-gold); }
.points-usd { font-size: 12.5px; color: rgba(255,255,255,0.7); margin-top: 4px; }

.member-card-footer {
  display: flex; justify-content: space-between; align-items: flex-end;
  border-top: 1px solid rgba(255,255,255,0.12); padding-top: 12px;
}
.member-holder-label { font-size: 9px; color: rgba(255,255,255,0.45); letter-spacing: 1px; text-transform: uppercase; }
.member-holder-name  { font-size: 14px; font-weight: 800; color: #fff; }
.member-cedula       { font-size: 12px; font-family: monospace; color: rgba(255,255,255,0.6); }

.bday-banner {
  background: #fffbeb;
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.bday-icon { font-size: 24px; }
.bday-text strong { display: block; font-size: 13px; color: var(--accent-gold-dark); }
.bday-text span   { font-size: 11.5px; color: var(--text-body); }

.app-form {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow-sm);
}

.form-group { margin-bottom: 14px; }
.form-label {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--text-muted); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.4px;
}

.form-control {
  width: 100%;
  background: var(--bg-page);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 11px 13px; color: var(--text-dark);
  font-family: inherit; font-size: 14px; font-weight: 500;
  transition: all 0.2s; outline: none;
}
.form-control:focus {
  border-color: var(--primary-blue);
  background: #fff;
  box-shadow: 0 0 0 3px var(--primary-blue-glow);
}

.btn-submit {
  width: 100%;
  background: var(--primary-blue);
  border: none; border-radius: var(--radius-sm);
  color: #fff; padding: 13px;
  font-size: 14px; font-weight: 800; cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 14px var(--primary-blue-glow);
}
.btn-submit:hover { background: #005ec0; transform: translateY(-1px); }
.btn-submit:active { transform: translateY(0); }

.app-alert { display: none; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 12.5px; margin-bottom: 12px; font-weight: 600; }
.app-alert.show { display: block; animation: viewIn 0.2s ease; }
.app-alert.success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.app-alert.error   { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }

.tx-history-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md); overflow: hidden;
  margin-top: 12px; box-shadow: var(--shadow-xs);
}

.tx-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.tx-table th {
  background: var(--bg-page); padding: 9px 10px;
  text-align: left; color: var(--text-muted); font-weight: 700;
  border-bottom: 1px solid var(--border-light);
}
.tx-table td { padding: 10px; border-bottom: 1px solid #f1f5f9; color: var(--text-dark); }
.tx-table tr:last-child td { border-bottom: none; }

.badge-pts     { background: #f0fdf4; color: #16a34a; font-weight: 800; padding: 2px 7px; border-radius: 5px; display: inline-block; }
.badge-pts-red { background: #fef2f2; color: #dc2626; font-weight: 800; padding: 2px 7px; border-radius: 5px; display: inline-block; }

/* ==========================================================================
   VIEW 3 — AGENDA & CALENDARIO
   ========================================================================== */
.calendar-wrap { padding: 0 16px; }

.calendar-top-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-surface); border: 1px solid var(--border-light);
  border-radius: var(--radius-md); padding: 10px 14px; margin-bottom: 12px;
  box-shadow: var(--shadow-xs);
}

.calendar-month-text {
  font-size: 15px; font-weight: 800; color: var(--text-dark);
  display: flex; align-items: center; gap: 8px;
}

.cal-nav-btn {
  background: var(--bg-page); border: 1px solid var(--border-light);
  color: var(--text-body); width: 30px; height: 30px;
  border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.cal-nav-btn:hover { background: var(--primary-blue-lt); border-color: var(--primary-blue); color: var(--primary-blue); }

.cal-filters {
  display: flex; gap: 6px; overflow-x: auto;
  padding-bottom: 10px; scrollbar-width: none;
}
.cal-filters::-webkit-scrollbar { display: none; }

.filter-pill {
  flex-shrink: 0; padding: 5px 12px; border-radius: 20px;
  font-size: 11.5px; font-weight: 700;
  border: 1.5px solid var(--border-light);
  background: var(--bg-surface); color: var(--text-muted);
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; gap: 5px;
}
.filter-pill.active { background: var(--primary-blue); color: #fff; border-color: var(--primary-blue); }

.cal-grid-header {
  display: grid; grid-template-columns: repeat(7, 1fr);
  text-align: center; font-size: 11px; font-weight: 700;
  color: var(--text-muted); padding-bottom: 6px;
}

.cal-grid-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }

.cal-day-cell {
  min-height: 60px; background: var(--bg-surface);
  border: 1px solid var(--border-light); border-radius: 6px;
  padding: 4px; display: flex; flex-direction: column;
  box-shadow: var(--shadow-xs);
}
.cal-day-cell.empty { background: transparent; border-color: transparent; box-shadow: none; }
.cal-day-cell.today { border-color: var(--primary-blue); background: var(--primary-blue-lt); }

.cal-day-num {
  font-size: 11px; font-weight: 800; color: var(--text-muted);
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; margin-bottom: 2px;
}
.cal-day-cell.today .cal-day-num { background: var(--primary-blue); color: #fff; }

.cal-event-pill {
  font-size: 9px; font-weight: 700; padding: 2px 4px;
  border-radius: 3px; margin-top: 2px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-left: 2px solid;
}
.cal-event-pill.webinar  { background: #eff6ff; border-color: #3b82f6; color: #1d4ed8; }
.cal-event-pill.training { background: #f0fdf4; border-color: #22c55e; color: #15803d; }
.cal-event-pill.curso    { background: #fffbeb; border-color: var(--accent-gold); color: var(--accent-gold-dark); }

/* ==========================================================================
   VIEW 4 — PROMOCIONES
   ========================================================================== */
.promos-gallery {
  padding: 4px 16px;
  display: flex; flex-direction: column; gap: 14px;
}

.promo-full-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.promo-full-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.promo-card-img-wrap { width: 100%; height: 200px; position: relative; overflow: hidden; }
.promo-card-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }

.promo-card-content { padding: 14px; }
.promo-card-title { font-size: 15px; font-weight: 800; color: var(--text-dark); margin-bottom: 5px; }
.promo-card-desc  { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; margin-bottom: 10px; }

.promo-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border-light); padding-top: 10px;
}

.btn-like {
  background: none; border: none; color: var(--text-muted);
  font-size: 12.5px; font-weight: 700; display: flex; align-items: center;
  gap: 5px; cursor: pointer; transition: color 0.2s;
}
.btn-like.liked { color: var(--accent-red); }

/* ==========================================================================
   MODALES GENERALES & PANTALLA COMPLETA
   ========================================================================== */
.app-modal {
  display: none; position: fixed; inset: 0; z-index: 2000;
  background: rgba(0, 33, 74, 0.6);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  align-items: center; justify-content: center; padding: 16px;
}
.app-modal.active {
  display: flex;
  animation: modalPop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes modalPop {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

.modal-content-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 480px; max-height: 90vh;
  overflow-y: auto; position: relative;
  box-shadow: var(--shadow-lg); padding: 22px 18px;
}

.modal-content-card.full-screen {
  max-width: 500px;
  width: 100%;
  height: 92vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.modal-close-x {
  position: absolute; top: 12px; right: 12px;
  background: var(--bg-page); border: 1px solid var(--border-light);
  color: var(--text-muted); width: 32px; height: 32px;
  border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; z-index: 20;
}

.event-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin: 14px 0; background: var(--bg-page);
  padding: 12px; border-radius: var(--radius-sm);
  font-size: 12px;
}
.event-detail-item { display: flex; align-items: center; gap: 8px; color: var(--text-muted); }
.event-detail-item strong { color: var(--text-dark); }

/* ==========================================================================
   MODAL PANTALLA COMPLETA: ASESORÍA MGM & CONTACTOS
   ========================================================================== */
.asesoria-banner-header {
  background: linear-gradient(135deg, var(--primary-navy), #003a82);
  padding: 24px 20px 20px;
  color: #fff; position: relative;
}

.wa-contact-list-modal {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bg-page);
}

.wa-card-item {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px; display: flex; align-items: center; gap: 14px;
  text-decoration: none; color: var(--text-dark);
  box-shadow: var(--shadow-xs); transition: all 0.2s ease;
  cursor: pointer;
}
.wa-card-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-blue);
}

.wa-card-item.magie-special-card {
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
  border-color: #c4b5fd;
}

.magie-avatar-img {
  width: 46px; height: 46px; border-radius: 50%;
  object-fit: cover; border: 2px solid #a78bfa; flex-shrink: 0;
}

.wa-avatar-img {
  width: 44px; height: 44px; border-radius: 50%;
  object-fit: contain; background: #fff; border: 1px solid var(--border-light);
  padding: 2px; flex-shrink: 0;
}

.wa-card-info strong { display: block; font-size: 14px; color: var(--text-dark); margin-bottom: 2px; }
.wa-card-info span   { font-size: 11.5px; color: var(--text-muted); }

/* ==========================================================================
   MODAL PANTALLA COMPLETA: MAGIE IA CHAT
   ========================================================================== */
.magie-chat-header-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
  position: relative; flex-shrink: 0;
}

.magie-header-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--accent-purple);
}

.magie-chat-messages-container {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  background: var(--bg-page);
}

.magie-chat-msg {
  max-width: 84%; padding: 10px 14px;
  border-radius: 16px; font-size: 13px; line-height: 1.5;
}

.magie-chat-msg.bot {
  background: #ffffff; color: var(--text-dark);
  border: 1px solid var(--border-light);
  align-self: flex-start; border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-xs);
}

.magie-chat-msg.user {
  background: var(--primary-blue); color: #ffffff;
  align-self: flex-end; border-bottom-right-radius: 4px;
}

.magie-chat-input-bar {
  display: flex; gap: 8px; padding: 12px 16px;
  background: #ffffff; border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}

.magie-chat-input-bar input {
  flex: 1; background: var(--bg-page);
  border: 1px solid var(--border-light); border-radius: 20px;
  padding: 10px 16px; font-size: 13.5px; font-family: inherit;
  outline: none; color: var(--text-dark);
}
.magie-chat-input-bar input:focus { border-color: var(--primary-blue); background: #fff; }

.btn-send-chat {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary-blue); border: none; color: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0; transition: background 0.2s;
}
.btn-send-chat:hover { background: #005ec0; }

/* ==========================================================================
   MINI AUDIO PLAYER (CENTRADITO Y COMPLETO CON BOTÓN CERRAR 'X')
   ========================================================================== */
.audio-mini-bar {
  position: fixed;
  bottom: calc(64px + var(--safe-bottom));
  left: 50%; transform: translateX(-50%);
  width: calc(100% - 24px); max-width: 516px;
  background: var(--primary-navy);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  z-index: 850;
  box-shadow: 0 8px 30px rgba(0, 33, 74, 0.25);
  transition: transform 0.3s ease, opacity 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.audio-mini-bar.hidden {
  transform: translate(-50%, 180%); opacity: 0; pointer-events: none;
}

.audio-cover-img {
  width: 36px; height: 36px; border-radius: 8px; object-fit: cover;
  background: rgba(255,255,255,0.1); flex-shrink: 0;
}
.audio-cover-img.spinning { animation: spin 8s linear infinite; border-radius: 50%; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.audio-info-wrap { flex: 1; min-width: 0; }
.audio-track-title  { font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.audio-track-artist { font-size: 10.5px; color: rgba(255,255,255,0.65); }

.audio-controls { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.btn-audio {
  background: none; border: none; color: rgba(255,255,255,0.85);
  cursor: pointer; padding: 6px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.btn-audio:hover { background: rgba(255,255,255,0.12); color: #fff; }

.btn-audio-play {
  width: 32px; height: 32px;
  background: var(--accent-gold); color: var(--primary-navy);
  border-radius: 50%;
}
.btn-audio-play:hover { background: #ffc424; color: var(--primary-navy); }

.btn-audio-close {
  color: rgba(255,255,255,0.7);
  padding: 6px;
  margin-left: 2px;
  border-radius: 50%;
  font-size: 14px;
}
.btn-audio-close:hover { color: #ffffff; background: rgba(255,255,255,0.2); }

/* ==========================================================================
   SPLASHSCREEN
   ========================================================================== */
#imou-splash {
  display: none; position: fixed; inset: 0; z-index: 99999;
  background: rgba(0, 33, 74, 0.75);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  align-items: center; justify-content: center; padding: 20px;
}
#imou-splash.show { display: flex; }
.splash-card-inner { position: relative; max-width: 440px; width: 100%; }
.splash-card-inner img { width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); display: block; }
.splash-close-btn {
  position: absolute; top: -12px; right: -12px;
  background: #fff; border: 1px solid var(--border-light);
  color: var(--text-muted); width: 34px; height: 34px;
  border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}

/* ── INSTAGRAM STYLE PROMO FEED ── */
.cli-modal {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%; height: 100dvh;
    background: #000; z-index: 9999999;
    display: none; flex-direction: column;
}
.cli-modal-close {
    position: absolute; top: 16px; right: 16px; z-index: 1000000;
    background: rgba(0,0,0,0.5); border: none; color: #fff;
    width: 36px; height: 36px; border-radius: 50%;
    font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.cli-modal-feed {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}
.cli-feed-item {
    width: 100%; height: 100%; height: 100dvh;
    scroll-snap-align: start;
    position: relative;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
}
.cli-feed-img {
    width: 100%; height: 100%; object-fit: contain; background: #000;
}
.cli-feed-img-placeholder {
    width: 100%; height: 100%; background: #111;
    display: flex; align-items: center; justify-content: center;
    font-size: 80px;
}
.cli-feed-body {
    position: absolute; bottom: 0; left: 0; width: 100%;
    padding: 24px 20px 40px 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8) 20%, rgba(0,0,0,0.95));
    color: #fff;
    transition: all 0.3s ease;
    max-height: 140px; /* Only show limited content initially */
    overflow-y: hidden;
    cursor: pointer;
}
.cli-feed-body.expanded {
    max-height: 80vh; overflow-y: auto;
    background: rgba(0,0,0,0.95);
}
.cli-feed-type {
    display: inline-block; padding: 4px 8px; border-radius: 4px;
    font-size: 11px; font-weight: 800; margin-bottom: 8px;
    background: rgba(255,255,255,0.2); color: #fff; text-transform: uppercase;
}
.cli-feed-title {
    font-size: 18px; font-weight: 800; margin-bottom: 8px; text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.cli-feed-desc {
    font-size: 14px; line-height: 1.4; color: #cbd5e1;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    transition: all 0.3s; text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.cli-feed-body.expanded .cli-feed-desc {
    display: block; color: #fff;
}
.cli-feed-more {
    color: #a78bfa; font-weight: 700; font-size: 13px;
    margin-top: 6px; display: inline-block; text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.cli-feed-body.expanded .cli-feed-more { display: none; }
.cli-feed-dates {
    font-size: 12px; color: #94a3b8; margin-top: 12px;
}

/* ==========================================================================
   INSTALL OVERLAY (PANTALLA DE BIENVENIDA / INSTALAR WEBAPP)
   ========================================================================== */
#install-overlay {
  position: fixed; inset: 0; z-index: 99999999;
  background: linear-gradient(155deg, #00214a 0%, #143266 50%, #1a3e80 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  font-family: 'Nunito Sans', system-ui, sans-serif;
  overflow-y: auto;
}

#install-card {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 28px 22px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
  animation: installCardIn 0.45s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes installCardIn {
  from { opacity: 0; transform: translateY(32px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

#install-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
  background: #fff;
  padding: 6px;
  margin-bottom: 10px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

#install-badge {
  display: inline-block;
  background: linear-gradient(135deg, #ffb800, #e08600);
  color: #00214a;
  font-size: 10px; font-weight: 900;
  letter-spacing: 2px;
  padding: 2px 9px;
  border-radius: 20px;
  margin-bottom: 10px;
}

#install-title {
  font-size: 22px; font-weight: 900;
  color: #fff;
  margin: 0 0 6px;
  letter-spacing: -0.3px;
}

#install-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  line-height: 1.5;
  margin: 0 0 18px;
}

#install-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}

.install-feature {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.install-feature i { font-size: 17px; }

#btn-install-app {
  width: 100%;
  padding: 13px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #ffb800, #e08600);
  color: #00214a;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  box-shadow: 0 5px 18px rgba(255,184,0,0.35);
  transition: transform 0.15s;
}
#btn-install-app:active { transform: scale(0.97); }

#install-ios-hint {
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 11px;
  padding: 11px 13px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(255,255,255,0.85);
  font-size: 12px;
  text-align: left;
  line-height: 1.45;
}
#install-ios-hint i { font-size: 18px; flex-shrink: 0; color: #60a5fa; }
#install-ios-hint strong { color: #ffb800; }

#btn-skip-install {
  width: 100%;
  padding: 11px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  background: transparent;
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background 0.2s, color 0.2s;
}
#btn-skip-install:hover, #btn-skip-install:active {
  background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.9);
}
