/* ==================================================
   HISPASEEDS - HEADER V14 (ZERO GAP EDITION)
   PC Perfecto + Mobile Luxe Buttons sin huecos
   ================================================== */

/* 1. RESET Y ESTRUCTURA MAESTRA */
.site-header.hs-site-header {
    background: #070707 !important;
    border-bottom: 1px solid rgba(198, 168, 90, 0.15) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 9999 !important;
    padding: 0 !important;
    margin: 0 !important;
}

.hs-header-shell {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    max-width: 1500px !important;
    margin: 0 auto !important;
    padding: 0 40px !important;
    min-height: 105px !important;
}

/* 2. LOGO XL (PC) */
.hs-header-brand {
    flex: 0 0 auto !important;
    width: 320px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.hs-header-brand img,
.site-header .custom-logo {
    max-height: 90px !important;
    width: auto !important;
    display: block !important;
}

/* 3. OCULTAR TOGGLE EN PC POR DEFECTO (BLINDADO) */
.hs-header-toggle,
.site-header button.hs-header-toggle {
    display: none !important;
}

/* 4. PANEL DERECHO (PC) */
.hs-header-tools {
    display: flex !important;
    flex: 1 !important;
    justify-content: flex-end !important;
    align-items: center !important;
    margin-left: 3vw !important;
}

.hs-header-panel {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 30px !important;
    width: 100% !important;
}

/* 5. BUSCADOR ESTILIZADO */
.hs-header-search {
    flex: 0 1 280px !important;
    margin-right: auto !important;
}

.hs-header-search form,
.hs-header-search .woocommerce-product-search {
    display: flex !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.hs-header-search input[type="search"] {
    width: 100% !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(198, 168, 90, 0.25) !important;
    border-radius: 4px !important;
    padding: 10px 15px !important;
    color: #fff !important;
    font-size: 0.9rem !important;
    height: auto !important;
    transition: border-color 0.3s ease !important;
    box-shadow: none !important;
}

.hs-header-search input[type="search"]:focus {
    border-color: #c6a85a !important;
    outline: none !important;
}

.hs-header-search input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c6a85a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cline x1='18' y1='6' x2='6' y2='18'%3e%3c/line%3e%3cline x1='6' y1='6' x2='18' y2='18'%3e%3c/line%3e%3c/svg%3e");
    cursor: pointer;
}

/* Purgar botones inútiles */
.hs-header-search button,
.hs-header-search .search-submit,
.hs-header-search .ast-search-icon,
.hs-header-search label::after { display: none !important; }

/* 6. NAVEGACIÓN PC */
.site-header .main-header-menu {
    display: flex !important;
    flex-direction: row !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 15px !important;
}

.site-header .main-header-menu li {
    list-style: none !important;
    margin: 0 !important;
}
.site-header .main-header-menu li::before {
    display: none !important;
}

.site-header .main-header-menu li a {
    color: #f6f0e3 !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    text-decoration: none !important;
    transition: color 0.3s ease !important;
    border: none !important;
    background: transparent !important;
    padding: 5px 10px !important;
    display: block !important;
    box-shadow: none !important;
}

.site-header .main-header-menu li a:hover {
    color: #c6a85a !important;
    background: transparent !important;
}

/* 7. ICONOS PREMIUM (CUENTA Y CARRITO) */
.hs-header-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 20px !important;
}

.hs-header-action-label { display: none !important; }

.hs-header-account,
.hs-header-cart {
    display: flex !important;
    align-items: center !important;
    text-decoration: none !important;
    background: transparent !important;
    border: none !important;
    padding: 5px !important;
}

.hs-header-account::before,
.hs-header-cart::before {
    content: "";
    display: inline-block;
    width: 24px;
    height: 24px;
    background-color: #f6f0e3 !important;
    transition: background-color 0.3s ease !important;
}

.hs-header-account:hover::before,
.hs-header-cart:hover::before {
    background-color: #c6a85a !important;
}

.hs-header-account::before {
    -webkit-mask: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3e%3ccircle cx='12' cy='7' r='4'/%3e%3c/svg%3e") no-repeat center;
    mask: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3e%3ccircle cx='12' cy='7' r='4'/%3e%3c/svg%3e") no-repeat center;
    -webkit-mask-size: contain; mask-size: contain;
}

.hs-header-cart::before {
    -webkit-mask: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z'/%3e%3cline x1='3' y1='6' x2='21' y2='6'/%3e%3cpath d='M16 10a4 4 0 0 1-8 0'/%3e%3c/svg%3e") no-repeat center;
    mask: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z'/%3e%3cline x1='3' y1='6' x2='21' y2='6'/%3e%3cpath d='M16 10a4 4 0 0 1-8 0'/%3e%3c/svg%3e") no-repeat center;
    -webkit-mask-size: contain; mask-size: contain;
}

.hs-cart-count {
    background: #c6a85a !important;
    color: #000 !important;
    font-size: 0.75rem !important;
    font-weight: 800 !important;
    padding: 2px 7px !important;
    border-radius: 20px !important;
    margin-left: -5px !important;
    margin-top: -12px !important;
    position: relative;
    z-index: 2;
}

/* 8. RESPONSIVE MÓVIL PERFECTO (ZERO GAP FIX) */
@media (max-width: 921px) {
    .hs-header-shell { min-height: 80px !important; padding: 0 20px !important; }
    
    /* LOGO MÓVIL AUMENTADO */
    .hs-header-brand { width: auto !important; max-width: calc(100% - 60px) !important; }
    .hs-header-brand img, .site-header .custom-logo { max-height: 65px !important; }

    .hs-header-tools { margin-left: 0 !important; width: auto !important; }

    /* HAMBURGUESA INTACTA */
    button.hs-header-toggle, 
    .site-header button.hs-header-toggle {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 6px !important;
        width: 44px !important;
        height: 44px !important;
        background: transparent !important;
        background-color: transparent !important;
        background-image: none !important;
        border: 1px solid rgba(198, 168, 90, 0.4) !important;
        border-radius: 8px !important;
        cursor: pointer !important;
        z-index: 10001 !important;
        position: relative !important;
        box-shadow: none !important;
        margin: 0 !important; 
        padding: 0 !important;
    }

    button.hs-header-toggle:hover,
    button.hs-header-toggle:focus,
    button.hs-header-toggle:active {
        background: transparent !important;
        background-color: transparent !important;
        background-image: none !important;
        border-color: #c6a85a !important;
        box-shadow: 0 0 12px rgba(198, 168, 90, 0.3) !important; 
    }

    button.hs-header-toggle::before,
    button.hs-header-toggle::after { display: none !important; }

    .hs-header-toggle span {
        display: block !important;
        width: 24px !important;
        height: 2px !important;
        background: #c6a85a !important;
        border-radius: 0 !important;
    }

    /* BANDEJA MÓVIL FLOTANTE - FORZADA HACIA ARRIBA */
    .hs-header-panel {
        display: none !important; 
        position: absolute !important; 
        top: 80px !important;
        left: 0 !important;
        width: 100% !important;
        height: auto !important; 
        min-height: 0 !important;
        background: rgba(7, 7, 7, 0.98) !important;
        backdrop-filter: blur(15px);
        flex-direction: column !important;
        justify-content: flex-start !important; /* EMPUJA TODO HACIA ARRIBA */
        padding: 20px 20px 30px 20px !important;
        border-bottom: 1px solid rgba(198, 168, 90, 0.3) !important;
        border-radius: 0 0 20px 20px !important; 
        box-shadow: 0 20px 40px rgba(0,0,0,0.8) !important;
        z-index: 9999 !important;
        box-sizing: border-box !important;
        gap: 0 !important; 
    }

    .hs-header-panel.is-open { display: flex !important; }

    /* BUSCADOR - SIN CRECIMIENTO Y CON MÍNIMO MARGEN */
    .hs-header-search { 
        margin: 0 0 15px 0 !important; 
        padding: 0 !important;
        width: 100% !important; 
        max-width: none !important;
        flex: 0 0 auto !important; /* PROHÍBE AL BUSCADOR ESTIRARSE */
    }

    /* MATAMOS CUALQUIER DIV FANTASMA DE ASTRA QUE ESTÉ HACIENDO BULTOS */
    .hs-header-nav, .main-header-menu-wrap, .hs-header-nav div {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        display: block !important;
        flex: 0 0 auto !important; /* PROHÍBE AL CONTENEDOR ESTIRARSE */
    }

    .site-header .main-header-menu {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 12px !important; 
        margin: 0 0 25px 0 !important; /* ASEGURAMOS QUE NO HAYA MARGEN SUPERIOR */
        padding: 0 !important;
        align-items: stretch !important; 
        flex: 0 0 auto !important; /* PROHÍBE AL MENÚ ESTIRARSE */
    }

    .site-header .main-header-menu li {
        display: block !important; 
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* BOTÓN "LUXE" INTACTO */
    .site-header .main-header-menu li a { 
        display: flex !important;
        font-size: 1rem !important; 
        font-weight: 800 !important;
        letter-spacing: 0.1em !important;
        color: #c6a85a !important;
        padding: 16px 20px !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        background: linear-gradient(145deg, rgba(20, 20, 20, 0.95), rgba(10, 10, 10, 0.98)) !important;
        border: 1px solid rgba(198, 168, 90, 0.25) !important; 
        border-radius: 12px !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.4) !important;
        box-sizing: border-box !important; 
        transition: all 0.3s ease !important;
    }

    .site-header .main-header-menu li a:hover {
        border-color: rgba(198, 168, 90, 0.6) !important;
        background: linear-gradient(145deg, rgba(30, 30, 30, 0.95), rgba(15, 15, 15, 0.98)) !important;
        box-shadow: 0 4px 20px rgba(198, 168, 90, 0.1) !important;
        transform: translateY(-2px) !important;
        color: #f6f0e3 !important;
    }

    /* ICONOS DE CUENTA Y CARRITO */
    .hs-header-actions {
        display: flex !important;
        flex-direction: row !important; 
        justify-content: center !important;
        align-items: center !important;
        gap: 50px !important; 
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        flex: 0 0 auto !important; /* QUE TAMPOCO SE ESTIREN ESTOS */
    }

    .hs-header-account::before, .hs-header-cart::before {
        width: 32px !important;
        height: 32px !important;
    }
}