﻿/* --- ESTILOS GENERALES --- */
body {
    background-color: #f8f9fa;
}

.body-content {
    margin-top: 15px;
    padding-left: 15px;
    padding-right: 15px;
}

@media screen and (min-width: 768px) {
    .body-content {
        padding: 0;
    }
}

/* --- COMPONENTES DE FORMULARIO --- */
.text-uppercase {
    text-transform: uppercase;
}

    /* Opcional: Para que el placeholder también se vea profesional */
    .text-uppercase::placeholder {
        text-transform: none; /* Mantiene el ejemplo "Ej. admin" en minúsculas si prefieres */
    }

/* --- BARRA ADMINISTRATIVA (NEGRA / PRIVADA) --- */
.bg-dark {
    background-color: #212529 !important;
    position: relative;
    z-index: 1050;
    overflow: visible !important;
}

.nav-admin-custom {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    overflow: visible !important;
}

    .nav-admin-custom .nav-item .nav-link {
        color: #ffffff !important;
        font-size: 0.82rem;
        padding: 8px 12px !important;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-weight: 500;
        transition: 0.3s;
    }

    .nav-admin-custom .nav-item.dropdown:hover > .nav-link {
        background-color: #000000 !important;
        color: #ffc107 !important;
        border-radius: 4px 4px 0 0;
    }

/* Ajuste para que todos los dropdowns del Panel Operativo (incluyendo el usuario) sean amarillos */
#pnlAdminBar .dropdown-menu {
    background-color: #ffc107 !important;
    border-top: 3px solid #cc9a06 !important;
}

#pnlAdminBar .dropdown-item {
    color: #212529 !important;
    font-weight: 600;
}

    #pnlAdminBar .dropdown-item:hover {
        background-color: #212529 !important;
        color: #ffc107 !important;
        transform: translateX(5px);
    }

/* --- NAVBAR PRINCIPAL (AMARILLA / PÚBLICA) --- */
.navbar-custom {
    background-color: #ffde59 !important;
    border-bottom: 3px solid #ffc107;
    padding: 0.5rem 1rem;
    position: relative;
    z-index: 1000;
    min-height: auto !important;
}

    /* Unificar links del menú público y quitar negritas excesivas */
    .navbar-custom .nav-link {
        color: #4e4a39 !important;
        font-weight: 500 !important;
        transition: all 0.3s ease;
        padding: 8px 15px !important;
        border-radius: 8px;
    }

        /* Efecto Hover Unificado para Menú Público */
        .navbar-custom .nav-item:hover > .nav-link,
        .navbar-custom .nav-link:hover {
            background-color: #4e4a39 !important;
            color: #ffde59 !important;
            transform: translateY(-2px);
        }

    .navbar-custom .dropdown-menu {
        background-color: #ffde59 !important;
        border-top: 3px solid #ffc107;
        margin-top: -1px !important;
    }

    .navbar-custom .dropdown-item {
        color: #4e4a39 !important;
        font-weight: 600;
    }

        .navbar-custom .dropdown-item:hover {
            background-color: #4e4a39 !important;
            color: #ffde59 !important;
            transform: translateX(5px);
        }

/* --- LÓGICA DE HOVER Y POSICIONAMIENTO --- */
@media (min-width: 992px) {
    .nav-item.dropdown:hover > .dropdown-menu {
        display: block;
    }

    .nav-admin-custom .nav-item.dropdown:hover > .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
    }

    .dropdown-menu::before {
        content: "";
        position: absolute;
        top: -10px;
        left: 0;
        width: 100%;
        height: 10px;
        background: transparent;
    }
}

/* --- DROPDOWNS GENERALES (ESTRUCTURA) --- */
.dropdown-menu {
    border: none;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    padding: 0.3rem;
    min-width: 200px !important;
    margin-top: 0 !important;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: 0.2s;
    font-size: 0.9rem;
}

/* --- BOTONES Y CARDS --- */
.btn-KermesDigital {
    --bs-btn-bg: #ffc107;
    --bs-btn-border-color: #4e4a39;
    --bs-btn-hover-bg: #4e4a39;
    --bs-btn-hover-color: #ffc107;
    color: #4e4a39;
}

.card-dashboard {
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: none;
}

/* --- AJUSTES PARA MÓVIL (MODO ESTRECHO) --- */
@media (max-width: 991.98px) {
    #navAdminCollapse {
        background-color: #212529;
        padding: 15px;
        border-radius: 0 0 10px 10px;
    }

    .nav-admin-custom .nav-link {
        padding: 10px 0 !important;
        border-bottom: 1px solid #333;
    }

    .navbar-brand {
        font-size: 1rem;
        margin-right: 5px;
    }

    .btn-KermesDigital {
        padding: 5px 10px;
        font-size: 0.8rem;
    }

    .offcanvas.offcanvas-start {
        visibility: hidden;
        position: fixed;
        display: flex;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }

        .offcanvas.offcanvas-start.show {
            visibility: visible !important;
            transform: translateX(0);
        }
}

/* --- NUEVOS AJUSTES PARA MENÚ DESLIZANTE (OFFCANVAS) --- */
@media (max-width: 991.98px) {
    .offcanvas-start.navbar-custom {
        background-color: #ffde59 !important;
        border-right: 3px solid #ffc107;
        width: 280px !important;
        z-index: 1100;
        visibility: hidden;
    }

    .offcanvas-header {
        background-color: #ffde59 !important;
        border-bottom: 2px solid #ffc107;
        padding: 1rem;
    }

    /* Estilo base de los links en móvil */
    #offcanvasPublic .nav-link {
        font-weight: 500 !important; /* Unificado con el resto */
        color: #4e4a39 !important;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        padding: 12px 15px;
        font-size: 1rem;
        transition: all 0.3s ease;
        border-radius: 8px;
        margin: 2px 10px;
    }

        /* FIX: Hover en móvil para que no se pierda el texto */
        #offcanvasPublic .nav-link:hover,
        #offcanvasPublic .nav-link:active {
            background-color: #4e4a39 !important; /* Fondo oscuro */
            color: #ffde59 !important; /* Texto amarillo brillante */
            transform: translateX(5px); /* Efecto de desplazamiento lateral */
        }
}

/* --- LÓGICA DE ESCRITORIO PARA OFFCANVAS --- */
@media (min-width: 992px) {
    .offcanvas {
        position: static !important;
        display: flex !important;
        flex-direction: row !important;
        width: auto !important;
        background: none !important;
        border: none !important;
        visibility: visible !important;
        transform: none !important;
    }

    .offcanvas-header {
        display: none;
    }

    .offcanvas-body {
        padding: 0;
        display: flex;
    }
}

/* Limpieza y visibilidad condicional */
#offcanvasPublic:empty {
    display: none !important;
}

#offcanvasPublic:has(> [id*='pnlOffcanvasContent']:not([style*='display: none'])) {
    visibility: visible !important;
}

/* --- AJUSTE MENÚ DE USUARIO FLOTANTE (MÓVIL) --- */
@media (max-width: 991.98px) {
    .navbar-nav.flex-row {
        position: relative !important;
    }

    .user-dropdown-custom {
        position: absolute !important;
        right: 0 !important;
        left: auto !important;
        top: 40px !important;
        width: 180px;
        z-index: 3000 !important;
        background-color: #ffc107;
        margin: 0 !important;
    }

        .user-dropdown-custom .dropdown-item {
            color: #000 !important;
            font-weight: 600;
            padding: 8px 15px !important;
        }
}