/* =============================================================
   MEGA MENU — adaptado a Toolbox/WPBoots (Bootstrap 3)
   Tu navbar usa .branding__menu > .container-fluid
   Font Awesome 4.7 ya cargado → iconos fa fa-*
   ============================================================= */

/* ── 1. Anclar el dropdown al .branding__menu, no al <li> ── */

/*
 * .branding__menu necesita position:relative para que el
 * dropdown absoluto se posicione desde él.
 * Bootstrap ya pone position:relative en .navbar,
 * pero tu wrapper es .branding__menu — lo añadimos aquí.
 */
.branding__menu {
    position: relative;
}

/* El <li> del mega menú se queda estático para no interferir */
.mega-dropdown {
    position: static !important;
}

/* ── 2. El panel dropdown a 100% del ancho ── */
.mega-dropdown-menu {
    position: absolute;
    top: 100%;        /* justo debajo del .branding__menu */
    left: 0  !important;
    right: 0 !important;
    width: 100%;
    padding: 0;
    border-top: 3px solid #153B65;  /* ← cambia al color principal de tu tema */
    border-radius: 0 0 4px 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    background: #fff;
    z-index: 9000;
}

/* ── 3. Interior del panel ── */
.mega-menu-inner {
    padding: 20px 15px;
    max-width: 1200px;    /* opcional: limita el ancho interior si lo deseas */
    margin: 0 auto;
}

/* ── 4. Columna de pestañas (izquierda) ── */
.mega-menu-tabs-col {
    border-right: 1px solid #153B65;
    padding-right: 0;
}

.mega-tabs-nav {
    margin-bottom: 0;
}

.mega-tabs-nav > li > a {
    border-radius: 4px 0 0 4px;
    padding: 10px 14px;
    color: #555;
    font-size: 13px;
    font-weight: 500;
    transition: background .15s, color .15s;
    white-space: nowrap;
}

.mega-tabs-nav > li > a:hover {
    background: #ebf2fb;
    color: #153b64;
}

.mega-tabs-nav > li.active > a,
.mega-tabs-nav > li.active > a:hover,
.mega-tabs-nav > li.active > a:focus {
    background: #153b64;   /* mismo color que border-top */
    color: #fff;
}

/* ── 5. Área de contenido ── */
.mega-tab-content {
    padding-left: 16px;
}

.mega-tab-content .tab-pane {
    padding: 4px 0;
}

/* ── 6. Ítems con icono ── */
.mega-menu-row {
    margin: 0;
}

.mega-menu-item {
    padding: 5px 6px;
}

.mega-menu-link {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: start;
        -ms-flex-align: start;
            align-items: flex-start;
    gap: 11px;
    padding: 10px 8px;
    border-radius: 4px;
    color: #444;
    text-decoration: none;
    -webkit-transition: background .15s, color .15s;
            transition: background .15s, color .15s;
}

/* fallback gap para Safari/IE sin flex gap */
.mega-menu-icon { margin-right: 11px; }

.mega-menu-link:hover,
.mega-menu-link:focus {
    background: #ebf2fb;
    color: #153b64;
    text-decoration: none;
}

/* ── 7. Miniatura de categoría WooCommerce ── */
img.mega-menu-thumb,
.mega-menu-thumb {
    width: 70px !important;
    max-width: 70px !important;
    height: 70px !important;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    margin-right: 11px;
    border: 1px solid #f0f0f0;
    transition: opacity .15s, transform .15s;
}

.mega-menu-link:hover .mega-menu-thumb {
    opacity: .85;
    transform: scale(1.05);
}

/* ── 7b. Icono FA (fallback si no hay imagen) ── */
.mega-menu-icon {
    font-size: 22px;
    -ms-flex-negative: 0;
        flex-shrink: 0;
    margin-top: 2px;
    color: #ebf2fb;
    -webkit-transition: color .15s;
            transition: color .15s;
    width: 24px;
    text-align: center;
}

.mega-menu-link:hover .mega-menu-icon {
    color: #ebf2fb;
}

/* ── 8. Textos ── */
.mega-menu-text {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
}

.mega-menu-label {
    display: block;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.3;
    color: #153B65;
}

.mega-menu-desc {
    display: block;
    font-size: 14px;
    color: #999;
    margin-top: 2px;
    line-height: 1.4;
}

.mega-menu-link:hover .mega-menu-label { color: #153b64; }
.mega-menu-link:hover .mega-menu-desc  { color: #153b64; }

/* ── 9. Responsive ── */
@media (max-width: 991px) {
    /* En tablet la columna de tabs ocupa más */
    .mega-menu-tabs-col { border-right: none; border-bottom: 1px solid #ebebeb; margin-bottom: 12px; padding-bottom: 8px; }
    .mega-tabs-nav > li { display: inline-block; }
    .mega-tabs-nav > li > a { border-radius: 4px; }
    .mega-tab-content { padding-left: 0; }
}

@media (max-width: 767px) {
    /* En móvil el menú ya va al panel lateral (.cbp-spmenu-right),
       así que el mega menú desktop se oculta con hidden-sm hidden-xs.
       Si lo usas también en móvil, descomenta: */
    /*
    .mega-dropdown-menu {
        position: static !important;
        box-shadow: none;
        border-top: none;
        width: 100%;
    }
    .mega-menu-item { width: 50%; }
    */
}

img.mega-menu-thumb {
    width: 72px;
}
.col-sm-2.mega-menu-tabs-col {
    display: none;
}
.mega-menu-link {
    align-items: center;
	vertical-align:middle;
}
