/* ==========================================================================
   AluminiumGlass.co.in
   Public Marketplace
   Component: Header
   File:
   /home/jqkmqvml/public_html/assets/css/components/header.css

   Live-data rule:
   - No fake/demo/sample marketplace data.
   - No hardcoded vendor/business/product/user records.
   - No API/database logic in CSS.
   - All dynamic content is supplied by HTML/JS/API.
   ========================================================================== */


/* ==========================================================================
   1. HEADER ROOT
   ========================================================================== */

.site-header {
    position: relative;
    z-index: var(--z-header, 1000);

    width: 100%;
    min-width: 0;

    background:
        var(
            --header-background,
            var(--color-surface, #ffffff)
        );

    color:
        var(
            --header-text,
            var(--color-text, #1f2937)
        );

    border-bottom:
        1px solid
        var(
            --header-border,
            var(--color-border, #e5e7eb)
        );

    box-shadow:
        var(
            --header-shadow,
            0 1px 3px rgb(0 0 0 / 0.05)
        );
}

.site-header__inner {
    width: 100%;
    min-width: 0;
}

.site-header__container {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
}


/* ==========================================================================
   2. HEADER MAIN ROW
   ========================================================================== */

.site-header__main {
    display: flex;
    align-items: center;
    gap: var(--header-gap, 1rem);

    width: 100%;
    min-width: 0;

    min-height:
        var(
            --header-main-height,
            4.5rem
        );
}


/* ==========================================================================
   3. BRAND
   ========================================================================== */

.site-header__brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;

    min-width: 0;

    color:
        var(
            --header-brand-color,
            var(--color-text, #1f2937)
        );

    text-decoration: none;
}

.site-header__brand:hover {
    color:
        var(
            --header-brand-hover,
            var(--color-primary, #2563eb)
        );
}

.site-header__brand:focus-visible {
    outline:
        2px solid
        var(
            --color-focus,
            var(--color-primary, #2563eb)
        );

    outline-offset: 4px;
    border-radius: var(--radius-sm, 0.375rem);
}

.site-header__brand-logo {
    display: block;

    width:
        var(
            --header-logo-width,
            auto
        );

    max-width: 100%;
    height:
        var(
            --header-logo-height,
            2.75rem
        );

    object-fit: contain;
}

.site-header__brand-text {
    display: inline-flex;
    align-items: center;

    min-width: 0;

    font-size:
        var(
            --header-brand-font-size,
            1.25rem
        );

    font-weight:
        var(
            --header-brand-font-weight,
            800
        );

    line-height: 1.2;
    white-space: nowrap;
}


/* ==========================================================================
   4. GLOBAL SEARCH AREA
   ========================================================================== */

.site-header__search {
    flex: 1 1 auto;

    width: 100%;
    min-width: 0;
    max-width:
        var(
            --header-search-max-width,
            52rem
        );

    margin-inline: auto;
}

.site-header__search-inner {
    display: flex;
    align-items: stretch;

    width: 100%;
    min-width: 0;
}

.site-header__search .search-box,
.site-header__search form {
    width: 100%;
    min-width: 0;
}


/* ==========================================================================
   5. LOCATION AREA
   ========================================================================== */

.site-header__location {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;

    min-width: 0;
}

.site-header__location-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;

    min-width: 0;
    max-width:
        var(
            --header-location-max-width,
            16rem
        );

    padding:
        0.5rem
        0.625rem;

    color:
        var(
            --header-location-text,
            var(--color-text, #1f2937)
        );

    background: transparent;

    border: 1px solid transparent;
    border-radius:
        var(
            --radius-md,
            0.5rem
        );

    font: inherit;
    cursor: pointer;
}

.site-header__location-trigger:hover {
    background:
        var(
            --header-item-hover-background,
            #f3f4f6
        );

    border-color:
        var(
            --header-item-hover-border,
            #e5e7eb
        );
}

.site-header__location-trigger:focus-visible {
    outline:
        2px solid
        var(
            --color-focus,
            var(--color-primary, #2563eb)
        );

    outline-offset: 2px;
}

.site-header__location-icon {
    flex: 0 0 auto;
}

.site-header__location-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    min-width: 0;
}

.site-header__location-label {
    color:
        var(
            --header-location-label,
            var(--color-text-muted, #6b7280)
        );

    font-size:
        var(
            --font-size-xs,
            0.75rem
        );

    line-height: 1.2;
}

.site-header__location-value {
    max-width: 100%;

    overflow: hidden;

    color:
        var(
            --header-location-value,
            var(--color-text, #1f2937)
        );

    font-size:
        var(
            --font-size-sm,
            0.875rem
        );

    font-weight: 600;
    line-height: 1.4;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ==========================================================================
   6. HEADER ACTIONS
   ========================================================================== */

.site-header__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    flex: 0 0 auto;

    min-width: 0;
    gap: var(--header-action-gap, 0.5rem);
}

.site-header__action {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;

    min-width: 2.5rem;
    min-height: 2.5rem;

    padding:
        0.5rem
        0.625rem;

    color:
        var(
            --header-action-color,
            var(--color-text, #1f2937)
        );

    background: transparent;

    border: 1px solid transparent;
    border-radius:
        var(
            --radius-md,
            0.5rem
        );

    font: inherit;
    text-decoration: none;

    cursor: pointer;
}

.site-header__action:hover {
    color:
        var(
            --header-action-hover-color,
            var(--color-primary, #2563eb)
        );

    background:
        var(
            --header-item-hover-background,
            #f3f4f6
        );

    border-color:
        var(
            --header-item-hover-border,
            #e5e7eb
        );
}

.site-header__action:focus-visible {
    outline:
        2px solid
        var(
            --color-focus,
            var(--color-primary, #2563eb)
        );

    outline-offset: 2px;
}

.site-header__action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;
}

.site-header__action-text {
    min-width: 0;

    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ==========================================================================
   7. CART BADGE
   ========================================================================== */

.site-header__cart {
    position: relative;
}

.site-header__cart-badge {
    position: absolute;
    top: 0.125rem;
    inset-inline-end: 0.125rem;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 1.125rem;
    min-height: 1.125rem;

    padding:
        0.125rem
        0.3rem;

    color:
        var(
            --header-badge-text,
            #ffffff
        );

    background:
        var(
            --header-badge-background,
            var(--color-danger, #dc2626)
        );

    border:
        2px solid
        var(
            --header-background,
            #ffffff
        );

    border-radius: 999px;

    font-size:
        var(
            --font-size-xs,
            0.75rem
        );

    font-weight: 700;
    line-height: 1;

    pointer-events: none;
}


/* ==========================================================================
   8. AUTH / ACCOUNT AREA
   ========================================================================== */

.site-header__account {
    position: relative;
    flex: 0 0 auto;
}

.site-header__account-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;

    min-width: 0;
    max-width:
        var(
            --header-account-max-width,
            14rem
        );

    padding:
        0.375rem
        0.5rem;

    color:
        var(
            --header-account-color,
            var(--color-text, #1f2937)
        );

    background: transparent;

    border: 1px solid transparent;
    border-radius:
        var(
            --radius-md,
            0.5rem
        );

    font: inherit;
    cursor: pointer;
}

.site-header__account-trigger:hover {
    background:
        var(
            --header-item-hover-background,
            #f3f4f6
        );
}

.site-header__account-trigger:focus-visible {
    outline:
        2px solid
        var(
            --color-focus,
            var(--color-primary, #2563eb)
        );

    outline-offset: 2px;
}

.site-header__account-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: 2.25rem;
    height: 2.25rem;

    overflow: hidden;

    background:
        var(
            --avatar-background,
            #e5e7eb
        );

    border-radius: 50%;
}

.site-header__account-avatar img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}

.site-header__account-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    min-width: 0;
}

.site-header__account-label {
    color:
        var(
            --color-text-muted,
            #6b7280
        );

    font-size:
        var(
            --font-size-xs,
            0.75rem
        );
}

.site-header__account-name {
    max-width: 100%;

    overflow: hidden;

    color:
        var(
            --color-text,
            #1f2937
        );

    font-size:
        var(
            --font-size-sm,
            0.875rem
        );

    font-weight: 600;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ==========================================================================
   9. LOGIN / REGISTER CTA
   ========================================================================== */

.site-header__auth-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.site-header__login,
.site-header__register {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 2.5rem;

    padding:
        0.5rem
        0.875rem;

    border-radius:
        var(
            --radius-md,
            0.5rem
        );

    font-size:
        var(
            --font-size-sm,
            0.875rem
        );

    font-weight: 600;
    line-height: 1.2;

    text-decoration: none;
    white-space: nowrap;
}

.site-header__login {
    color:
        var(
            --color-primary,
            #2563eb
        );

    background: transparent;

    border:
        1px solid
        var(
            --color-primary,
            #2563eb
        );
}

.site-header__login:hover {
    color:
        var(
            --color-primary-hover,
            #1d4ed8
        );

    background:
        var(
            --color-primary-soft,
            #eff6ff
        );
}

.site-header__register {
    color:
        var(
            --color-button-text,
            #ffffff
        );

    background:
        var(
            --color-primary,
            #2563eb
        );

    border:
        1px solid
        var(
            --color-primary,
            #2563eb
        );
}

.site-header__register:hover {
    background:
        var(
            --color-primary-hover,
            #1d4ed8
        );

    border-color:
        var(
            --color-primary-hover,
            #1d4ed8
        );
}

.site-header__login:focus-visible,
.site-header__register:focus-visible {
    outline:
        2px solid
        var(
            --color-focus,
            var(--color-primary, #2563eb)
        );

    outline-offset: 2px;
}


/* ==========================================================================
   10. LIST YOUR BUSINESS CTA
   ========================================================================== */

.site-header__business-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 2.5rem;

    padding:
        0.5rem
        0.875rem;

    color:
        var(
            --header-business-cta-text,
            var(--color-primary, #2563eb)
        );

    background:
        var(
            --header-business-cta-background,
            transparent
        );

    border:
        1px solid
        var(
            --header-business-cta-border,
            var(--color-primary, #2563eb)
        );

    border-radius:
        var(
            --radius-md,
            0.5rem
        );

    font-size:
        var(
            --font-size-sm,
            0.875rem
        );

    font-weight: 700;
    line-height: 1.2;

    text-decoration: none;
    white-space: nowrap;
}

.site-header__business-cta:hover {
    color:
        var(
            --header-business-cta-hover-text,
            #ffffff
        );

    background:
        var(
            --header-business-cta-hover-background,
            var(--color-primary, #2563eb)
        );
}


/* ==========================================================================
   11. HEADER DROPDOWN / MENU HOST
   ========================================================================== */

.site-header__menu {
    position: relative;
}

.site-header__dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);

    inset-inline-end: 0;

    z-index:
        var(
            --z-dropdown,
            1100
        );

    width:
        var(
            --header-dropdown-width,
            18rem
        );

    max-width:
        min(
            var(--header-dropdown-max-width, 22rem),
            calc(100vw - 2rem)
        );

    padding:
        var(
            --header-dropdown-padding,
            0.5rem
        );

    background:
        var(
            --color-surface,
            #ffffff
        );

    border:
        1px solid
        var(
            --color-border,
            #e5e7eb
        );

    border-radius:
        var(
            --radius-lg,
            0.75rem
        );

    box-shadow:
        var(
            --shadow-lg,
            0 10px 30px rgb(0 0 0 / 0.12)
        );
}

.site-header__dropdown[hidden] {
    display: none;
}


/* ==========================================================================
   12. HEADER SECONDARY ROW
   ========================================================================== */

.site-header__secondary {
    display: flex;
    align-items: center;

    width: 100%;
    min-width: 0;

    border-top:
        1px solid
        var(
            --header-secondary-border,
            var(--color-border, #e5e7eb)
        );
}

.site-header__secondary-inner {
    display: flex;
    align-items: center;

    width: 100%;
    min-width: 0;
}


/* ==========================================================================
   13. HEADER SCROLL / STICKY STATE
   ========================================================================== */

.site-header--sticky {
    position: sticky;
    top: 0;
}

.site-header[data-state="scrolled"] {
    box-shadow:
        var(
            --header-scrolled-shadow,
            0 4px 16px rgb(0 0 0 / 0.08)
        );
}


/* ==========================================================================
   14. HEADER LOADING STATE
   ========================================================================== */

.site-header [data-loading="true"] {
    cursor: wait;
}

.site-header [data-loading="true"] .site-header__action,
.site-header [data-loading="true"] .site-header__location-trigger {
    pointer-events: none;
    opacity: 0.7;
}


/* ==========================================================================
   15. HEADER HIDDEN / CONDITIONAL ELEMENTS
   ========================================================================== */

.site-header [hidden] {
    display: none !important;
}


/* ==========================================================================
   16. TABLET
   ========================================================================== */

@media (max-width: 64rem) {

    .site-header__main {
        gap: 0.75rem;
    }

    .site-header__location {
        display: none;
    }

    .site-header__business-cta {
        display: none;
    }

    .site-header__account-info {
        display: none;
    }

    .site-header__account-trigger {
        padding: 0.375rem;
    }

    .site-header__search {
        max-width: none;
    }
}


/* ==========================================================================
   17. MOBILE
   ========================================================================== */

@media (max-width: 48rem) {

    .site-header__main {
        flex-wrap: wrap;

        min-height:
            var(
                --header-mobile-min-height,
                4rem
            );

        padding-block:
            0.5rem;
    }

    .site-header__brand {
        order: 1;
    }

    .site-header__actions {
        order: 2;
        margin-inline-start: auto;
    }

    .site-header__search {
        order: 3;

        flex-basis: 100%;
        max-width: 100%;
    }

    .site-header__brand-logo {
        max-height: 2.375rem;
    }

    .site-header__brand-text {
        max-width: 10rem;

        overflow: hidden;

        font-size:
            var(
                --header-mobile-brand-font-size,
                1.05rem
            );

        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .site-header__auth-actions {
        gap: 0.25rem;
    }

    .site-header__login,
    .site-header__register {
        min-height: 2.25rem;
        padding-inline: 0.625rem;
    }

    .site-header__secondary {
        display: none;
    }

    .site-header__dropdown {
        position: fixed;

        top:
            var(
                --header-mobile-dropdown-top,
                4rem
            );

        inset-inline:
            0.75rem;

        width: auto;
        max-width: none;
    }
}


/* ==========================================================================
   18. SMALL MOBILE
   ========================================================================== */

@media (max-width: 30rem) {

    .site-header__main {
        gap: 0.5rem;
    }

    .site-header__brand-text {
        max-width: 8rem;
    }

    .site-header__action-text {
        display: none;
    }

    .site-header__login {
        display: none;
    }

    .site-header__register {
        padding-inline: 0.625rem;
    }

    .site-header__action {
        min-width: 2.25rem;
        min-height: 2.25rem;
        padding: 0.375rem;
    }

    .site-header__account-avatar {
        width: 2rem;
        height: 2rem;
    }
}


/* ==========================================================================
   19. RTL
   ========================================================================== */

[dir="rtl"] .site-header__main,
[dir="rtl"] .site-header__actions,
[dir="rtl"] .site-header__secondary-inner {
    direction: rtl;
}

[dir="rtl"] .site-header__account-info,
[dir="rtl"] .site-header__location-content {
    align-items: flex-end;
}


/* ==========================================================================
   20. REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

    .site-header *,
    .site-header *::before,
    .site-header *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}


/* ==========================================================================
   21. FORCED COLORS / HIGH CONTRAST
   ========================================================================== */

@media (forced-colors: active) {

    .site-header {
        background: Canvas;
        color: CanvasText;
        border-color: CanvasText;
        box-shadow: none;
    }

    .site-header__brand,
    .site-header__action,
    .site-header__location-trigger,
    .site-header__account-trigger {
        color: CanvasText;
    }

    .site-header__login,
    .site-header__register,
    .site-header__business-cta {
        border-color: ButtonText;
    }

    .site-header__register {
        background: ButtonFace;
        color: ButtonText;
    }

    .site-header__dropdown {
        background: Canvas;
        color: CanvasText;
        border-color: CanvasText;
        box-shadow: none;
    }
}


/* ==========================================================================
   22. PRINT
   ========================================================================== */

@media print {

    .site-header {
        position: static;

        background: #ffffff;
        color: #000000;

        border-bottom: 1px solid #000000;
        box-shadow: none;
    }

    .site-header__actions,
    .site-header__search,
    .site-header__location,
    .site-header__secondary,
    .site-header__dropdown {
        display: none !important;
    }

    .site-header__brand {
        color: #000000;
    }
}