/* ===================== SIDEBAR LADY TAP (FINAL CON TOOLTIPS) ===================== */

:root{
  --sb-width-closed: 70px; 
  --sb-width-open: 240px;
  --sb-bg-1: var(--lt-bg1, #1c0f2a);
  --sb-bg-2: var(--lt-bg2, #10071a);
  --sb-accent: var(--lt-accent, #b164f7);
  --sb-border: var(--lt-border, #9b5de5);
  --sb-text: var(--lt-text, #f3e9ff);
  --sb-text-dim: var(--lt-text-dim, #d6c5ff);
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--sb-width-closed);
  background: linear-gradient(180deg, var(--sb-bg-1) 0%, var(--sb-bg-2) 100%);
  border-right: 1px solid rgba(155,93,229,.35);
  padding: 16px 0;
  transition: width 0.3s ease;
  z-index: 2000;
  overflow-y: auto; 
  overflow-x: hidden; /* Esto cortaba los tooltips antiguos */
  box-shadow: 4px 0 10px rgba(0,0,0,0.5);
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar.is-open {
  width: var(--sb-width-open);
}

/* === Header === */
.sidebar-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 8px 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.logo-link { display: block; text-decoration: none; margin-bottom: 12px; }
.logo-container { height: 48px; display: flex; justify-content: center; align-items: center; width: 100%; position: relative; }

.logo-icon { width: 48px; height: auto; opacity: 1; transition: opacity 0.3s ease; position: static; }
.logo-full { width: 100%; max-width: 180px; height: auto; opacity: 0; position: absolute; pointer-events: none; transition: opacity 0.3s ease; }

.sidebar.is-open .logo-full { opacity: 1; position: static; pointer-events: auto; }
.sidebar.is-open .logo-icon { opacity: 0; position: absolute; pointer-events: none; }

.menu-toggle-btn {
  background: rgba(28,15,42,.85); 
  border: 1px solid rgba(155,93,229,.45);
  color: var(--sb-text);
  width: 40px; height: 40px; border-radius: 8px;
  cursor: pointer; font-size: 1.2rem;
  display: flex; justify-content: center; align-items: center;
  transition: all 0.2s;
}
.menu-toggle-btn:hover { background: rgba(155,93,229,.15); box-shadow: 0 0 8px rgba(155,93,229,.5); }
.sidebar > .sidebar-header > .menu-toggle-btn { margin-top: 10px; }

/* === Navegación === */
.sidebar-nav { list-style: none; padding: 0; margin: 0; }
.nav-item { position: relative; margin-bottom: 4px; }

.nav-link {
  display: flex; align-items: center;
  padding: 12px 8px; margin: 0 8px;
  color: var(--sb-text-dim); text-decoration: none;
  white-space: normal; border-radius: 8px;
  transition: background 0.2s, color 0.2s;
  cursor: pointer; /* Importante para indicar interacción */
}

.sidebar:not(.nav-dropdown) > .nav-link { white-space: nowrap; }
.nav-link:hover, .nav-link.is-active { background: rgba(155,93,229,.15); color: var(--sb-text); }

.nav-link i {
  font-size: 1.25rem; width: 30px; text-align: center;
  margin-right: 12px; color: var(--sb-accent); flex-shrink: 0;
}

/* Texto del enlace */
.nav-link span {
  opacity: 0; visibility: hidden; max-width: 0;
  transition: opacity 0.2s ease, max-width 0.3s ease;
  font-weight: 600; display: flex; align-items: center; justify-content: space-between;
  width: 100%; overflow: hidden;
}
.sidebar.is-open .nav-link span { opacity: 1; visibility: visible; max-width: 200px; }

/* Submenú */
.dropdown-menu {
  list-style: none; padding: 0; margin: 0;
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease-in-out;
  background-color: rgba(0,0,0,.2); border-radius: 8px; margin: 0 8px;
}
.nav-dropdown.is-open .dropdown-menu { max-height: 500px; }

.dropdown-menu .nav-link {
  padding: 8px 10px 8px 50px; font-size: 0.9em;
}
.dropdown-menu .nav-link i { font-size: 0.9rem; width: 20px; margin-right: 8px; }

/* FIX Submenú Cerrado */
.sidebar:not(.is-open) .dropdown-menu .nav-link { padding: 10px 0; justify-content: center; }
.sidebar:not(.is-open) .dropdown-menu .nav-link i { margin-right: 0; font-size: 1.1rem; }

/* === TOOLTIP GLOBAL FLOTANTE (NUEVO) === */
#lt-tooltip {
  position: fixed; /* Se mueve libremente por la pantalla */
  z-index: 10000;  /* Por encima de todo */
  background: rgba(22, 10, 35, 0.95);
  border: 1px solid var(--sb-border);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: bold;
  pointer-events: none; /* El ratón lo ignora */
  white-space: nowrap;
  box-shadow: 0 4px 15px rgba(0,0,0,0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
  /* Pequeña flecha a la izquierda */
  transform: translateY(-50%);
}
#lt-tooltip.visible {
  opacity: 1;
  visibility: visible;
}
#lt-tooltip::before {
  content: "";
  position: absolute;
  top: 50%; left: -6px;
  transform: translateY(-50%);
  border-width: 6px 6px 6px 0;
  border-style: solid;
  border-color: transparent var(--sb-border) transparent transparent;
}

/* Responsive */
@media (min-width: 769px) {
    body > .lady-tap-section, body > .cta-section, body > .site-footer, main {
        margin-left: var(--sb-width-closed); width: calc(100% - var(--sb-width-closed)); transition: margin-left 0.3s ease, width 0.3s ease; padding-top: 24px !important; margin-right: auto;
    }
    .sidebar.is-open ~ .lady-tap-section, .sidebar.is-open ~ .cta-section, .sidebar.is-open ~ .site-footer, .sidebar.is-open ~ main {
        margin-left: var(--sb-width-open); width: calc(100% - var(--sb-width-open));
    }
    .lady-tap-section { margin-top: 24px; }
}

@media (max-width: 768px) {
  .sidebar { width: 0; padding: 0; overflow: hidden; }
  .sidebar.is-open { width: var(--sb-width-open); padding: 16px 0; box-shadow: 0 0 30px rgba(0,0,0,0.8); overflow-y: auto; }
  .sidebar-header .menu-toggle-btn { position: absolute; top: 10px; right: 10px; background: transparent; border: none; color: var(--sb-text-dim); font-size: 1.8rem; }
  .sidebar:not(.is-open) .sidebar-header .menu-toggle-btn { position: fixed; top: 16px; left: 16px; z-index: 2001; width: 45px; height: 45px; background: rgba(28,15,42,.95); border: 1px solid rgba(155,93,229,.6); color: var(--sb-accent); font-size: 1.4rem; display: flex; }
  .lady-tap-section, .cta-section, main { padding-top: 80px !important; margin-left: 0 !important; width: 100% !important; }
  
  /* En móvil no mostramos tooltips */
  #lt-tooltip { display: none !important; }
}