/**
 * ==========================================================================
 * LE COMPTOIR DES ESSENCES — PANEL LATERAL DE SALAS (#rooms-nav-drawer)
 * Alta Perfumería D2C — Ceremonia de Exploración en 2 Tiempos (Atmósferas)
 * Canónico: Oro Corporativo #D4AF37 | Tipografías Cinzel & Montserrat
 * Refuerzo de Especificidad e Inmunidad Estilística (#rooms-nav-drawer)
 * Vitrina de Lujo con Relieve Tridimensional y Barrido Lumínico Áureo
 * ==========================================================================
 */

/* 1. TELÓN DE FONDO CON DESENFOQUE CINEMÁTICO */
#rooms-nav-drawer,
.rooms-drawer-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99980;
    background: rgba(6, 6, 5, 0.78);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    display: none;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

#rooms-nav-drawer:not(.is-open),
.rooms-drawer-overlay:not(.is-open) {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

#rooms-nav-drawer:not(.is-open) *,
.rooms-drawer-overlay:not(.is-open) * {
    pointer-events: none !important;
    visibility: hidden !important;
}

#rooms-nav-drawer.is-open,
.rooms-drawer-overlay.is-open {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* 2. PANEL DESLIZANTE DESDE LA IZQUIERDA */
#rooms-nav-drawer .rooms-drawer-panel,
.rooms-drawer-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: clamp(320px, 86vw, 410px);
    height: 100vh;
    z-index: 99985;
    background: linear-gradient(180deg, rgba(20, 18, 16, 0.98) 0%, rgba(12, 11, 10, 0.99) 100%);
    border-right: 1px solid rgba(212, 175, 55, 0.35);
    box-shadow: 12px 0 45px rgba(0, 0, 0, 0.95), 
                inset -1px 0 0 rgba(212, 175, 55, 0.15),
                0 0 30px rgba(212, 175, 55, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    box-sizing: border-box;
}

#rooms-nav-drawer.is-open .rooms-drawer-panel {
    transform: translateX(0);
}

/* 3. CABECERA INSTITUCIONAL DEL DRAWER */
#rooms-nav-drawer .rooms-drawer-header {
    padding: 14px 20px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    flex-shrink: 0;
}

#rooms-nav-drawer .rooms-drawer-eyebrow {
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: 'Montserrat', sans-serif;
    font-size: 9.5px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #D4AF37;
    font-weight: 600;
}

#rooms-nav-drawer .rooms-drawer-gem {
    color: #D4AF37;
    font-size: 8.5px;
    animation: drawerGemGlow 2.8s ease-in-out infinite;
}

@keyframes drawerGemGlow {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.8)); }
}

#rooms-nav-drawer .rooms-drawer-close-btn {
    background: transparent;
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: #D4AF37;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    padding: 0;
    flex-shrink: 0;
}

#rooms-nav-drawer .rooms-drawer-close-btn:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: #D4AF37;
    color: #FFFFFF;
    transform: rotate(90deg);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

/* 4. BLOQUE DE TÍTULO PRINCIPAL */
#rooms-nav-drawer .rooms-drawer-title-block {
    padding: 14px 20px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
}

#rooms-nav-drawer .rooms-drawer-title {
    margin: 0 0 4px 0;
    font-family: 'Cinzel', serif;
    font-size: 17.5px;
    font-weight: 600;
    letter-spacing: 2px;
    color: #D4AF37;
    text-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
    line-height: 1.25;
}

#rooms-nav-drawer .rooms-drawer-subtitle {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    color: #A0988E;
    line-height: 1.4;
    letter-spacing: 0.3px;
}

/* 5. BLOQUE NOBLE DE RETORNO: SALA PRINCIPAL / EL MAESTRO BOTICARIO */
#rooms-nav-drawer .rooms-drawer-main-hall {
    padding: 10px 18px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.18);
    background: rgba(14, 12, 10, 0.6);
    flex-shrink: 0;
}

/* 1. BOTÓN DE RETORNO CON EFECTO BARRIDO CONTINUO (LUEUR DORÉE) */
#rooms-nav-drawer .btn-return-main-hall,
#rooms-nav-drawer #btn-return-main-hall {
    position: relative !important;
    overflow: hidden !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    background: linear-gradient(135deg, rgba(25, 22, 18, 0.85) 0%, rgba(15, 13, 11, 0.95) 100%) !important;
    border: 1px solid rgba(212, 175, 55, 0.55) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(212, 175, 55, 0.3) !important;
    padding: 10px 16px !important;
    border-radius: 4px !important;
    color: #D4AF37 !important;
    font-family: 'Cinzel', serif !important;
    font-size: 11px !important;
    letter-spacing: 0.14em !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
}

/* Haz de luz áureo en barrido infinito */
#rooms-nav-drawer .btn-return-main-hall::after,
#rooms-nav-drawer #btn-return-main-hall::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 60%;
    height: 100%;
    background: linear-gradient(105deg, transparent 20%, rgba(212, 175, 55, 0.22) 50%, transparent 80%);
    animation: returnHaloSweep 4.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes returnHaloSweep {
    0% {
        left: -150%;
    }
    40%, 100% {
        left: 150%;
    }
}

#rooms-nav-drawer .btn-return-main-hall:hover,
#rooms-nav-drawer #btn-return-main-hall:hover {
    background: linear-gradient(135deg, rgba(35, 30, 24, 0.9) 0%, rgba(20, 17, 14, 0.98) 100%) !important;
    border-color: #D4AF37 !important;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.35), inset 0 1px 0 rgba(212, 175, 55, 0.4) !important;
    transform: translateY(-1px);
}

#rooms-nav-drawer .return-main-hall-left {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

#rooms-nav-drawer .return-arrow-icon {
    color: #D4AF37 !important;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

#rooms-nav-drawer .btn-return-main-hall:hover .return-arrow-icon {
    transform: translateX(-3px);
}

#rooms-nav-drawer .return-main-hall-text {
    font-family: 'Cinzel', serif !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: 0.14em !important;
    color: #D4AF37 !important;
    text-transform: uppercase;
}

#rooms-nav-drawer .return-main-hall-tag {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 8.5px !important;
    letter-spacing: 1px !important;
    color: #A0988E !important;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

/* Indicador de Sala Principal Activa (cuando el usuario está en El Maestro Boticario) */
#rooms-nav-drawer .rooms-drawer-main-hall-item.is-current-hall {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(25, 22, 18, 0.85) 0%, rgba(15, 13, 11, 0.95) 100%);
    border: 1px solid #D4AF37;
    border-radius: 4px;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.25), inset 0 1px 0 rgba(212, 175, 55, 0.3);
    box-sizing: border-box;
}

#rooms-nav-drawer .is-current-hall .main-hall-content {
    display: flex;
    align-items: center;
    gap: 7px;
}

#rooms-nav-drawer .is-current-hall .main-hall-icon {
    color: #D4AF37;
    font-size: 9.5px;
}

#rooms-nav-drawer .is-current-hall .main-hall-label {
    font-family: 'Cinzel', serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: #D4AF37;
}

#rooms-nav-drawer .is-current-hall .main-hall-badge {
    font-family: 'Montserrat', sans-serif;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #0A0A0A;
    background: #D4AF37;
    padding: 2px 6px;
    border-radius: 2px;
    text-transform: uppercase;
}

/* 6. LISTA DE SALAS COMPACTA */
#rooms-nav-drawer .rooms-drawer-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 12px 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
}

/* Scroll estilizado en oro noble */
#rooms-nav-drawer .rooms-drawer-list::-webkit-scrollbar {
    width: 4px;
}

#rooms-nav-drawer .rooms-drawer-list::-webkit-scrollbar-track {
    background: rgba(12, 11, 10, 0.6);
}

#rooms-nav-drawer .rooms-drawer-list::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.25);
    border-radius: 2px;
}

#rooms-nav-drawer .rooms-drawer-list::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.5);
}

/* 7. TARJETAS DE SALA */
#rooms-nav-drawer .rooms-drawer-card {
    background: linear-gradient(180deg, rgba(22, 19, 16, 0.7) 0%, rgba(12, 10, 8, 0.85) 100%) !important;
    border: 1px solid rgba(212, 175, 55, 0.25) !important;
    border-radius: 4px;
    padding: 12px 15px;
    transition: all 0.35s ease !important;
    position: relative;
    box-sizing: border-box;
}

/* 3. TARJETAS DE SALAS INACTIVAS (MISTERIO CON RELIEVE) */
#rooms-nav-drawer .rooms-drawer-card:not(.is-current) {
    background: linear-gradient(180deg, rgba(22, 19, 16, 0.7) 0%, rgba(12, 10, 8, 0.85) 100%) !important;
    border: 1px solid rgba(212, 175, 55, 0.25) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(212, 175, 55, 0.15) !important;
    transition: all 0.35s ease !important;
}

#rooms-nav-drawer .rooms-drawer-card:not(.is-current):hover {
    border-color: rgba(212, 175, 55, 0.75) !important;
    background: linear-gradient(180deg, rgba(32, 27, 22, 0.85) 0%, rgba(16, 14, 11, 0.95) 100%) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 12px rgba(212, 175, 55, 0.2) !important;
    transform: translateX(3px) !important;
}

/* 2. SALA ACTUAL (TRIDIMENSIONALIDAD Y PEDESTAL WOW) */
#rooms-nav-drawer .rooms-drawer-card.is-current {
    background: radial-gradient(ellipse at top, rgba(212, 175, 55, 0.12) 0%, rgba(18, 15, 12, 0.95) 75%) !important;
    border: 1px solid #D4AF37 !important;
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.28), inset 0 1px 1px rgba(212, 175, 55, 0.5), inset 0 0 16px rgba(212, 175, 55, 0.08) !important;
}

#rooms-nav-drawer .rooms-drawer-card.is-current:hover {
    transform: none;
    border-color: #D4AF37 !important;
    box-shadow: 0 0 28px rgba(212, 175, 55, 0.38), inset 0 1px 1px rgba(212, 175, 55, 0.6), inset 0 0 18px rgba(212, 175, 55, 0.12) !important;
}

/* Fila de estado de la sala actual */
#rooms-nav-drawer .room-card-status-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 5px;
}

#rooms-nav-drawer .room-current-badge {
    font-family: 'Montserrat', sans-serif;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #0A0A0A;
    background: #D4AF37;
    padding: 2px 6px;
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

/* Título de sala */
#rooms-nav-drawer .room-card-title {
    margin: 0 0 3px 0;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #F4F0EC;
    line-height: 1.25;
}

#rooms-nav-drawer .rooms-drawer-card.is-current .room-card-title {
    color: #FFFFFF;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.35);
}

/* Descripción olfativa */
#rooms-nav-drawer .room-card-desc {
    margin: 0 0 9px 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 10.5px;
    color: #A0988E;
    line-height: 1.35;
}

/* Acciones en la tarjeta */
#rooms-nav-drawer .room-card-actions {
    display: flex;
    align-items: center;
    width: 100%;
}

/* Botones de acción dentro de la tarjeta */
#rooms-nav-drawer .btn-room-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 12px;
    border-radius: 2px;
    font-family: 'Montserrat', sans-serif;
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    box-sizing: border-box;
}

/* 2. BOTÓN VER CREACIONES DE ESTA SALA (Pedestal Wow Dorado) */
#rooms-nav-drawer .btn-primary-gold,
#rooms-nav-drawer .rooms-drawer-card.is-current .btn-open-creations,
#rooms-nav-drawer .rooms-drawer-card.is-current .btn-primary-gold {
    background: linear-gradient(135deg, #e3c45d 0%, #D4AF37 50%, #aa851c 100%) !important;
    color: #000000 !important;
    font-weight: 700 !important;
    letter-spacing: 0.12em !important;
    border: 1px solid #F3E5AB !important;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
    text-shadow: none !important;
    padding: 9px 12px;
}

#rooms-nav-drawer .btn-primary-gold:hover,
#rooms-nav-drawer .rooms-drawer-card.is-current .btn-open-creations:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
    transform: translateY(-1px);
}

#rooms-nav-drawer .btn-primary-gold:active,
#rooms-nav-drawer .rooms-drawer-card.is-current .btn-open-creations:active {
    transform: translateY(0);
}

/* Botón Viajar a otra sala: Sobrio y Elegante */
#rooms-nav-drawer .btn-travel-room {
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: #F4F0EC;
}

#rooms-nav-drawer .btn-travel-room:hover {
    background: rgba(212, 175, 55, 0.22);
    border-color: #D4AF37;
    color: #FFFFFF;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.25);
    transform: translateY(-1px);
}

/* 8. PIE DE PÁGINA DEL DRAWER */
#rooms-nav-drawer .rooms-drawer-footer {
    padding: 12px 20px;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
    text-align: center;
    flex-shrink: 0;
    background: rgba(10, 9, 8, 0.6);
}

#rooms-nav-drawer .rooms-drawer-signature {
    font-family: 'Cinzel', serif;
    font-size: 9px;
    letter-spacing: 2px;
    color: #8C8479;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#rooms-nav-drawer .rooms-drawer-dot {
    color: #D4AF37;
    font-size: 10px;
}

/* Responsive */
@media (max-width: 480px) {
    #rooms-nav-drawer .rooms-drawer-panel,
    .rooms-drawer-panel {
        width: 100vw;
    }
}
