/* HEADER COMPACT - Baytima */

/* Logo plus compact */
.header__logo {
    gap: 6px !important;
}

.header__logo-icon {
    font-size: 20px !important;
}

.header__logo span {
    font-size: 18px !important;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Navigation plus compacte */
.header__nav {
    gap: 4px !important;
}

.header__nav-link {
    padding: 8px 12px !important;
    font-size: 14px !important;
}

/* Dropdown Menu Styles */
.header__dropdown {
    position: relative;
    display: inline-block;
}

.header__dropdown-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    font-size: 14px;
    color: inherit;
    transition: all 0.2s ease;
}

.header__dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.header__dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow: hidden;
}

.header__dropdown:hover .header__dropdown-menu,
.header__dropdown-menu:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header__dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    color: var(--text-primary, #2d3436);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.header__dropdown-item:hover {
    background: linear-gradient(90deg, rgba(0, 168, 132, 0.1) 0%, transparent 100%);
    padding-left: 20px;
}

/* User Menu */
.header__user-menu {
    position: relative;
}

.header__user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow: hidden;
}

.header__user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Actions plus compactes */
.header__actions {
    gap: 4px !important;
}

.header__actions .btn {
    padding: 8px 12px !important;
    font-size: 14px !important;
}

.header__actions .btn-icon {
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .header__nav-link {
        padding: 6px 10px !important;
        font-size: 13px !important;
    }

    .header__actions .btn {
        padding: 6px 10px !important;
        font-size: 13px !important;
    }

    .header__actions .btn-icon {
        width: 32px !important;
        height: 32px !important;
    }
}

/* Responsive - Mobile */
@media (max-width: 767px) {
    /* Dropdown dans le menu mobile */
    .header__dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(0, 0, 0, 0.1);
        margin-top: 4px;
        border-radius: 8px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .header__dropdown.active .header__dropdown-menu {
        max-height: 300px;
    }

    .header__dropdown-toggle {
        width: 100%;
        text-align: left;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .header__dropdown-item {
        padding: 10px 16px;
        font-size: 13px;
    }

    /* User dropdown mobile */
    .header__user-dropdown {
        position: fixed;
        top: 56px;
        right: 0;
        left: 0;
        border-radius: 0;
        max-height: calc(100vh - 56px);
        overflow-y: auto;
    }

    .header__user-menu .btn {
        padding: 8px !important;
        font-size: 13px !important;
    }
}

/* Animation pour les badges */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

#unreadMessagesBadge[style*="display: flex"],
#compareCountBadge[style*="display: flex"] {
    animation: pulse 2s ease-in-out infinite;
}

/* Hover effects améliorés */
.header__dropdown-item:active {
    transform: scale(0.98);
    background: rgba(0, 168, 132, 0.2);
}

/* Focus visible pour accessibilité */
.header__dropdown-toggle:focus-visible,
.header__user-menu .btn:focus-visible {
    outline: 2px solid var(--primary, #00A884);
    outline-offset: 2px;
}

/* Séparateur dans dropdown */
.header__dropdown-menu hr,
.header__user-dropdown hr {
    margin: 8px 0;
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Loading state pour le user menu */
#userMenuLabel::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-right: 0;
    border-radius: 50%;
    background: currentColor;
    transition: all 0.3s ease;
}

#userMenuLabel.loading::before {
    width: 8px;
    height: 8px;
    margin-right: 6px;
    animation: pulse 1s ease-in-out infinite;
}

/* Amélioration du logo Baytima */
.header__logo:hover .header__logo-icon {
    transform: scale(1.1) rotate(5deg);
    transition: transform 0.3s ease;
}

/* Indicateur visuel du dropdown actif */
.header__dropdown:hover .header__dropdown-toggle::after,
.header__user-menu:hover .btn::after {
    transform: rotate(180deg);
}

.header__dropdown-toggle::after,
.header__user-menu .btn::after {
    display: inline-block;
    transition: transform 0.3s ease;
}
