/* ==========================================================================
   HEADER – BASE STRUCTURE
   Controls layout, spacing, alignment for the entire header
   ========================================================================== */

.header-wrapper {
    width: 100%;
    background: var(--eb-header-bg);
    border-bottom: 1px solid var(--eb-header-border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    position: sticky;
    top: 0;
}

/* Main nav container */
.main-header {
    display: flex;
    align-items: center;
    width: 100%;
    background: var(--eb-primary-500);
    border-bottom: 1px solid var(--eb-header-border);
}

.main-header__container {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 10px;
    padding-bottom: 10px;
}

.main-header__brand {
    flex-shrink: 0;
}

.main-header__primary {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.main-header__search {
    flex: 1 1 520px;
    min-width: min(420px, 100%);
}

.main-header__actions {
    flex-shrink: 0;
}

.header-primary-link {
    color: var(--eb-primary-50);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.header-primary-link:hover,
.header-primary-link.is-active {
    color: var(--eb-white);
}

.header-workspace-trigger,
.header-account-trigger {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.12);
    color: var(--eb-white);
    min-height: 42px;
    padding: 8px 14px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.header-workspace-trigger:hover,
.header-account-trigger:hover,
.header-workspace-link:hover {
    transform: translateY(-1px);
}

.header-workspace-trigger__caret,
.header-account-trigger__caret {
    width: 16px;
    height: 16px;
    opacity: 0.85;
}

.header-account-trigger__avatar {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--eb-white);
    color: var(--eb-primary-700);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.header-account-trigger__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-account-trigger__icon svg,
.header-workspace-trigger svg {
    width: 16px;
    height: 16px;
}

.header-nav-dropdown {
    min-width: 340px;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.header-nav-dropdown__panel {
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
}

.header-nav-dropdown--account {
    min-width: 320px;
}

.header-nav-dropdown--account .header-nav-dropdown__panel {
    max-height: min(72vh, 560px);
    overflow: hidden;
}

.header-nav-dropdown--account .sidebar-accordion {
    max-height: min(72vh, 460px);
    overflow-y: auto;
    scrollbar-gutter: stable;
    padding-top: 0;
}

.header-nav-dropdown--account .sidebar-group__label {
    padding-top: 8px;
    padding-bottom: 6px;
}

.header-nav-dropdown--account .sidebar-link-row {
    padding-top: 9px;
    padding-bottom: 9px;
}

.header-nav-dropdown--account .sidebar-link-row__description {
    display: none;
}

.header-nav-dropdown .sidebar-panel__heading {
    font-size: 18px;
}

.header-nav-dropdown .sidebar-accordion {
    padding-top: 4px;
}

.header-nav-dropdown .sidebar-group__label {
    padding-top: 10px;
}

.header-nav-dropdown .sidebar-link-row {
    padding-top: 10px;
    padding-bottom: 10px;
}

.header-nav-dropdown .sidebar-link-row__icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
}

.header-nav-dropdown .sidebar-link-row__icon svg {
    width: 16px;
    height: 16px;
}

.navbar-brand img {
    height: auto;
    max-height: 36px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

/* Desktop container spacing */
#desktopMenu {
    display: flex;
    align-items: center;
    width: 100%;
}

/* Icon cluster wrapper */
.header-icons {
    display: flex;
    align-items: center;
    gap: 22px;
}

/* Generic header icon */
.header-icon {
    font-size: 20px;
    color: var(--eb-white);
    position: relative;
    cursor: pointer;
    transition: 0.2s ease;
    background: transparent;
    border: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-icon-button {
    appearance: none;
}

.header-avatar__initial {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--eb-header-avatar-bg);
    color: var(--eb-header-avatar-text);
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
}

.header-icon:hover {
    color: var(--eb-primary-100);
}

/* Cart + Notification badges */
.cart-badge,
.notif-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: var(--eb-header-badge-bg);
    color: var(--eb-header-badge-text);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 12px;
}

.notif-menu {
    min-width: 360px;
    max-width: 420px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--eb-header-notif-header-border);
    background: var(--eb-bg-card);
    box-shadow: var(--eb-shadow-lg);
}

.notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--eb-header-notif-header-border);
    background: linear-gradient(180deg, var(--eb-header-notif-header-bg) 0%, var(--eb-white) 100%);
}

.notif-header__title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--eb-gray-700);
}

.notif-clear-btn {
    border: 1px solid var(--eb-gray-200);
    background: var(--eb-white);
    color: var(--eb-gray-700);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    transition: 0.2s ease;
}

.notif-clear-form {
    margin: 0;
}

.notif-clear-btn:hover {
    border-color: var(--eb-primary-500);
    color: var(--eb-primary-700);
    background: var(--eb-primary-50);
}

.notif-list {
    margin: 0;
}

.notif-item {
    border: 0;
    border-bottom: 1px solid var(--eb-gray-100);
    padding: 12px 14px;
    background: var(--eb-bg-card);
    transition: background 0.2s ease;
}

.notif-list--compact .notif-item {
    font-size: 12px;
}

.notif-list--full .notif-item {
    font-size: 14px;
}

.notif-item:last-child {
    border-bottom: 0;
}

.notif-item.is-unread {
    background: linear-gradient(90deg, var(--eb-primary-50) 0%, var(--eb-white) 60%);
    border-left: 3px solid var(--eb-primary-500);
}

.notif-item:hover {
    background: var(--eb-bg-hover);
}

.notif-title {
    font-size: 13px;
    color: var(--eb-gray-900);
}

.notif-body {
    color: var(--eb-gray-600);
}

.notif-meta {
    font-size: 11px;
    color: var(--eb-gray-500);
}

.notif-link {
    color: var(--eb-primary-700);
    font-weight: 600;
}

.notif-link:hover {
    color: var(--eb-primary-900);
}

.notif-viewall-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid var(--eb-header-notif-viewall-border);
    background: var(--eb-header-notif-viewall-bg);
    color: var(--eb-header-notif-viewall-text);
    font-size: 12px;
    text-decoration: none;
    width: 100%;
}

.notif-viewall-btn:hover {
    border-color: var(--eb-header-notif-viewall-hover-border);
    color: var(--eb-header-notif-viewall-hover-text);
}

.header-text-link-light
{
    color: var(--eb-primary-50);
}

.header-mobile-trigger {
    margin-left: 4px;
}

.sidebar-panel--global-nav .sidebar-panel__heading {
    font-size: 20px;
}

@media (max-width: 767.98px) {
    .main-header .container {
        padding-top: 4px;
        padding-bottom: 4px;
        gap: 10px;
        flex-wrap: wrap;
    }

    .navbar-brand img {
        height: auto;
        max-height: 28px;
        width: auto;
    }

    .navbar-brand .badge {
        display: inline-flex;
        align-items: center;
        font-size: 10px;
        padding: 2px 6px;
    }

    .navbar-brand {
        order: 1;
    }

    .header-icons {
        order: 3;
        margin-left: auto;
    }

    .search-wrap {
        order: 4;
        width: 100%;
    }

    .header-icons {
        gap: 10px;
    }

    .header-icon {
        font-size: 18px;
    }

    .header-avatar__initial {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .main-header__container {
        gap: 10px;
    }
}
