/* ── BOTTOM NAV (móvil) — fijo en la base ── */
#ath-bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 99999;
  align-items: stretch;
  background: rgba(12,12,28,0.97);
  border-top: 1px solid rgba(201,168,76,0.28);
  height: 62px;
  box-shadow: 0 -4px 22px rgba(0,0,0,0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
@media (min-width: 768px) {
  #ath-bottom-nav { display: none !important; }
}
@media (max-width: 767px) {
  .atheneus-tabs-nav { display: none !important; }
  #atheneus-panel { padding-bottom: 72px !important; padding-top: 0 !important; }
  .ath-consultar-toggle { display: none !important; }
}

.ath-bn-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  cursor: pointer; padding: 4px 2px; border: none;
  background: transparent; color: #666; font-family: inherit;
  text-decoration: none; transition: color 0.2s;
  -webkit-tap-highlight-color: transparent; position: relative;
}
.ath-bn-item:active { background: rgba(201,168,76,0.08); }
.ath-bn-item.active { color: #c9a84c; }
.ath-bn-item.active::after {
  content: ''; position: absolute; top: 4px;
  width: 4px; height: 4px; border-radius: 50%; background: #c9a84c;
}
.ath-bn-icon  { font-size: 20px; line-height: 1; }
.ath-bn-label { font-size: 9px; font-weight: 500; white-space: nowrap; line-height: 1; }

/* ── HEADER: título+triada solo en Mi Carta ── */
#atheneus-panel:not([data-active-tab="carta"]) .atheneus-header-info { display: none !important; }
.ath-creditos-badge { display: none !important; }

/* ── OCULTAR icono suelto en perfil ── */
#atheneus-tab-perfil .atheneus-perfil-content { display: none !important; }

/* ── BANNER GEMAS ── */
.ath-onboarding-banner {
  flex-direction: column !important; align-items: stretch !important;
  gap: 8px !important; padding: 10px 14px !important;
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(201,168,76,0.2) !important;
  border-radius: 10px; margin-bottom: 12px;
}
.ath-banner-row1 { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.ath-banner-row2 { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.ath-banner-get-btn { font-size:0.72rem; padding:4px 9px; background:#c6a44e; color:#1a1a2e; border-radius:6px; text-decoration:none; font-weight:700; white-space:nowrap; }
.ath-cupon-label { font-size:0.75rem; color:#9BE8B0; white-space:nowrap; }
.ath-cupon-field { flex:1; min-width:80px; background:rgba(255,255,255,0.06); border:1px solid rgba(201,168,76,0.25); border-radius:6px; color:#fff; font-size:0.75rem; padding:4px 8px; }
.ath-cupon-field::placeholder { color:#555; }
.ath-cupon-apply-btn { background:rgba(155,232,176,0.12); border:1px solid #9BE8B0; color:#9BE8B0; border-radius:6px; padding:4px 9px; font-size:0.72rem; font-weight:700; cursor:pointer; white-space:nowrap; }
.ath-cupon-msg { font-size:0.72rem; }

/* ── COSTE BAR ── */
.ath-coste-bar { display:flex; align-items:center; gap:8px; padding:10px 14px; background:rgba(255,255,255,0.04); border-radius:10px; margin-bottom:14px; font-size:0.9rem; color:#c9a84c; }

/* ── COMPAT BANNER ── */
.ath-compat-banner { display:flex; align-items:center; gap:12px; background:linear-gradient(135deg,#1f1600,#1a1a2e); border:1px solid rgba(201,168,76,0.4); border-radius:12px; padding:14px 16px; margin:16px 4px; cursor:pointer; transition:border-color .25s,box-shadow .25s; }
.ath-compat-banner:hover { border-color:#c9a84c; box-shadow:0 0 16px rgba(201,168,76,.2); }
.ath-compat-banner-icon { font-size:26px; flex-shrink:0; }
.ath-compat-banner-text { flex:1; color:#e8d5a3; font-size:.88rem; line-height:1.4; }
.ath-compat-banner-text strong { color:#c9a84c; display:block; margin-bottom:3px; font-size:.93rem; }
.ath-compat-banner-btn { background:linear-gradient(135deg,#c9a84c,#e8c96a); color:#1a1a2e; border:none; border-radius:8px; padding:9px 14px; font-weight:700; font-size:.82rem; cursor:pointer; white-space:nowrap; flex-shrink:0; }

/* ── PERFIL ACORDEONES — bordes verdes ── */
.ath-acordeon {
  border: 1px solid rgba(155,232,176,0.35);
  border-radius: 10px; margin-bottom: 8px;
  overflow: hidden; background: rgba(255,255,255,0.02);
}
.ath-acordeon-header {
  display:flex; align-items:center; justify-content:space-between;
  padding: 13px 16px; cursor: pointer; user-select: none;
  transition: background .2s;
  border-left: 3px solid rgba(155,232,176,0.5);
}
.ath-acordeon-header:hover { background: rgba(155,232,176,0.07); }
.ath-acordeon.open .ath-acordeon-header { border-left-color: #9BE8B0; background: rgba(155,232,176,0.06); }
.ath-acordeon-title { font-size:.9rem; color:#e8d5a3; font-weight:600; display:flex; align-items:center; gap:8px; }
.ath-acordeon-arrow { color:#9BE8B0; font-size:.72rem; transition:transform .25s; flex-shrink:0; }
.ath-acordeon-body { display:none; padding:14px 16px; border-top:1px solid rgba(155,232,176,0.15); }
.ath-acordeon.open .ath-acordeon-body { display:block; }
.ath-acordeon.open .ath-acordeon-arrow { transform:rotate(90deg); }

/* ── Ocultar banner gemas en Mi Futuro / Compatibilidad ── */
#atheneus-panel[data-active-tab="consultar"] #ath-gems-banner { display: none !important; }

/* ── Tarjeta título celestial ── */
.ath-tab-title-card {
  text-align: center;
  padding: 20px 16px 16px;
  margin-bottom: 14px;
  background: linear-gradient(160deg, rgba(20,14,40,0.9) 0%, rgba(26,26,46,0.7) 100%);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
}
.ath-tab-title-card::before {
  content: '✦ ✦ ✦';
  position: absolute;
  top: 8px; left: 0; right: 0;
  text-align: center;
  font-size: 0.55rem;
  color: rgba(201,168,76,0.35);
  letter-spacing: 8px;
}
.ath-tab-title-card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 2px;
  margin: 10px 0 4px;
  background: linear-gradient(135deg, #e8d5a3 0%, #c9a84c 50%, #e8d5a3 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.3;
}
.ath-tab-title-card .ath-title-subtitle {
  font-size: 0.78rem;
  color: #7a7a9a;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.ath-tab-title-card .ath-coste-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.8rem;
  color: #c9a84c;
  font-weight: 600;
}

/* ── Ocultar barra coste duplicada en tab consultar ── */
#atheneus-panel[data-active-tab="consultar"] .ath-coste-bar { display: none !important; }

/* ── Header actions (Gratuito/CambioPlan/Cerrar) solo en perfil ── */
#atheneus-panel:not([data-active-tab="perfil"]) .atheneus-header-actions { display: none !important; }

/* Ocultar header entero en Mi Futuro / Compatibilidad (elimina el espacio residual) */
#atheneus-panel[data-active-tab="consultar"] .atheneus-header { display: none !important; }
/* Ocultar banner gemas en pestaña Mi Carta (se accede desde perfil) */
#atheneus-panel[data-active-tab="carta"] #ath-gems-banner { display: none !important; }
/* Ocultar banner gemas en pestaña Mi Carta (se accede desde perfil) */
#atheneus-panel[data-active-tab="carta"] #ath-gems-banner { display: none !important; }

/* ── Tarjetas HTML respuestas Mi Futuro ── */
.ath-futuro-card {
  background: linear-gradient(135deg,rgba(20,14,40,0.85) 0%,rgba(26,26,46,0.7) 100%);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 12px; margin: 10px 0; overflow: hidden;
}
.ath-fc-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: rgba(201,168,76,0.07);
  border-bottom: 1px solid rgba(201,168,76,0.15);
}
.ath-fc-icon { font-size: 1.4rem; flex-shrink: 0; }
.ath-fc-title { color: #c9a84c; font-size: 0.92rem; font-weight: 700; margin: 0; letter-spacing: 0.5px; }
.ath-fc-body { padding: 12px 16px; color: #e8d5a3; font-size: 0.88rem; line-height: 1.6; }
.ath-fc-body p { margin: 0 0 8px; }
.ath-fc-body p:last-child { margin: 0; }
.ath-fc-body strong { color: #c9a84c; }

/* ── Historial Mi Futuro acordeón ── */
.ath-hist-futuro-wrap { margin: 16px 0 8px; }
.ath-hist-futuro-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 16px; cursor: pointer;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(155,232,176,0.2);
  border-radius: 10px; color: #9BE8B0;
  font-size: 0.85rem; font-weight: 600;
  user-select: none; transition: background .2s;
}
.ath-hist-futuro-toggle:hover { background: rgba(155,232,176,0.06); }
.ath-hist-futuro-arrow { transition: transform .25s; }
.ath-hist-futuro-wrap.open .ath-hist-futuro-arrow { transform: rotate(90deg); }
.ath-hist-futuro-body {
  display: none; margin-top: 6px;
  border: 1px solid rgba(155,232,176,0.15);
  border-radius: 10px; overflow: hidden;
}
.ath-hist-futuro-wrap.open .ath-hist-futuro-body { display: block; }
.ath-hist-item-futuro { border-bottom: 1px solid rgba(255,255,255,0.06); padding: 12px 16px; }
.ath-hist-item-futuro:last-child { border-bottom: none; }
.ath-hist-q { font-size: 0.78rem; color: #7a7a9a; margin-bottom: 8px; font-style: italic; }
.ath-hist-q::before { content: '💬 '; }

/* ── Modal historial compat ── */
#ath-hist-modal { animation: ath-modal-in 0.2s ease; }
@keyframes ath-modal-in { from { opacity:0; } to { opacity:1; } }
.ath-compat-hist-summary {
  cursor: pointer;
  list-style: none;
  padding: 11px 16px;
  font-size: 0.88rem;
  color: #e8d5a3;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ath-compat-hist-summary::before { content: '🔮'; font-size: 0.9rem; }
.ath-compat-hist-summary::after { content: '→'; margin-left:auto; color:#c9a84c; font-size:0.75rem; }
.ath-compat-hist-item { border-bottom: 1px solid rgba(255,255,255,0.06); }
.ath-compat-hist-item:last-child { border-bottom: none; }
.ath-compat-hist-item[open] > summary { color: #c9a84c; }

/* Ocultar historial Mi Futuro cuando está en modo compatibilidad */
#atheneus-tab-consultar[data-modo="compat"] .ath-hist-futuro-wrap,
#atheneus-tab-consultar[data-modo="compat"] #ath-hist-futuro-details { display: none !important; }


/* Ocultar chat-box cuando está vacío (historial movido al acordeón) */
#atheneus-messages-carta:empty { display: none !important; }
#atheneus-messages-carta { min-height: 0 !important; }

/* Desktop: ocultar nav de tabs originales y usar el mismo estilo limpio */
@media (min-width: 768px) {
  .atheneus-tabs-nav { display: none !important; }
  #atheneus-panel { padding-top: 0; }
  .ath-tab-title-card h2 { font-size: 1.8rem; }
}

/* T4: Zona de mensajes - sin espacio vacío negro */
#atheneus-messages-carta { 
  min-height: 0 !important; 
  background: transparent !important;
}
#atheneus-messages-carta:empty { display: none !important; }
.atheneus-chat-panel { background: transparent !important; }
.atheneus-consultar-content { background: transparent !important; }

/* T5: Desktop — ocultar tabs originales, usar diseño unificado */
@media (min-width: 768px) {
  .atheneus-tabs-nav { display: none !important; }
  
  /* Barra de navegación en desktop arriba (como móvil pero horizontal) */
  #ath-bottom-nav {
    display: flex !important;
    position: sticky;
    top: 0;
    bottom: auto !important;
    height: 52px;
    box-shadow: 0 3px 16px rgba(0,0,0,0.5);
  }
  #ath-bottom-nav .ath-bn-item { 
    flex-direction: row;
    gap: 6px;
    padding: 6px 12px;
  }
  #ath-bottom-nav .ath-bn-icon { font-size: 16px; }
  #ath-bottom-nav .ath-bn-label { font-size: 11px; }
  #atheneus-panel { padding-bottom: 0 !important; padding-top: 52px !important; }
}

/* Desktop: nav fija arriba con estilo móvil */
@media (min-width: 768px) {
  #ath-bottom-nav {
    position: fixed !important;
    top: 0 !important;
    bottom: auto !important;
    left: 0 !important;
    right: 0 !important;
    height: 54px;
    z-index: 99999;
    box-shadow: 0 3px 16px rgba(0,0,0,0.6) !important;
  }
  #ath-bottom-nav .ath-bn-item {
    flex-direction: row !important;
    gap: 7px;
    padding: 6px 16px;
  }
  #ath-bottom-nav .ath-bn-icon { font-size: 17px; }
  #ath-bottom-nav .ath-bn-label { font-size: 12px; font-weight: 600; }
  #atheneus-panel { padding-top: 60px !important; padding-bottom: 0 !important; }
}

/* Revertir desktop: ocultar nav móvil, restaurar tabs originales y padding */
@media (min-width: 768px) {
  #ath-bottom-nav { display: none !important; }
  .atheneus-tabs-nav { display: flex !important; }
  #atheneus-panel { padding-top: 0 !important; }
}

/* Desktop: nav moderna dentro del panel (debajo del header de Elementor) */
@media (min-width: 768px) {
  #ath-bottom-nav {
    display: flex !important;
    position: sticky !important;
    top: 0 !important;
    bottom: auto !important;
    height: 52px;
    z-index: 100;
    box-shadow: 0 3px 14px rgba(0,0,0,0.5) !important;
  }
  #ath-bottom-nav .ath-bn-item {
    flex-direction: row !important;
    gap: 7px;
    padding: 6px 16px;
  }
  #ath-bottom-nav .ath-bn-icon { font-size: 17px; }
  #ath-bottom-nav .ath-bn-label { font-size: 12px; font-weight: 600; }
  .atheneus-tabs-nav { display: none !important; }
  #atheneus-panel { padding-top: 0 !important; }
}
/* Ocultar banner gemas en pestaña Interpretación */
#atheneus-panel[data-active-tab="interpretacion"] #ath-gems-banner { display: none !important; }
/* Fix overflow horizontal en iOS (pestaña Perfil) */
#atheneus-tab-perfil,
#atheneus-tab-perfil * {
  max-width: 100% !important;
  box-sizing: border-box !important;
}
#atheneus-tab-perfil input,
#atheneus-tab-perfil select,
#atheneus-tab-perfil textarea {
  width: 100% !important;
  max-width: 100% !important;
  -webkit-appearance: none;
}
#atheneus-tab-perfil .ath-telefono-card,
#atheneus-tab-perfil .atheneus-perfil-bloque,
#atheneus-tab-perfil .ath-acordeon {
  overflow: hidden !important;
  width: 100% !important;
}

/* Botón Google OAuth */
.ath-google-btn-wrap { margin: 16px 0; text-align: center; }
.ath-google-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: box-shadow 0.2s, background 0.2s;
  font-family: -apple-system, sans-serif;
  width: 100%;
  justify-content: center;
  max-width: 320px;
}
.ath-google-btn:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  background: #f8f9fa;
}

/* Botón Google login — más grande y prominente */
#ath-tab-login .ath-google-btn {
  padding: 14px 24px !important;
  font-size: 1rem !important;
  border-radius: 10px !important;
  max-width: 100% !important;
  border: 2px solid #dadce0 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  margin-bottom: 4px;
}
#ath-tab-login .ath-google-btn svg { width: 22px; height: 22px; }
#ath-tab-login .ath-google-btn-wrap { margin: 20px 0 8px; }

/* Botón Google con imagen PNG */
.ath-google-btn-img {
  display: block;
  margin: 16px auto;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  text-align: center;
}
.ath-google-btn-img img {
  max-width: 220px;
  height: auto;
  display: block;
  margin: 0 auto;
}
.ath-google-btn-img:hover { opacity: 0.85; transform: scale(1.02); }

/* ===== V8 Anomalía Q — fix overflow tarjeta superior perfil/header ===== */
.ath-onboarding-banner,
.atheneus-header,
.atheneus-header-info,
.atheneus-header-actions {
    max-width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
    overflow: hidden;
}
.ath-onboarding-banner > *,
.atheneus-header > *,
.atheneus-header-info > *,
.atheneus-header-actions > * {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
.ath-onboarding-btn {
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
    box-sizing: border-box;
    text-align: center;
    line-height: 1.2;
}
.atheneus-header-title {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.atheneus-upgrade-link,
.atheneus-manage-sub-link,
.atheneus-logout-btn,
.atheneus-badge {
    white-space: nowrap;
    flex-shrink: 0;
}
@media (max-width: 480px) {
    .ath-onboarding-banner {
        flex-direction: column;
        align-items: stretch !important;
        gap: 8px !important;
    }
    .ath-onboarding-banner > div {
        width: 100%;
        justify-content: center;
    }
    .atheneus-header {
        flex-wrap: wrap;
        gap: 6px;
    }
    .atheneus-header-actions {
        flex-wrap: wrap;
        gap: 6px;
    }
    .ath-onboarding-btn {
        font-size: 0.72rem !important;
        padding: 6px 10px !important;
    }
}
/* ===== /fin parche overflow ===== */

/* ===== V8 Anomalía Q v2 — fix overflow definitivo banner gemas ===== */
.ath-onboarding-banner {
    flex-wrap: wrap !important;
    overflow: hidden !important;
    max-width: 100% !important;
}
.ath-onboarding-banner > div {
    flex-wrap: wrap !important;
    max-width: 100% !important;
    min-width: 0 !important;
}
@media (max-width: 600px) {
    .ath-onboarding-banner {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .ath-onboarding-banner > div {
        width: 100% !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
    }
    .ath-onboarding-btn {
        flex: 1 1 auto !important;
        font-size: 0.7rem !important;
        padding: 6px 8px !important;
        white-space: normal !important;
    }
    .ath-onboarding-banner a[href*="planes"] {
        flex: 1 1 auto !important;
        text-align: center !important;
        font-size: 0.7rem !important;
        padding: 6px 8px !important;
    }
    /* Cupón row también puede desbordar */
    .ath-cupon-row,
    .ath-banner-row1,
    .ath-banner-row2 {
        flex-wrap: wrap !important;
        max-width: 100% !important;
    }
    .ath-cupon-field {
        min-width: 0 !important;
        flex: 1 1 100px !important;
        max-width: 100% !important;
    }
}
/* ===== /fin overflow v2 ===== */
