/* ==========================================================================
   ESTILOS DE MENÚ DE NAVEGACIÓN CLAYMÓRFICO (UNIFICADO Y REFLUIDO)
   ========================================================================== */

.clay-navbar {
    background-color: #ffffff !important;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.08),
        inset 0 -2px 4px rgba(0, 0, 0, 0.03);
    border-bottom: 2px solid rgba(227, 6, 19, 0.1);
    backdrop-filter: none !important;
    transition: all 0.3s ease;
}

.clay-brand-capsule {
    background: #ffffff;
    border-radius: 50rem;
    padding: 0.3rem 1rem;
    box-shadow:
        6px 8px 16px rgba(0, 0, 0, 0.08),
        inset -3px -4px 6px rgba(0, 0, 0, 0.06),
        inset 3px 4px 6px rgba(255, 255, 255, 0.9);
    transition: transform 0.25s ease;
}

.clay-brand-capsule:hover {
    transform: scale(1.02);
}

/* Reducción proporcional del logo para evitar empalme de 2-3 filas */
.navbar-logo-img {
    height: 65px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.clay-brand-capsule:hover .navbar-logo-img {
    transform: scale(1.04);
}

.clay-toggler {
    background: var(--pt-amarillo, #FFCC00);
    border-radius: 50rem;
    box-shadow:
        4px 6px 12px rgba(0, 0, 0, 0.15),
        inset -2px -3px 6px rgba(0, 0, 0, 0.15),
        inset 2px 3px 6px rgba(255, 255, 255, 0.8);
}

/* ==========================================================================
   HOMOLOGACIÓN Y DISTRIBUCIÓN DE ENLACES EN FILAS (DESKTOP)
   ========================================================================== */

@media (min-width: 992px) {

    /* Permitir que la lista fluya en 2 o 3 filas si hay demasiados botones */
    .navbar-nav {
        flex-wrap: wrap !important;
        justify-content: flex-end;
        max-width: 82vw;
        row-gap: 6px;
    }
}

/* Estilo base uniforme para todos los botones de navegación */
.clay-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.75rem !important;
    font-size: 0.68rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px;
    border-radius: 12px !important;
    color: var(--clay-dark, #2B2627) !important;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    border: 1px solid transparent;
}

/* Estado al pasar el cursor (Hover) */
.clay-nav-btn:hover {
    background: rgba(227, 6, 19, 0.08) !important;
    color: var(--pt-rojo, #E30613) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* Estado Activo */
.clay-nav-btn.active {
    background: rgba(227, 6, 19, 0.12) !important;
    color: var(--pt-rojo, #E30613) !important;
    border: 1px solid rgba(227, 6, 19, 0.2);
}

/* Homologación del botón de acción destacado (Pago de Predial) */
.clay-nav-btn-highlight {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.9rem !important;
    font-size: 0.68rem !important;
    font-weight: 800 !important;
    border-radius: 12px !important;
    white-space: nowrap;
}

/* ==========================================================================
   ESTILOS PARA SUBMENÚS Y DESPLEGABLES LARGOS
   ========================================================================== */

/* Menú principal desplegable */
.clay-dropdown-menu {
    background-color: #ffffff !important;
    border-radius: 16px !important;
    padding: 0.5rem 0 !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12) !important;
    border: 1px solid rgba(227, 6, 19, 0.15) !important;
}

.clay-dropdown-menu .dropdown-item {
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    color: #2B2627 !important;
    padding: 0.5rem 1.15rem !important;
    transition: all 0.2s ease !important;
}

.clay-dropdown-menu .dropdown-item:hover {
    background-color: rgba(227, 6, 19, 0.08) !important;
    color: var(--pt-rojo, #E30613) !important;
    padding-left: 1.35rem !important;
}

/* Scroll interno para submenús extensos (ej. Servicios Municipales) */
.scrollable-menu {
    max-height: 360px;
    overflow-y: auto;
}

.scrollable-menu::-webkit-scrollbar {
    width: 5px;
}

.scrollable-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.scrollable-menu::-webkit-scrollbar-thumb {
    background: var(--pt-rojo, #E30613);
    border-radius: 10px;
}

/* Submenús flotantes en Escritorio (DESPLIEGUE HACIA LA IZQUIERDA) */
@media (min-width: 992px) {
    .dropdown-submenu {
        position: relative;
    }

    .dropdown-submenu .clay-dropdown-sub {
        top: 0;
        right: 100%;
        /* Desplaza hacia la izquierda */
        left: auto;
        /* Desactiva el lado derecho */
        margin-top: -6px;
        margin-right: 2px;
        display: none;
        position: absolute;
        background-color: #ffffff;
        border-radius: 16px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
        border: 1px solid rgba(227, 6, 19, 0.15);
        padding: 0.5rem 0;
        min-width: 220px;
    }

    .dropdown-submenu:hover>.clay-dropdown-sub {
        display: block;
    }

    /* Flecha indicadora apuntando a la izquierda */
    .dropdown-submenu>.dropdown-toggle-custom::before {
        content: "\f104";
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        float: left;
        margin-right: 8px;
        color: #888;
    }
}

/* Adaptación para Dispositivos Móviles */
@media (max-width: 991px) {
    .navbar-logo-img {
        height: 45px;
    }

    .navbar-collapse {
        background-color: #ffffff;
        padding: 1.25rem;
        border-radius: 18px;
        margin-top: 0.5rem;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
        max-height: 80vh;
        overflow-y: auto;
    }

    .clay-nav-btn {
        width: 100%;
        justify-content: flex-start;
        padding: 0.65rem 1rem !important;
    }

    .clay-dropdown-menu {
        border: none !important;
        box-shadow: none !important;
        padding-left: 0.75rem !important;
        background-color: transparent !important;
    }

    .dropdown-submenu .clay-dropdown-sub {
        display: block;
        position: static;
        background-color: rgba(0, 0, 0, 0.03);
        border-radius: 12px;
        border: none;
        margin: 0.25rem 0 0.5rem 1rem;
        padding: 0.25rem 0;
    }

    .dropdown-submenu>.dropdown-toggle-custom {
        font-weight: 800 !important;
        color: var(--pt-rojo, #E30613) !important;
    }
}