/* ==============================> CABECERA */

header .elementor-sticky--active {
    box-shadow: 0 0 10px 1px #8181813b;
}

div:where(.elementor-location-header) {
    margin-bottom: 0px;
}

header .elementor-widget-off-canvas .e-off-canvas__content {
    overflow: visible;
}

header .elementor-widget-off-canvas .e-off-canvas__overlay {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

header .wd-nav.wd-style-bg>li:is(:hover, .wd-opened, .current-menu-item)>a:before {
    opacity: 1 !important;
}

/* Sin Scroll */

:is(.home) .whatsapp-completo .contenido,
:is(.home) .whatsapp-completo .contenido b,
:is(.home) .iconos-contacto .elementor-widget-icon-box .elementor-icon-box-title span, 
:is(.home) .iconos-contacto .elementor-widget-icon-box .elementor-icon-box-description {
    color: #fff !important;
}

/* Scroll */

/* ==============================> BUSCADOR DE PRODUCTOS OVERLAY - DESKTOP */

/* -> TRIGGER Y BOTONES */
.buscador-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    font-size: 16px;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.3s ease;
}
.buscador-trigger:hover {
    color: var(--e-global-color-primary, #000);
}

/* -> ICONOS (CSS DRAWN, EVITANDO SVG) */
.buscador-icon-search,
.buscador-icon-search-large {
    position: relative;
    display: block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-radius: 50%;
    box-sizing: border-box;
    pointer-events: none;
}
.buscador-icon-search::after,
.buscador-icon-search-large::after {
    content: "";
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 6px;
    height: 2px;
    background-color: currentColor;
    transform: rotate(45deg);
}

.buscador-icon-search-large {
    width: 24px;
    height: 24px;
    border-width: 3px;
}
.buscador-icon-search-large::after {
    width: 10px;
    height: 3px;
    bottom: -6px;
    right: -6px;
}

.buscador-icon-close {
    position: relative;
    display: block;
    width: 24px;
    height: 24px;
    pointer-events: none;
}
.buscador-icon-close::before,
.buscador-icon-close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 2px;
    background-color: #fff;
}
.buscador-icon-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}
.buscador-icon-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

@keyframes buscador-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.buscador-icon-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,0,0,0.1);
    border-top-color: var(--e-global-color-primary, #000);
    border-radius: 50%;
    animation: buscador-spin 1s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

/* -> OVERLAY PRINCIPAL */
.buscador-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.buscador-overlay.buscador-active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.buscador-overlay-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.buscador-close-wrap {
    position: absolute;
    top: 30px;
    right: 40px;
    z-index: 2;
}
.buscador-close-wrap a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background-color: #111;
    border-radius: 50%;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.3s ease, background-color 0.3s ease;
}
.buscador-close-wrap a:hover {
    transform: scale(1.08);
    background-color: var(--e-global-color-primary, #333);
}

/* -> CONTENEDOR Y BÚSQUEDA */
.buscador-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 800px;
    margin-top: 15vh;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.buscador-input-wrap {
    width: 100%;
    display: flex;
    align-items: center;
    border-bottom: 3px solid #ddd;
    padding-bottom: 15px;
    transition: border-color 0.3s ease;
}
.buscador-input-wrap:focus-within {
    border-color: var(--e-global-color-primary, #111);
}
.buscador-input-wrap i {
    color: #999;
    margin-right: 15px;
}

#buscadorInput {
    width: 100%;
    background: transparent;
    border: none;
    box-shadow: none;
    outline: none;
    font-size: 32px;
    color: #111;
    padding: 10px 0;
    -webkit-appearance: none;
    border-radius: 0;
}
#buscadorInput::placeholder {
    color: #bbb;
}

/* -> RESULTADOS */
.buscador-results {
    width: 100%;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 35px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 40px;
}
.buscador-results::-webkit-scrollbar {
    width: 6px;
}
.buscador-results::-webkit-scrollbar-thumb {
    background-color: #ddd;
    border-radius: 4px;
}

.buscador-item {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.buscador-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.buscador-item-img {
    width: 65px;
    height: 65px;
    flex-shrink: 0;
    margin-right: 20px;
    border-radius: 4px;
    overflow: hidden;
    background-color: #f9f9f9;
}
.buscador-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.buscador-item-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.buscador-item-title {
    font-size: 18px;
    font-weight: 600;
    color: #111;
    margin-bottom: 6px;
    line-height: 1.3;
}
.buscador-item-sku {
    font-size: 13px;
    color: #888;
}

.buscador-no-results,
.buscador-loading {
    text-align: center;
    font-size: 18px;
    color: #666;
    padding: 40px 0;
}

/* -> DESKTOP: OCULTA ESTE TRIGGER EN MOBILE (usa [buscador-de-producto-movil] en su lugar) */
@media (max-width: 768px) {
    .buscador-trigger-wrap {
        display: none;
    }
}

/* ==============================> BUSCADOR DE PRODUCTOS OVERLAY - MOBILE (INDEPENDIENTE) */

.buscador-movil-trigger-wrap {
    display: none;
}

.buscador-movil-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 10px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.buscador-movil-trigger-text {
    display: none;
}
.buscador-movil-trigger i {
    pointer-events: none;
}

.buscador-movil-icon-search,
.buscador-movil-icon-search-large {
    position: relative;
    display: block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-radius: 50%;
    box-sizing: border-box;
    pointer-events: none;
}
.buscador-movil-icon-search::after,
.buscador-movil-icon-search-large::after {
    content: "";
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 6px;
    height: 2px;
    background-color: currentColor;
    transform: rotate(45deg);
}
.buscador-movil-icon-search-large {
    width: 20px;
    height: 20px;
    border-width: 3px;
}
.buscador-movil-icon-search-large::after {
    width: 8px;
    height: 3px;
    bottom: -5px;
    right: -5px;
}

.buscador-movil-icon-close {
    position: relative;
    display: block;
    width: 24px;
    height: 24px;
    pointer-events: none;
}
.buscador-movil-icon-close::before,
.buscador-movil-icon-close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 2px;
    background-color: #fff;
}
.buscador-movil-icon-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}
.buscador-movil-icon-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.buscador-movil-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.buscador-movil-overlay.buscador-movil-active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.buscador-movil-overlay-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.buscador-movil-close-wrap {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2;
}
.buscador-movil-close-wrap a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: #111;
    border-radius: 50%;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.buscador-movil-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 800px;
    margin-top: 100px;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.buscador-movil-input-wrap {
    width: 100%;
    display: flex;
    align-items: center;
    border-bottom: 3px solid #ddd;
    padding-bottom: 15px;
}
.buscador-movil-input-wrap i {
    color: #999;
    margin-right: 15px;
}

#buscadorMovilInput {
    width: 100%;
    background: transparent;
    border: none;
    box-shadow: none;
    outline: none;
    font-size: 22px;
    color: #111;
    padding: 10px 0;
    -webkit-appearance: none;
    border-radius: 0;
}
#buscadorMovilInput::placeholder {
    color: #bbb;
}

.buscador-movil-results {
    width: 100%;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 35px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 40px;
}

/* -> ACTIVA EL TRIGGER MOBILE SOLO EN BREAKPOINT (768px) */
@media (max-width: 768px) {
    .buscador-movil-trigger-wrap {
        display: block;
    }
}

/* ==============================> MENÚ DE CATEGORÍAS DESPLEGABLE */

.menu-categorias-contenedor {
    width: 100%;
    overflow-y: scroll;
    padding-right: 8px;
    animation: fadeInMenu 0.6s ease-out;
}

header .menu-categorias-contenedor {
    height: 85vh;
}

.inicio-categorias .menu-categorias-contenedor {
    height: 450px;
}


@keyframes fadeInMenu {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* -> Accordion Principal */
.menu-categorias-accordion {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
}

/* -> Item de Categoría */
.menu-categoria-item {
    border-bottom: 1px solid #e8e8e8;
    animation: fadeInBlock 0.5s ease-out forwards;
    opacity: 0;
}

.menu-categoria-item:last-child {
    border-bottom: none;
}

.menu-categoria-item:nth-child(1) {
    animation-delay: 0.1s;
}

.menu-categoria-item:nth-child(2) {
    animation-delay: 0.2s;
}

.menu-categoria-item:nth-child(3) {
    animation-delay: 0.3s;
}

.menu-categoria-item:nth-child(4) {
    animation-delay: 0.4s;
}

.menu-categoria-item:nth-child(n+5) {
    animation-delay: 0.5s;
}

@keyframes fadeInBlock {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* -> Botón de Categoría */
.menu-categoria-titulo {
    width: 100%;
    padding: 16px 4px;
    background: #ffffff;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    text-align: left;
    gap: 15px;
}

.menu-categoria-titulo:hover {
    background: #f9f9f9;
    color: var(--e-global-color-primary);
}

.menu-categoria-titulo.activo {
    background: #f5f5f5;
    color: var(--e-global-color-primary);
}

/* -> Icono de Expansión */
.menu-categoria-icono {
    display: inline-block;
    width: 20px;
    height: 20px;
    position: relative;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.menu-categoria-icono::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 10px;
    background: currentColor;
    transform: translate(-50%, -50%);
}

.menu-categoria-icono::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 2px;
    background: currentColor;
    transform: translate(-50%, -50%);
}

.menu-categoria-titulo.activo .menu-categoria-icono {
    transform: rotate(45deg);
}

/* -> Contenedor de Subcategorías */
.menu-subcategorias-contenedor {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #fafafa;
}

.menu-subcategorias-contenedor.activo {
    max-height: 600px;
}

/* -> Lista de Subcategorías */
.menu-subcategorias-lista {
    list-style: none;
    margin: 0;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* -> Item de Subcategoría */
.menu-subcategoria-item {
    margin: 0;
    padding: 0;
}

.menu-subcategoria-item a {
    color: #666666;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.8;
    display: flex;
    align-items: center;
    padding: 10px 15px;
    transition: all 0.3s ease;
    position: relative;
    margin-left: -15px;
    border-radius: 4px;
}

.menu-subcategoria-item a::before {
    content: '';
    position: absolute;
    left: 0;
    width: 3px;
    height: 0;
    background: var(--e-global-color-primary);
    border-radius: 2px;
    transition: height 0.3s ease;
}

.menu-subcategoria-item:hover a {
    color: var(--e-global-color-primary);
    background: rgba(0, 0, 0, 0.04);
    padding-left: 25px;
}

.menu-subcategoria-item:hover a::before {
    height: 16px;
}

/* -> Responsivo Mobile */
@media (max-width: 768px) {
    .menu-categorias-contenedor {
        padding: 0;
    }

    .menu-categorias-accordion {
        max-height: 800px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .menu-categoria-titulo {
        padding: 12px 16px;
        font-size: 15px;
        gap: 12px;
    }

    .menu-subcategorias-contenedor.activo {
        max-height: 500px;
    }

    .menu-subcategorias-lista {
        padding: 10px 18px;
        gap: 0;
    }

    .menu-subcategoria-item a {
        font-size: 13px;
        padding: 8px 12px;
        margin-left: -12px;
        line-height: 1.6;
    }

    .menu-subcategoria-item:hover a {
        padding-left: 22px;
    }
}

/* -> Compatibilidad iOS */
@supports (-webkit-touch-callout: none) {
    .menu-categorias-accordion {
        -webkit-user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    .menu-categoria-titulo,
    .menu-subcategoria-item a {
        -webkit-user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    .menu-categorias-accordion {
        -webkit-overflow-scrolling: touch;
    }
}

/* -> Scrollbar Personalizada */
.menu-categorias-accordion::-webkit-scrollbar {
    width: 6px;
}

.menu-categorias-accordion::-webkit-scrollbar-track {
    background: transparent;
}

.menu-categorias-accordion::-webkit-scrollbar-thumb {
    background: var(--e-global-color-primary);
    border-radius: 3px;
}

.menu-categorias-accordion::-webkit-scrollbar-thumb:hover {
    background: var(--e-global-color-primary);
    opacity: 0.8;
}