﻿/* --- Barra horizontal de categorías/tabs --- */
.nav-categorias-horizontal {
    display: flex;
    gap: 0.7rem;
    border-bottom: 1.5px solid #E6E8ED;
    background: #fff;
    padding-block: 0.5rem 0.3rem;
    padding-inline: 2rem;
    align-items: flex-end;
    position: relative;
    z-index: 10;
    flex-wrap: wrap;
    box-sizing: border-box;
}

/* --- Contenedor dropdown --- */
.categoria-dropdown {
    position: relative;
    display: inline-block;
    width: auto;
    min-width: unset;
    max-width: unset;
    overflow: visible !important;
    vertical-align: top;
}

/* --- Botón principal --- */
.categoria-btn {
    background: none;
    border: none;
    font-weight: 500;
    color: #23428D;
    padding: 0.8rem 1.35rem 0.7rem 1.35rem;
    font-size: 1.07rem;
    cursor: pointer;
    border-radius: 0.7rem 0.7rem 0 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: background 0.13s, color 0.13s;
    text-transform: capitalize;
}

    .categoria-btn.active,
    .categoria-btn:hover,
    .categoria-dropdown:hover .categoria-btn {
        background: #F2F6FF;
        color: #376EB5;
    }

.categoria-flecha {
    display: inline-flex;
    align-items: center;
    margin-left: 0.4rem;
    vertical-align: middle;
}

    .categoria-flecha svg {
        width: 13px;
        height: 13px;
        margin-top: 2px;
    }

/* --- MEGA MENU PRINCIPAL (Dropdown grande) --- */
.mega-dropdown-content {
    position: absolute;
    left: 0;
    top: 100%;
    display: flex;
    background: #fff;
    box-shadow: 0 8px 32px rgba(41,58,111,0.12);
    border-radius: 0 0 0.7rem 0.7rem;
    z-index: 90;
    /*min-width: 420px;*/
    min-width: 800px !important;
    /*width: auto !important;*/
    width: 800px !important;
    /*max-width: unset !important;*/
    max-width: none !important;
    padding: 0.4rem 0;
    overflow: visible !important;
}

/* --- Lista de categorías padre --- */
.mega-categorias-list {
    display: flex;
    flex-direction: column;
    min-width: 230px;
    max-height: 540px;
    overflow-y: auto;
    overflow-x: visible !important;
    padding-right: 0.2rem;
}

/* --- Fila de categoría padre --- */
.mega-cat-item {
    position: relative;
    overflow: visible;
}

/* --- Botón de categoría padre --- */
.mega-cat-link {
    background: none;
    border: none;
    width: 100%;
    color: #23428D;
    text-align: left;
    padding: 0.65rem 1.2rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    gap: 0.33rem;
}

    .mega-cat-link.active,
    .mega-cat-link:hover {
        background: #EDF3FC;
        color: #23428D;
    }

.mega-flecha {
    margin-left: auto;
    display: inline-block;
}

/* --- Submenú lateral de subcategorías --- */
.mega-subcat-list {
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 180px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(41,58,111,0.14);
    border-radius: 0.6rem;
    z-index: 91;
    padding: 0.18rem 0;
    margin-left: 0.6rem;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden !important;
}

/* --- Link de subcategoría --- */
.mega-subcat-link {
    color: #23428D;
    padding: 0.5rem 1.1rem;
    display: block;
    text-decoration: none;
    border-radius: 0.4rem;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background 0.14s, color 0.14s;
    margin: 0.07rem 0;
}

    .mega-subcat-link:hover,
    .mega-subcat-link:focus {
        background-color: #23428D;
        color: #fff;
        outline: none;
    }

/* --- Scrollbars solo vertical, no horizontal nunca --- */
.mega-dropdown-content::-webkit-scrollbar,
.mega-categorias-list::-webkit-scrollbar,
.mega-subcat-list::-webkit-scrollbar {
    width: 7px;
    background: #f0f2fa;
}

.mega-dropdown-content::-webkit-scrollbar-thumb,
.mega-categorias-list::-webkit-scrollbar-thumb,
.mega-subcat-list::-webkit-scrollbar-thumb {
    background: #e1e6ef;
    border-radius: 10px;
}

/* Responsive */
@media (max-width: 900px) {
    .nav-categorias-horizontal {
        flex-direction: column;
        gap: 0;
        padding: 0.4rem 0.3rem;
        align-items: stretch;
    }

    .categoria-btn {
        width: 100%;
        border-radius: 0.6rem;
        text-align: left;
    }

    .mega-dropdown-content {
        position: static;
        flex-direction: column;
        min-width: unset;
        box-shadow: none;
        border-radius: 0 0 1.1rem 1.1rem;
        border: none;
        padding: 0.4rem 0.3rem;
        gap: 0.4rem;
    }

    .mega-subcat-list {
        position: static;
        min-width: unset;
        margin-left: 0;
        box-shadow: none;
        border-radius: 0 0 1.1rem 1.1rem;
        border: none;
        padding: 0.4rem 0.3rem;
        gap: 0.4rem;
    }
}

/* No mostrar por defecto */
.mega-dropdown-content,
.mega-subcat-list {
    display: none;
}

.categoria-dropdown:hover .mega-dropdown-content,
.categoria-dropdown:focus-within .mega-dropdown-content {
    display: flex;
}

.mega-cat-item:hover .mega-subcat-list,
.mega-cat-item:focus-within .mega-subcat-list {
    display: block;
}

.mega-dropdown-content, .mega-subcat-list {
    z-index: 9999 !important;
}

.mega-dropdown-content {
    position: absolute;
    left: 0;
    top: 100%;
    display: flex;
    background: #fff;
    box-shadow: 0 8px 32px rgba(41,58,111,0.12);
    border-radius: 0 0 0.7rem 0.7rem;
    z-index: 90;
    min-width: 420px; /* <- Aumenta el mínimo */
    width: auto !important;
    max-width: 98vw !important;
    padding: 0.4rem 0;
    overflow: visible !important; /* Deja expandir submenús fuera del menú */
}

/* La lista padre de categorías (solo scroll Y si es necesario) */
.mega-categorias-list {
    display: flex;
    flex-direction: column;
    min-width: 260px;
    max-height: 540px;
    overflow-y: auto;
    overflow-x: visible !important; /* Nunca ocultes horizontal acá */
    padding-right: 0.2rem;
}

/* --- Submenú lateral --- */
.mega-subcat-list {
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 180px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(41,58,111,0.14);
    border-radius: 0.6rem;
    z-index: 91;
    padding: 0.18rem 0;
    margin-left: 0.6rem;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
}

 



/* ===--=== Nuevos ccs ===--=== */


/* Asegura que el dropdown “flote” y no empuje el layout */
/* Contenedor principal del dropdown */
.header-dropdown {
    position: relative;
    display: inline-block;
}

/* ------------------------------------------- */
/* --- ESTILOS GENERALES DE BOTONES Y LINKS -- */
/* ------------------------------------------- */
/* Se aplica a todos los botones/links del menú */
.header-dropdown__btn,
.header-dropdown__link,
.header-dropdown__sublink {
    /* Estilos base: sobrio y minimalista */
    background-color: white;
    color: #333;
    border: none;
    cursor: pointer;
    font-weight: 500;
    padding: 10px 15px;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    text-decoration: none; /* Asegura que no haya subrayado en los enlaces */
}

    /* Efecto de línea */
    .header-dropdown__btn::before,
    .header-dropdown__link::before {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 0;
        height: 3px;
        background-color: #23428D;
        transition: width 0.3s ease-in-out;
    }

    /* Estado al pasar el mouse (hover) */
    .header-dropdown__btn:hover::before,
    .header-dropdown__btn.is-active::before,
    .header-dropdown__link:hover::before,
    .header-dropdown__link.is-active::before,
    .header-dropdown__sublink:hover::before {
        width: 100%;
        color:#23428D;
    }

    .header-dropdown__sublink:hover {
        color: #23428D;
    }

.page-link {
    color: #23428D;
}

.page-link:hover {
    color: #23428D;
}

.page-item.active .page-link {
    background-color: #23428D;
    border-color: #23428D;
}
/* Estilos del botón principal específicos */
.header-dropdown__btn {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

    /* Estado activo del botón principal */
    .header-dropdown__btn.is-active {
        background-color: #f0f0f0;
    }

/* Flecha del botón principal */
.header-dropdown__btn-arrow {
    display: flex;
    align-items: center;
}


/* ------------------------------------------- */
/* --- CONTENEDORES Y LISTAS ----------------- */
/* ------------------------------------------- */
.header-dropdown__content {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: max-content;
    height: 700px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    /* Agrega Flexbox al contenedor principal */
    display: flex;
    flex-direction: row;
}

.header-dropdown.is-open .header-dropdown__content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header-dropdown__list {
    list-style: none;
    padding: 8px 0;
    margin: 0;
    min-width: 250px;
    /* Hacemos scroll solo a la lista principal */
    overflow-y: auto;
    height: 100%;
    box-sizing: border-box;
}

/* Mensajes de estado */
.header-dropdown__message {
    font-size: 0.9rem;
    color: #888;
    padding: 10px 15px;
    font-style: italic;
}


/* ------------------------------------------- */
/* --- ITEMS Y SUB-LISTAS -------------------- */
/* ------------------------------------------- */
.header-dropdown__item {
    position: relative;
}

    .header-dropdown__item .header-dropdown__link {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 10px 15px;
    }

        .header-dropdown__item .header-dropdown__link:hover {
            background-color: #f0f0f0;
        }

.header-dropdown__link-arrow {
    display: flex;
    align-items: center;
    margin-left: auto;
    transition: transform 0.3s ease;
}

.header-dropdown__item .header-dropdown__link.is-active .header-dropdown__link-arrow {
    transform: rotate(90deg);
}

.header-dropdown__sublist {
    min-width: 250px;
    padding: 8px 15px;
    background-color: white;
    border-left: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    max-width: max-content;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}
    .header-dropdown__sublist.is-open {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
    }

.header-dropdown__list::-webkit-scrollbar {
    width: 6px; /* Ancho de la barra de desplazamiento */
    background-color: transparent;
}

.header-dropdown__list::-webkit-scrollbar-thumb {
    background-color: #888; /* Color del "pulgar" de la barra */
    border-radius: 3px;
}

.header-dropdown__item .header-dropdown__link.is-active + .header-dropdown__sublist {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}


/* Estilos de los enlaces de subcategorías */
.header-dropdown__sublink {
    display: block;
    padding: 8px 0;
    font-size: 0.95rem;
    color: #555;
    transition: color 0.2s ease;
}

