/*==================================================
VARIABLES & THEME CONFIGURATION
==================================================*/
:root {
    --sidv-header-bg: rgba(255, 255, 255, 0.96);
    --sidv-header-bg-scrolled: rgba(255, 255, 255, 0.99);
    --sidv-header-border: rgba(2, 86, 114, 0.1);
    --sidv-header-shadow: 0 10px 30px rgba(2, 86, 114, 0.08);
    
    /* Paleta Corporativa */
    --sidv-cyan-blue: #025672;
    --sidv-cyan-blue-hover: #013f54;
    --sidv-yellow: #f09700;
    --sidv-yellow-hover: #d88700;
    --sidv-text-dark: #0D2137;
    --sidv-border-light: #E5E7EB;
    --sidv-bg-light: #F8FAFC;
    --sidv-bg-muted: #F4F5F7;
    
    /* Transiciones */
    --sidv-transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/*==================================================
HEADER BASE
==================================================*/

.sidv-header {
    position: sticky;
    top: 0;
    z-index: 900;
    width: 100%;
    background: var(--sidv-header-bg);
    border-bottom: 1px solid var(--sidv-header-border);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: var(--sidv-transition);
    will-change: transform, background-color, box-shadow;
}

/* Estado elevado al hacer scroll */
.sidv-header.is-scrolled {
    background: var(--sidv-header-bg-scrolled);
    border-bottom-color: transparent;
    box-shadow: var(--sidv-header-shadow);
}

/* Ocultado dinámico */
.sidv-header.is-hidden {
    transform: translateY(-100%);
}


/*==================================================
WRAPPER
==================================================*/

.sidv-header__wrapper {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(250px, 320px) auto;
    align-items: center;
    gap: 1.5rem;
    min-height: 90px;
}


/*==================================================
BRAND
==================================================*/

.sidv-header__brand {
    display: flex;
    align-items: center;
    min-width: 0;
}

.sidv-header__logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
    border-radius: 6px;
    transition: transform 0.2s ease;
}

.sidv-header__logo:focus-visible {
    outline: 2px solid var(--sidv-yellow);
    outline-offset: 4px;
}

.sidv-header__logo img {
    display: block;
    width: auto;
    height: 58px;
    max-width: 180px;
    object-fit: contain;
}


/*==================================================
NAVIGATION
==================================================*/

.sidv-header__navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}


/*==================================================
SEARCH
==================================================*/

.sidv-header__search {
    width: 100%;
    min-width: 0;
}


/*==================================================
ACTIONS
==================================================*/

.sidv-header__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    min-width: 0;
}


/*==================================================
ACCOUNT & CART & QUOTE BUTTON BASE
==================================================*/

.sidv-header__account,
.sidv-header__cart,
.sidv-header__quote {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    height: 46px;
    padding: 0 1.15rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--sidv-transition);
}

.sidv-header__account:focus-visible,
.sidv-header__cart:focus-visible,
.sidv-header__quote:focus-visible {
    outline: 2px solid var(--sidv-yellow);
    outline-offset: 2px;
}

.sidv-header__account .sidv-icon,
.sidv-header__cart .sidv-icon,
.sidv-header__quote .sidv-icon {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

/* Hover Icon Feedback */
.sidv-header__account:hover .sidv-icon,
.sidv-header__cart:hover .sidv-icon,
.sidv-header__quote:hover .sidv-icon {
    transform: scale(1.08);
}


/*==================================================
ACCOUNT SPECIFIC
==================================================*/

.sidv-header__account {
    border: 1px solid var(--sidv-border-light);
    background: #FFFFFF;
    color: var(--sidv-text-dark);
}

.sidv-header__account:hover {
    background: var(--sidv-bg-light);
    border-color: #CBD5E1;
    color: var(--sidv-cyan-blue);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(2, 86, 114, 0.08);
}

.sidv-header__account .sidv-icon {
    color: var(--sidv-cyan-blue);
}


/*==================================================
CART SPECIFIC
==================================================*/

.sidv-header__cart {
    border: 1px solid var(--sidv-border-light);
    background: var(--sidv-bg-muted);
    color: var(--sidv-text-dark);
}

.sidv-header__cart:hover {
    background: #ECEEF2;
    border-color: #D6DAE0;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(2, 86, 114, 0.08);
}

.sidv-header__cart .sidv-icon {
    color: var(--sidv-text-dark);
}


/*==================================================
QUOTE SPECIFIC
==================================================*/

.sidv-header__quote {
    border: 1px solid transparent;
    background: var(--sidv-yellow);
    color: #FFFFFF;
    font-weight: 800;
}

.sidv-header__quote:hover {
    background: var(--sidv-yellow-hover);
    color: #FFFFFF;
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(240, 151, 0, 0.3);
}

.sidv-header__quote .sidv-icon {
    color: #FFFFFF;
}


/*==================================================
MENU TOGGLE (MOBILE / SIDEBAR TRIGGER)
==================================================*/

.sidv-header__toggle {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--sidv-cyan-blue);
    color: #FFFFFF;
    cursor: pointer;
    transition: var(--sidv-transition);
}

.sidv-header__toggle-bar {
    display: block;
    width: 20px;
    height: 2px;
    background-color: #FFFFFF;
    border-radius: 2px;
    transform-origin: center;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                opacity 0.25s ease, 
                background-color 0.25s ease;
}

.sidv-header__toggle:hover {
    background: var(--sidv-cyan-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(2, 86, 114, 0.25);
}

.sidv-header__toggle:focus-visible {
    outline: 3px solid var(--sidv-yellow);
    outline-offset: 3px;
}

/* Animación a 'X' cuando el menú está abierto */
.sidv-header__toggle.is-active {
    background: var(--sidv-yellow);
}

.sidv-header__toggle.is-active .sidv-header__toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.sidv-header__toggle.is-active .sidv-header__toggle-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.sidv-header__toggle.is-active .sidv-header__toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}


/*==================================================
RESPONSIVE BREAKPOINTS
==================================================*/

@media (max-width: 1280px) {
    .sidv-header__wrapper {
        gap: 1.1rem;
    }

    .sidv-header__account,
    .sidv-header__cart,
    .sidv-header__quote {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }

    .sidv-header__logo img {
        max-width: 165px;
    }
}

@media (max-width: 1150px) {
    .sidv-header__wrapper {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 1rem;
    }

    .sidv-header__search {
        display: none;
    }

    .sidv-header__navigation {
        justify-content: flex-end;
    }

    .sidv-header__actions {
        gap: 0.5rem;
    }
}

@media (max-width: 992px) {
    .sidv-header__wrapper {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 82px;
        gap: 1rem;
    }

    .sidv-header__navigation,
    .sidv-header__search {
        display: none !important;
    }

    .sidv-header__actions {
        margin-left: auto;
    }

    .sidv-header__account,
    .sidv-header__cart,
    .sidv-header__quote {
        display: none !important;
    }

    /* Muestra forzada del botón móvil */
    .sidv-header__toggle {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .sidv-header__toggle-bar {
        display: block !important;
        width: 20px;
        height: 2px;
        background-color: #FFFFFF;
    }
}

@media (max-width: 768px) {
    .sidv-header__wrapper {
        min-height: 76px;
    }

    .sidv-header__logo img {
        height: 52px;
        max-width: 155px;
    }

    .sidv-header__toggle {
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 480px) {
    .sidv-header__wrapper {
        min-height: 72px;
        gap: 0.75rem;
    }

    .sidv-header__logo img {
        height: 48px;
        max-width: 145px;
    }

    .sidv-header__toggle {
        width: 42px;
        height: 42px;
    }
}


/*==================================================
REDUCED MOTION
==================================================*/

@media (prefers-reduced-motion: reduce) {
    .sidv-header,
    .sidv-header__logo,
    .sidv-header__account,
    .sidv-header__cart,
    .sidv-header__quote,
    .sidv-header__toggle,
    .sidv-header__toggle-bar {
        transition: none !important;
    }
}