/* SERET Mega Menu V3.1 - Hover horizontal, minimalista */

.seret-products-menu { position: static !important; }

/* Flecha sutil SOLO en Productos. */
.seret-products-toggle,
.seret-category-toggle,
.seret-subcategory-toggle {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.seret-products-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 5px;
    vertical-align: middle;
    color: currentColor;
    opacity: .65;
    position: relative;
    top: 1px;
}

.seret-products-toggle span {
    display: block;
    width: 5px;
    height: 5px;
    border-right: 1.25px solid currentColor;
    border-bottom: 1.25px solid currentColor;
    transform: rotate(45deg) translate(-1px,-1px);
    transition: transform .18s ease;
}

.seret-products-menu.seret-mega-open .seret-products-toggle span,
.seret-products-menu:hover .seret-products-toggle span,
.seret-products-menu:focus-within .seret-products-toggle span {
    transform: rotate(225deg) translate(-1px,-1px);
}

/* Menú principal */
.seret-mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 9999;
    background: #fff;
    border-top: 1px solid rgba(18,86,148,.08);
    border-bottom: 1px solid rgba(18,86,148,.08);
    box-shadow: 0 10px 28px rgba(20,45,70,.07);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
}

/* Zona invisible de transición: evita el cierre al cruzar 1-2 px. */
.seret-mega-menu::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -12px;
    height: 12px;
}

.seret-products-menu:hover > .seret-mega-menu,
.seret-products-menu:focus-within > .seret-mega-menu,
.seret-products-menu.seret-mega-open > .seret-mega-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.seret-mega-menu-inner {
    width: min(1400px, calc(100% - 96px));
    margin: 0 auto;
    padding: 22px 0 18px;
    position: relative;
}

/* SOLO las tres categorías principales al abrir Productos. */
.seret-mega-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    align-items: start;
}

.seret-mega-column {
    min-width: 0;
    position: static;
}

.seret-mega-category-row {
    display: block;
    margin: 0;
}

.seret-mega-title {
    display: inline-block;
    padding-bottom: 2px;
    margin: 0;
    color: #125694 !important;
    font-size: 14px;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: .02em;
    text-decoration: none !important;
    transition: opacity .15s ease;
}

.seret-mega-title:hover { opacity: .72; }

/* Nivel 2 oculto inicialmente. Aparece SOLO al pasar por la categoría principal. */
.seret-category-children {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 54px;
    padding: 16px 0 6px;
    border-top: 1px solid rgba(18,86,148,.07);
    background: #fff;
    z-index: 2;
}

.seret-mega-column:hover > .seret-category-children,
.seret-mega-column.seret-hover-open > .seret-category-children {
    display: block;
}

/* Las subcategorías ocupan TODO el ancho disponible. */
.seret-mega-subcategories {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    column-gap: 22px;
    row-gap: 1px;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.seret-mega-subcategories > li {
    min-width: 0;
    margin: 0;
    padding: 0;
    position: relative;
}

.seret-subcategory-row {
    display: block;
}

.seret-mega-subcategories a {
    display: block;
    padding: 3px 0;
    color: #125694 !important;
    font-size: 12.5px;
    line-height: 1.32;
    text-decoration: none !important;
    transition: opacity .12s ease;
}

.seret-mega-subcategories a:hover {
    opacity: .62;
}

/* Nivel 3: oculto hasta que se pasa por una subcategoría que lo tiene. */
.seret-mega-grandchildren {
    display: none;
    position: absolute;
    left: 0;
    top: calc(100% - 1px);
    min-width: 210px;
    max-width: 360px;
    padding: 8px 14px;
    margin: 0 !important;
    list-style: none !important;
    background: #fff;
    border: 1px solid rgba(18,86,148,.10);
    box-shadow: 0 8px 22px rgba(20,45,70,.08);
    z-index: 10;
}

.seret-mega-subcategories > li:hover > .seret-mega-grandchildren,
.seret-mega-subcategories > li.seret-hover-open > .seret-mega-grandchildren {
    display: block;
}

.seret-mega-grandchildren li {
    margin: 0;
    padding: 0;
}

.seret-mega-grandchildren a {
    padding: 4px 0;
    color: #125694 !important;
    font-size: 12px;
    line-height: 1.3;
    text-decoration: none !important;
}

/* No mostrar botones internos en PC: todo funciona con hover. */
.seret-category-toggle,
.seret-subcategory-toggle {
    display: none !important;
}

.seret-mega-footer {
    margin-top: 12px;
    padding-top: 9px;
    border-top: 1px solid rgba(18,86,148,.08);
    text-align: right;
}

.seret-mega-footer a {
    color: #125694 !important;
    font-size: 11.5px;
    font-weight: 600;
    text-decoration: none !important;
}

.seret-mega-footer span {
    margin-left: 4px;
    font-size: 14px;
}

@media (max-width: 1100px) and (min-width: 769px) {
    .seret-mega-menu-inner { width: min(100% - 56px, 1000px); }
    .seret-mega-columns { gap: 20px; }
    .seret-mega-subcategories {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        column-gap: 16px;
    }
}

@media (max-width: 768px) {
    .seret-products-menu { position: relative !important; }

    .seret-products-toggle {
        display: inline-flex;
        width: 32px;
        height: 32px;
        margin-left: 3px;
        top: 0;
        opacity: 1;
    }

    .seret-products-toggle span {
        width: 7px;
        height: 7px;
        border-right: 1.5px solid currentColor;
        border-bottom: 1.5px solid currentColor;
    }

    .seret-mega-menu {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        display: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
        box-shadow: none;
        border-top: 1px solid rgba(18,86,148,.08);
        border-bottom: 0;
    }

    .seret-mega-menu::before { display: none; }

    .seret-products-menu.seret-mega-open > .seret-mega-menu { display: block; }

    .seret-mega-menu-inner { width: auto; padding: 14px 15px 15px; }
    .seret-mega-columns { display: block; }

    .seret-mega-column {
        padding: 8px 0;
        border-bottom: 1px solid rgba(18,86,148,.08);
    }

    .seret-mega-column:last-child { border-bottom: 0; }

    .seret-mega-title { font-size: 14px; }

    .seret-category-children {
        display: block !important;
        position: static;
        padding: 6px 0 0;
        border-top: 0;
    }

    .seret-mega-subcategories {
        display: block;
    }

    .seret-mega-subcategories a {
        padding: 5px 0;
        font-size: 14px;
    }

    .seret-mega-grandchildren {
        display: block !important;
        position: static;
        min-width: 0;
        max-width: none;
        padding: 0 0 0 10px;
        margin: 0 0 4px !important;
        border: 0;
        border-left: 1px solid rgba(18,86,148,.12);
        box-shadow: none;
    }

    .seret-mega-grandchildren a { font-size: 13px; }

    .seret-mega-footer {
        margin-top: 10px;
        padding-top: 10px;
        text-align: left;
    }
}
