/* ================================================================
   Mega-menú Principal — MyPartnerPrint
   Estilo: barra oscura + dropdown blanco con grid de hijas
   ================================================================ */

/* ---- Barra de navegación ---- */
.mwm-megamenu-nav {
    width: 100%;
    background: #111111;
}

.mwm-megamenu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: stretch;
    width: 100%;
}

.mwm-megamenu__item {
    flex: 1 1 auto;
    display: flex;
    align-items: stretch;
    position: static;
}

.mwm-megamenu__link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    padding: 0 12px;
    height: 48px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.01em;
    position: relative;
    transition: color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

/* Línea inferior que crece desde el centro */
.mwm-megamenu__link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    right: 50%;
    height: 3px;
    background: #E30613;
    transition: left 0.22s ease, right 0.22s ease;
}

.mwm-megamenu__item:hover > .mwm-megamenu__link,
.mwm-megamenu__item.is-open > .mwm-megamenu__link {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

.mwm-megamenu__item:hover > .mwm-megamenu__link::after,
.mwm-megamenu__item.is-open > .mwm-megamenu__link::after {
    left: 0;
    right: 0;
}

/* Flecha chevron */
.mwm-megamenu__arrow {
    flex-shrink: 0;
    opacity: 0.5;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.mwm-megamenu__item:hover > .mwm-megamenu__link .mwm-megamenu__arrow,
.mwm-megamenu__item.is-open > .mwm-megamenu__link .mwm-megamenu__arrow {
    opacity: 1;
    transform: rotate(0deg);
}

.mwm-megamenu__item.is-open > .mwm-megamenu__link .mwm-megamenu__arrow {
    transform: rotate(180deg);
}

/* ---- Panel dropdown ---- */
.mwm-megamenu__panel {
    display: none;
    position: fixed;
    left: 0;
    width: 100vw;
    background: #ffffff;
    border-top: 3px solid #111111;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
    z-index: 99990;
}

.mwm-megamenu__item.is-open > .mwm-megamenu__panel {
    display: block;
    animation: mwm-panel-fade 0.18s ease;
}

@keyframes mwm-panel-fade {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mwm-megamenu__panel-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 40px 32px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px 16px;
}

/* ---- Tarjeta de hija ---- */
.mwm-megamenu__hija {
    display: flex;
    flex-direction: column;
    gap: 9px;
    text-decoration: none;
    color: #1a1a1a;
    border-radius: 6px;
    padding: 8px;
    transition: background 0.15s ease, transform 0.15s ease;
}

.mwm-megamenu__hija:hover {
    background: #f4f4f4;
    transform: translateY(-2px);
    color: #1a1a1a;
}

.mwm-megamenu__hija-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;   /* cuadrado */
    border-radius: 5px;
    overflow: hidden;
    background: #ececec;
}

.mwm-megamenu__hija-thumb--empty {
    background: linear-gradient(135deg, #e2e2e2 0%, #f0f0f0 100%);
}

.mwm-megamenu__hija-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}

.mwm-megamenu__hija:hover .mwm-megamenu__hija-thumb img {
    transform: scale(1.04);
}

.mwm-megamenu__hija-name {
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.35;
    color: #222222;
}

.mwm-megamenu__hija:hover .mwm-megamenu__hija-name {
    color: #000000;
}

/* overlay eliminado — causaba flickering al cubrir los <li> del nav */

/* ---- Mobile: nav de escritorio oculta ---- */
@media (max-width: 1024px) {
    .mwm-megamenu-nav {
        display: none;
    }
}

/* ================================================================
   Menú Mobile — Hamburguesa + Panel deslizante
   ================================================================ */

/* ---- Hamburguesa ---- */
.mwm-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.15s;
    flex-shrink: 0;
}

.mwm-hamburger:hover {
    background: rgba(0, 0, 0, 0.06);
}

.mwm-hamburger__bar {
    display: block;
    width: 24px;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
    transform-origin: center;
}

/* Animación → X al abrir */
.mwm-hamburger.is-open .mwm-hamburger__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.mwm-hamburger.is-open .mwm-hamburger__bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.mwm-hamburger.is-open .mwm-hamburger__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 1024px) {
    .mwm-hamburger {
        display: flex;
    }
}

/* ---- Panel mobile ---- */
.mwm-mobile-panel {
    visibility: hidden;
    pointer-events: none;
}

.mwm-mobile-panel.is-open {
    visibility: visible;
    pointer-events: auto;
}

.mwm-mobile-panel__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mwm-mobile-panel.is-open .mwm-mobile-panel__overlay {
    opacity: 1;
}

/* Panel deslizante desde la derecha */
.mwm-mobile-panel__nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: min(360px, 85vw);
    background: #ffffff;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.18);
}

.mwm-mobile-panel.is-open .mwm-mobile-panel__nav {
    transform: translateX(0);
}

/* Cabecera del panel */
.mwm-mobile-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: #111111;
    flex-shrink: 0;
}

.mwm-mobile-panel__title {
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mwm-mobile-panel__close {
    background: none;
    border: none;
    cursor: pointer;
    color: #ffffff;
    padding: 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: background 0.15s;
}

.mwm-mobile-panel__close:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Lista principal */
.mwm-mobile-menu {
    list-style: none;
    margin: 0;
    padding: 6px 0;
    flex: 1;
    overflow-y: auto;
}

.mwm-mobile-menu__item {
    border-bottom: 1px solid #f0f0f0;
}

.mwm-mobile-menu__row {
    display: flex;
    align-items: stretch;
}

.mwm-mobile-menu__link {
    display: block;
    flex: 1;
    padding: 15px 20px;
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s;
}

.mwm-mobile-menu__link:hover {
    background: #f8f8f8;
}

.mwm-mobile-menu__toggle {
    background: none;
    border: none;
    border-left: 1px solid #f0f0f0;
    cursor: pointer;
    padding: 0 18px;
    color: #666;
    display: flex;
    align-items: center;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.mwm-mobile-menu__toggle:hover {
    background: #f8f8f8;
    color: #111;
}

.mwm-mobile-menu__toggle svg {
    transition: transform 0.25s ease;
}

.mwm-mobile-menu__item.is-open > .mwm-mobile-menu__row .mwm-mobile-menu__toggle svg {
    transform: rotate(180deg);
}

/* Acordeón de hijas */
.mwm-mobile-menu__children {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #f9f9f9;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mwm-mobile-menu__item.is-open > .mwm-mobile-menu__children {
    max-height: 800px;
}

.mwm-mobile-menu__hija {
    display: block;
    padding: 12px 20px 12px 32px;
    color: #444;
    font-size: 13px;
    text-decoration: none;
    border-top: 1px solid #eeeeee;
    transition: background 0.15s, color 0.15s;
}

.mwm-mobile-menu__hija:hover {
    background: #efefef;
    color: #000;
}


/* ================================================================
   Mobile drawer — extra sections (Aplicaciones / Menu / Footer)
   Added 2026-06-04 for truyol-style layout
   ================================================================ */

/* The panel becomes the scroll container, individual lists size naturally */
.mwm-mobile-panel__nav { overflow-y: auto; }
.mwm-mobile-menu { flex: 0 0 auto; overflow: visible; }

/* Section titles */
.mwm-mobile-section__title {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #71717A;
    margin: 18px 20px 6px;
}
.mwm-mobile-menu + .mwm-mobile-section__title {
    border-top: 1px solid #E4E4E7;
    padding-top: 18px;
    margin-top: 12px;
}

/* Footer (Mi cuenta + Contacto) */
.mwm-mobile-footer {
    margin-top: 18px;
    border-top: 1px solid #E4E4E7;
    background: #F5F5F6;
    padding: 14px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.mwm-mobile-footer__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px;
    border-radius: 8px;
    color: #18181B;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
}
.mwm-mobile-footer__link:hover { background: rgba(0,0,0,0.04); }
.mwm-mobile-footer__link svg { color: #71717A; flex-shrink: 0; }

/* Hide the desktop main nav and the apps bar row on mobile so they
   don't overlap or duplicate the hamburger drawer */
@media (max-width: 1024px) {
    #hdr_center_slot,
    .elementor-element-hdr_center_slot {
        display: none !important;
    }
    #hdr_fila2,
    .elementor-element-hdr_fila2 {
        display: none !important;
    }
}


/* ============================================================
   Mobile header — final layout & icon polish (added 2026-06-04)
   Hide top bar, compact single-row header, monochrome icons in
   the same order as truyol (search, account, cart, hamburger).
   ============================================================ */
@media (max-width: 1024px) {

    /* (1) Hide the top info bar (phone, hours, "Para empresas") */
    #hdrtopbr,
    .elementor-element-hdrtopbr {
        display: none !important;
    }

    /* (2) Force hdr_fila1 to a single compact row, no wrapping */
    .elementor-element-hdr_fila1,
    .elementor-element-hdr_fila1 > .e-con-inner {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 6px !important;
        padding: 10px 14px !important;
        min-height: 0 !important;
    }

    /* (3) Constrain logo size — was huge */
    .elementor-element-hdr_logo_wrap,
    .elementor-element-hdr_logo_wrap > .e-con-inner {
        flex: 0 0 auto !important;
        max-width: 96px !important;
        min-width: 0 !important;
        padding: 0 !important;
    }
    .elementor-element-hdr_logo,
    .elementor-element-hdr_logo > .elementor-widget-container {
        max-width: 96px !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .elementor-element-hdr_logo img {
        max-width: 96px !important;
        max-height: 48px !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
    }

    /* (4) Right slot: icons in a tight monochrome row, push to the right */
    .elementor-element-hdr_right_slot,
    .elementor-element-hdr_right_slot > .e-con-inner {
        flex: 1 1 auto !important;
        flex-direction: row !important;
        justify-content: flex-end !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 2px !important;
        padding: 0 !important;
        margin-left: auto !important;
    }

    /* Strip any background/padding the cliente set on these widgets via Elementor */
    .elementor-element-hdr_right_slot .elementor-widget,
    .elementor-element-hdr_right_slot .elementor-widget-container {
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* (5) Reorder icons to match truyol: search, account, cart, hamburger */
    .elementor-element-de94075     { order: 1 !important; } /* mpp_search_trigger */
    .elementor-element-c3e4636     { order: 2 !important; } /* account icon */
    .elementor-element-1acdf7c     { order: 3 !important; } /* wc menu cart */
    .elementor-element-hdr_mobile_sc { order: 4 !important; } /* mwm_megamenu_mobile */

    /* (6) Search trigger: small, transparent, dark stroke */
    .mpp-search-trigger {
        background: transparent !important;
        color: #18181B !important;
        width: 40px !important;
        height: 40px !important;
        padding: 8px !important;
        border-radius: 6px !important;
    }
    .mpp-search-trigger svg {
        width: 22px !important;
        height: 22px !important;
    }

    /* (7) Hamburger: small, transparent, dark bars */
    .mwm-hamburger {
        background: transparent !important;
        padding: 9px 8px !important;
        width: 40px !important;
        height: 40px !important;
        border-radius: 6px !important;
        gap: 4px !important;
    }
    .mwm-hamburger:hover {
        background: rgba(0,0,0,0.05) !important;
    }
    .mwm-hamburger__bar {
        background: #18181B !important;
        width: 22px !important;
        height: 2px !important;
    }

    /* (8) Cart + account icons: equal size, monochrome */
    .elementor-element-hdr_right_slot .elementor-icon {
        font-size: 22px !important;
        color: #18181B !important;
    }
    .elementor-element-hdr_right_slot .elementor-icon a,
    .elementor-element-hdr_right_slot .elementor-icon i,
    .elementor-element-hdr_right_slot .elementor-icon svg {
        color: #18181B !important;
        fill: currentColor !important;
        width: 22px !important;
        height: 22px !important;
    }
    .elementor-element-hdr_right_slot .elementor-menu-cart__toggle_button {
        padding: 8px !important;
        background: transparent !important;
        color: #18181B !important;
        min-height: 0 !important;
    }
    .elementor-element-hdr_right_slot .elementor-menu-cart__toggle_button svg {
        width: 22px !important;
        height: 22px !important;
    }
}


/* ============================================================
   Mobile header — spacing tweaks (added 2026-06-04 r2)
   Spread icons so they're not crammed against each other.
   ============================================================ */
@media (max-width: 1024px) {
    .elementor-element-hdr_right_slot,
    .elementor-element-hdr_right_slot > .e-con-inner {
        gap: 10px !important;
        padding-right: 4px !important;
    }
    .mpp-search-trigger,
    .mwm-hamburger {
        width: 36px !important;
        height: 36px !important;
        padding: 6px !important;
    }
    .mpp-search-trigger svg,
    .elementor-element-hdr_right_slot .elementor-icon svg,
    .elementor-element-hdr_right_slot .elementor-menu-cart__toggle_button svg {
        width: 22px !important;
        height: 22px !important;
    }
    .elementor-element-hdr_right_slot .elementor-icon a,
    .elementor-element-hdr_right_slot .elementor-menu-cart__toggle_button {
        padding: 6px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}


/* ============================================================
   FIX 2026-06-05: Elementor Pro mini-cart lightbox overflowing global width.
   The .elementor-menu-cart__container should stay hidden when not active.
   Belt-and-suspenders: overflow-x: clip on body to prevent any future
   off-canvas element from forcing horizontal scroll.
   ============================================================ */
.elementor-menu-cart__container.elementor-lightbox:not(.elementor-active):not(.is-active):not(.elementor-cart--shown) {
    display: none !important;
}
html, body { overflow-x: clip; }

/* ================================================================
   2026-08-05: Scroll horizontal con flechas en la barra de madres
   (como las pills). El panel dropdown es position:fixed, por lo que
   el overflow del listado no lo recorta.
   ================================================================ */
.mwm-megamenu-nav { position: relative; }

.mwm-megamenu {
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* IE/Edge viejos */
}
.mwm-megamenu::-webkit-scrollbar { display: none; }  /* Chrome/Safari */

.mwm-megamenu-arrow,
.mwm-megamenu-arrow:hover,
.mwm-megamenu-arrow:focus,
.mwm-megamenu-arrow:active {
    /* reset duro: el tema pinta los <button> de rojo con borde */
    -webkit-appearance: none !important;
    appearance: none !important;
    background-color: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    margin: 0 !important;
    padding: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    color: #fff !important;
}
.mwm-megamenu-arrow {
    position: absolute;
    top: 0;
    height: 100%;
    width: 44px;
    /* !important: el reset.css del tema pone display:inline-block a todo <button> y carga despues */
    display: none !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 6;
}
/* fondo negro difuminado con transparencia: se intuyen los titulos detras */
.mwm-megamenu-arrow--left,
.mwm-megamenu-arrow--left:hover,
.mwm-megamenu-arrow--left:focus {
    left: 0;
    background: linear-gradient(90deg, rgba(17,17,17,0.92) 0%, rgba(17,17,17,0.65) 45%, rgba(17,17,17,0) 100%) !important;
}
.mwm-megamenu-arrow--right,
.mwm-megamenu-arrow--right:hover,
.mwm-megamenu-arrow--right:focus {
    right: 0;
    background: linear-gradient(270deg, rgba(17,17,17,0.92) 0%, rgba(17,17,17,0.65) 45%, rgba(17,17,17,0) 100%) !important;
}
.mwm-megamenu-nav.can-left  .mwm-megamenu-arrow--left  { display: flex !important; }
.mwm-megamenu-nav.can-right .mwm-megamenu-arrow--right { display: flex !important; }
.mwm-megamenu-arrow svg { width: 15px; height: 15px; display: block; }


/* ================================================================
   2026-08-05: Hamburger del plugin — blindar hover/focus/active.
   El reset.css del tema pinta button:hover/button:focus de #CC3366 y
   carga despues; aqui solo estaba protegido :hover (y solo en una
   media query). Gris tenue en todos los estados, sin rojo.
   ================================================================ */
.mwm-hamburger:hover,
.mwm-hamburger:focus,
.mwm-hamburger:active {
    background: rgba(0, 0, 0, 0.05) !important;
    box-shadow: none !important;
    outline: none !important;
}

/* ================================================================
   2026-08-05: Barra "Aplicaciones" para la franja negra en móvil
   [mwm_megamenu_apps_bar] — mismo gris claro que los ítems del
   megamenú; abre el panel deslizante del menú móvil.
   ================================================================ */
.mwm-appsbar,
.mwm-appsbar:hover,
.mwm-appsbar:focus,
.mwm-appsbar:active {
    -webkit-appearance: none !important;
    appearance: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    margin: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
}
.mwm-appsbar {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    padding: 0 16px !important;
    background: transparent !important;
    color: rgba(255, 255, 255, 0.78) !important;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease;
}
.mwm-appsbar:hover,
.mwm-appsbar:focus,
.mwm-appsbar.is-open {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}
.mwm-appsbar__icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mwm-appsbar__bar {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

/* ================================================================
   2026-08-05: BLINDAJE del panel móvil frente al reset/estilos
   globales del tema (borde y fondo rojos en <button>, texto blanco
   en enlaces al hover, rellenos enormes).
   ================================================================ */

/* 1) Hamburguesa del header: sin borde rojo de 1px */
.mwm-hamburger,
.mwm-hamburger:hover,
.mwm-hamburger:focus,
.mwm-hamburger:active {
    border: 0 !important;
}

/* 2) Botón de cerrar (aspa): solo el aspa blanca sobre la franja negra */
.mwm-mobile-panel__close,
.mwm-mobile-panel__close:focus,
.mwm-mobile-panel__close:active {
    background: transparent !important;
    border: 0 !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 6px !important;
    margin: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    color: #ffffff !important;
}
.mwm-mobile-panel__close:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
}

/* 3) Botón de despliegue del acordeón: flecha negra sobre blanco/gris */
.mwm-mobile-menu__toggle,
.mwm-mobile-menu__toggle:focus,
.mwm-mobile-menu__toggle:active {
    background: transparent !important;
    border: 0 !important;
    border-left: 1px solid #f0f0f0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 16px !important;
    margin: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    color: #18181B !important;
}
.mwm-mobile-menu__toggle:hover {
    background: #f8f8f8 !important;
    color: #18181B !important;
}

/* 4) Enlaces del panel: el texto NUNCA se vuelve blanco al posarse */
.mwm-mobile-menu__link,
.mwm-mobile-menu__link:hover,
.mwm-mobile-menu__link:focus {
    color: #1a1a1a !important;
}
.mwm-mobile-menu__hija,
.mwm-mobile-menu__hija:hover,
.mwm-mobile-menu__hija:focus {
    color: #444 !important;
}
.mwm-mobile-menu__hija:hover { color: #000 !important; }
.mwm-mobile-footer__link,
.mwm-mobile-footer__link:hover,
.mwm-mobile-footer__link:focus {
    color: #1a1a1a !important;
}
