/* ==========================================================================
   Cabecera personalizada: barra de anuncios, logo, menu, buscador y cajon movil.
   Extraida de benditasea_custom_header_styles() del plugin roto (lineas 5114-5770).
   El marcado lo genera includes/header.php sobre el hook generate_before_header.
   ========================================================================== */
/* ==========================================
   OCULTACIÓN DE LA CABECERA ORIGINAL DEL TEMA
   ========================================== */
.site-header, 
.main-navigation, 
#mobile-header,
.navigation-clone,
.sticky-enabled .main-navigation,
#site-navigation,
.header-widget,
.site-logo {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    margin: 0 !important;
    padding: 0 !important;
    position: absolute !important;
    top: -9999px !important;
}

/* ==========================================
   CABECERA PREMIUM PERSONALIZADA - ESTILOS
   ========================================== */

.bs-custom-header-wrapper {
    --bs-primary: #2ecc71;
    --bs-primary-dark: #27ae60;
    --bs-dark: #0d2c1d;
    --bs-bg-light: rgba(255, 255, 255, 0.97);
    --bs-text: #2c3e50;
    --bs-font: 'Outfit', 'Inter', sans-serif;
    
    font-family: var(--bs-font) !important;
    position: relative;
    z-index: 99999 !important;
    width: 100%;
}

/* Barra de Anuncios */
@keyframes bs-header-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.bs-announcement-bar {
    background: linear-gradient(-45deg, #051610, #133325, #062016, #09271c);
    background-size: 400% 400%;
    animation: bs-header-gradient 15s ease infinite;
    color: #ffffff !important;
    text-align: center;
    padding: 10px 15px;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
    border-bottom: 1px solid rgba(0, 230, 118, 0.18) !important;
    position: relative;
    z-index: 1000 !important;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}
.bs-announcement-bar span strong {
    color: var(--bs-primary) !important;
    text-shadow: 0 0 10px rgba(46, 204, 113, 0.4);
    font-weight: 800 !important;
}

/* Cabecera Principal */
.bs-custom-header {
    background: var(--bs-bg-light);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(13, 44, 29, 0.05);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.015);
    transition: all 0.4s ease;
    height: 100px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}
.bs-header-container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    box-sizing: border-box;
}

/* Logo Contenedor */
.bs-logo-container {
    display: flex;
    align-items: center;
    height: 100%;
    flex-shrink: 0;
    perspective: 1000px;
}
.bs-logo-container a {
    display: block;
    transform-style: preserve-3d;
}
.bs-logo-img {
    height: 110px !important;
    width: auto !important;
    display: block;
    position: relative;
    top: 15px;
    transition: transform 0.15s cubic-bezier(0.25, 0.8, 0.25, 1), filter 0.3s ease !important;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.12)) !important;
    will-change: transform, filter;
    z-index: 10002;
    animation: bs-logo-float 4s ease-in-out infinite;
}
.bs-logo-container a:hover .bs-logo-img {
    animation: none !important;
    transform: scale(1.12) rotate(-1.5deg);
    filter: drop-shadow(0 0 18px rgba(46, 204, 113, 0.55)) drop-shadow(0 6px 12px rgba(0,0,0,0.12)) !important;
}
@keyframes bs-logo-float {
    0% {
        transform: translateY(0);
        filter: drop-shadow(0 4px 10px rgba(0,0,0,0.12)) !important;
    }
    50% {
        transform: translateY(-5px);
        filter: drop-shadow(0 12px 24px rgba(46, 204, 113, 0.22)) drop-shadow(0 6px 12px rgba(0,0,0,0.08)) !important;
    }
    100% {
        transform: translateY(0);
        filter: drop-shadow(0 4px 10px rgba(0,0,0,0.12)) !important;
    }
}

/* Navegación Escritorio */
.bs-desktop-nav {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    padding: 0 20px;
}
.bs-menu-list {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    gap: 2px;
}

/* Items del Menú Superior */
.bs-menu-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}
.bs-menu-item > a {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 14px;
    color: var(--bs-dark) !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px;
    text-decoration: none !important;
    transition: color 0.3s ease;
    position: relative;
    box-sizing: border-box;
}
.bs-arrow-icon {
    margin-left: 5px;
    transition: transform 0.3s ease;
    color: rgba(13, 44, 29, 0.4);
}

/* Línea verde animada en Hover */
.bs-menu-item > a::after {
    content: '';
    position: absolute;
    bottom: 26px; /* Posicionada exactamente debajo de la palabra */
    left: 50%;
    width: 0;
    height: 2.5px;
    background: var(--bs-primary);
    border-radius: 4px;
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: translateX(-50%);
}
.bs-menu-item:hover > a::after,
.bs-menu-item.bs-active > a::after {
    width: 60%;
}
.bs-menu-item:hover > a,
.bs-menu-item.bs-active > a {
    color: var(--bs-primary) !important;
}
.bs-menu-item:hover .bs-arrow-icon {
    transform: rotate(180deg);
    color: var(--bs-primary);
}

/* Submenús Desplegables (Dropdowns) */
.bs-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(13, 44, 29, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 12px 35px rgba(13, 44, 29, 0.08);
    border-radius: 12px;
    padding: 10px 0;
    list-style: none;
    min-width: 220px;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1000;
}
.bs-menu-item:hover .bs-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Submenús de Nivel 2+ (Flyout lateral) */
.bs-submenu-item {
    position: relative;
}
.bs-submenu-item .bs-sub-dropdown {
    /* display:none y no visibility:hidden a proposito. Un elemento posicionado en
       absoluto sigue contando para el ancho desplazable del documento aunque sea
       invisible, y estos vuelan hacia la derecha con left:100%: en el original
       provocaban 185 px de desborde y barra horizontal en todas las paginas.
       Con display:none desaparecen del calculo. Se pierde el fundido de este nivel,
       que es un precio menor. */
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    transform: translateX(12px);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(13, 44, 29, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 12px 35px rgba(13, 44, 29, 0.08);
    border-radius: 12px;
    padding: 10px 0;
    list-style: none;
    min-width: 220px;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1001;
}
.bs-submenu-item:hover > .bs-sub-dropdown {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Si el desplegable de primer nivel corresponde a los ultimos elementos del menu,
   centrarlo bajo el item lo saca por la derecha. Se ancla al borde derecho. */
.bs-menu-list > .bs-menu-item:nth-last-child(-n+2) > .bs-dropdown {
    left: auto;
    right: 0;
    transform: translateX(0) translateY(12px);
}

.bs-menu-list > .bs-menu-item:nth-last-child(-n+2):hover > .bs-dropdown {
    transform: translateX(0) translateY(0);
}
.bs-sub-arrow-icon {
    margin-left: auto;
    align-self: center;
    opacity: 0.7;
    transition: transform 0.2s ease;
}
.bs-submenu-item:hover > a .bs-sub-arrow-icon {
    transform: translateX(3px);
    opacity: 1;
}

/* Items del Submenú */
.bs-submenu-item {
    width: 100%;
}
.bs-submenu-item a {
    display: block;
    padding: 10px 20px;
    color: var(--bs-dark) !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    transition: all 0.2s ease;
    text-align: left;
}
.bs-submenu-item a:hover,
.bs-submenu-item.bs-active a {
    background: rgba(46, 204, 113, 0.07);
    color: var(--bs-primary-dark) !important;
    padding-left: 24px;
}

/* Botones de Utilidades */
.bs-utility-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 100%;
    flex-shrink: 0;
}
.bs-action-btn {
    background: transparent;
    border: none;
    outline: none;
    display: flex;
    align-items: center;
    padding: 10px 14px;
    height: 48px;
    color: var(--bs-dark) !important;
    text-decoration: none !important;
    border-radius: 30px;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}
.bs-action-btn:hover {
    background: rgba(13, 44, 29, 0.04);
    color: var(--bs-primary) !important;
}
.bs-icon {
    stroke: currentColor;
    transition: stroke 0.3s ease;
}

/* Indicador numérico de Carrito */
.bs-cart-badge {
    background: var(--bs-primary);
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    height: 18px;
    min-width: 18px;
    padding: 0 4px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(46, 204, 113, 0.4);
    position: absolute;
    top: 4px;
    right: 4px;
    border: 1.5px solid #ffffff;
    box-sizing: border-box;
}
.bs-cart-badge:empty {
    display: none !important;
}

/* Toggle de Menú Móvil */
.bs-mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 22px;
    height: 15px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10001;
    margin-left: 10px;
}
.bs-hamburger-bar {
    width: 100%;
    height: 2px;
    background-color: var(--bs-dark);
    border-radius: 4px;
    transition: all 0.3s ease;
}

/* Buscador Desplegable (Overlay) */
.bs-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 180px;
    background: rgba(13, 44, 29, 0.96);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 100000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border-bottom: 2px solid var(--bs-primary);
}
.bs-search-overlay.bs-active {
    transform: translateY(0);
}
.bs-search-box {
    width: 100%;
    max-width: 650px;
    padding: 0 20px;
    position: relative;
}
.bs-search-form {
    display: flex;
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.25);
    padding: 8px 0;
    transition: border-color 0.3s ease;
    background: transparent !important;
}
.bs-search-form:focus-within {
    border-color: var(--bs-primary);
}
.bs-search-input {
    width: 100%;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: #ffffff !important;
    font-size: 22px !important;
    font-weight: 500 !important;
    padding: 0 10px 0 0 !important;
    font-family: var(--bs-font);
    box-shadow: none !important;
}
.bs-search-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}
.bs-search-submit {
    background: transparent !important;
    border: none !important;
    color: #ffffff !important;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
}
.bs-search-submit:hover {
    color: var(--bs-primary) !important;
}
.bs-search-close {
    position: absolute;
    top: 25px;
    right: 40px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 32px !important;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    line-height: 1;
}
.bs-search-close:hover {
    color: var(--bs-primary) !important;
    transform: rotate(90deg);
}

/* Cajón del Menú Móvil (Drawer) */
.bs-mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 85%;
    height: 100vh;
    background: #ffffff;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.08);
    z-index: 100002;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}
.bs-mobile-drawer.bs-active {
    transform: translateX(0);
}
.bs-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.bs-drawer-logo {
    height: 55px !important;
    width: auto !important;
}
.bs-drawer-close {
    background: transparent;
    border: none;
    color: var(--bs-dark) !important;
    font-size: 28px !important;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.bs-mobile-nav {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px 0;
}
.bs-mobile-menu-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.bs-mobile-menu-item {
    width: 100%;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}
.bs-mobile-item-link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
}
.bs-mobile-menu-item a {
    color: var(--bs-dark) !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    flex-grow: 1;
}
.bs-mobile-toggle-submenu {
    background: transparent;
    border: none;
    color: rgba(13, 44, 29, 0.4);
    cursor: pointer;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.bs-mobile-toggle-submenu.bs-rotated {
    transform: rotate(180deg);
    color: var(--bs-primary);
}
.bs-mobile-submenu {
    background: rgba(13, 44, 29, 0.02);
    margin: 0;
    padding: 8px 0;
    list-style: none;
    border-top: 1px solid rgba(0,0,0,0.02);
}
.bs-mobile-submenu-item a {
    display: block;
    padding: 8px 40px;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    color: rgba(13, 44, 29, 0.8) !important;
}
.bs-mobile-submenu-item.bs-active a,
.bs-mobile-submenu-item a:hover {
    color: var(--bs-primary) !important;
}

/* Backdrop para Móvil */
.bs-drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(13, 44, 29, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100001;
}
.bs-drawer-backdrop.bs-active {
    opacity: 1;
    visibility: visible;
}

/* ==========================================
   RESPONSIVIDAD Y ESPACIADOS EN PANTALLAS
   ========================================== */
@media (max-width: 1200px) {
    .bs-action-label {
        display: none !important;
    }
    .bs-header-container {
        padding: 0 20px;
    }
    .bs-logo-img {
        height: 95px !important;
        top: 12px;
    }
    .bs-menu-item > a {
        padding: 0 10px;
        font-size: 13px !important;
    }
    .bs-custom-header {
        height: 85px;
    }
    .bs-menu-item > a::after {
        bottom: 22px;
    }
}

@media (max-width: 950px) {
    .bs-desktop-nav {
        display: none !important;
    }
    .bs-mobile-menu-toggle {
        display: flex !important;
    }
    .bs-action-label {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .bs-custom-header {
        height: 70px;
    }
    .bs-header-container {
        padding: 0 15px;
    }
    .bs-logo-img {
        height: 75px !important;
        top: 8px;
    }
    .bs-action-btn {
        padding: 8px 10px;
        height: 40px;
    }
    .bs-search-overlay {
        height: 140px;
    }
    .bs-search-input {
        font-size: 18px !important;
    }
    .bs-search-close {
        top: 15px;
        right: 20px;
        font-size: 26px !important;
    }
}
