/* =========================================================
   DZ PREMIUM CLEAN COMMERCE - STEP 2 / V4.1
   Header + Navigation + Mobile Bottom Bar
   Visual layer only. Existing storefront behavior preserved.
   ========================================================= */

:root {
    --dz-header-bg: #ffffff;
    --dz-header-soft: #f8fafc;
    --dz-header-text: #111827;
    --dz-header-muted: #64748b;
    --dz-header-border: #e5e7eb;
    --dz-header-border-strong: #d7dee8;
    --dz-header-radius: 11px;
    --dz-header-shadow: 0 8px 24px rgba(15, 23, 42, .06);
    --dz-header-shadow-strong: 0 14px 36px rgba(15, 23, 42, .10);
    --dz-header-transition: 180ms ease;
}

/* ---------- Announcement ---------- */
.offer-bar {
    font-size: 12.5px;
    letter-spacing: 0;
}

.offer-bar .top-offer-text {
    min-height: 20px;
    align-items: center;
}

.offer-bar .offer-bar-close {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--dz-header-transition);
}

.offer-bar .offer-bar-close:hover {
    background: rgba(255,255,255,.16);
}

/* ---------- Desktop top strip ---------- */
.header {
    color: var(--dz-header-text);
}

.header-top {
    min-height: 38px;
    background: var(--dz-header-soft);
    border-bottom: 1px solid var(--dz-header-border);
    font-size: 12.5px;
}

.header-top a,
.header-top button {
    font-size: 12.5px;
    font-weight: 550;
}

.header-top a {
    color: var(--dz-header-muted);
}

.header-top a:hover {
    color: var(--bs-primary);
}

.header-top .nav {
    gap: 1.25rem !important;
}

.header-top .language-dropdown > button {
    color: var(--dz-header-muted) !important;
    transition: color var(--dz-header-transition);
}

.header-top .language-dropdown > button:hover,
.header-top .language-dropdown > button[aria-expanded="true"] {
    color: var(--bs-primary) !important;
}

/* ---------- Main logo + search row ---------- */
.header-middle {
    background: var(--dz-header-bg);
    border-bottom-color: var(--dz-header-border) !important;
    padding-top: .65rem !important;
    padding-bottom: .65rem !important;
}

.header-middle > .container > .d-flex {
    min-height: 72px;
}

.header-middle .logo {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
}

.header-middle .logo img {
    width: 190px !important;
    height: 72px !important;
    max-width: 190px !important;
    max-height: 72px !important;
    object-fit: contain !important;
}

.header-middle .search-box {
    flex: 1 1 640px;
    max-width: 720px;
    margin-inline: auto;
}

.header-middle .search-box form,
.header-middle .search-box form > .d-flex {
    width: 100%;
}

.header-middle .search-box .select-wrap {
    flex: 1 1 auto;
    min-height: 46px;
    background: #fff;
    border: 1px solid var(--dz-header-border-strong) !important;
    transition:
        border-color var(--dz-header-transition),
        box-shadow var(--dz-header-transition);
}

[dir="ltr"] .header-middle .search-box .select-wrap {
    border-radius: var(--dz-header-radius) 0 0 var(--dz-header-radius) !important;
}

[dir="rtl"] .header-middle .search-box .select-wrap {
    border-radius: 0 var(--dz-header-radius) var(--dz-header-radius) 0 !important;
}

.header-middle .search-box .select-wrap:focus-within {
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), .08);
}

.header-middle .search_dropdown {
    min-width: 150px;
}

.header-middle .header-search-dropdown-button {
    height: 44px;
    max-width: 185px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12.5px;
    font-weight: 650;
}

.header-middle #global-search {
    min-height: 44px !important;
    height: 44px;
    padding-inline: .9rem;
    font-size: 13.5px;
    box-shadow: none !important;
}

.header-middle #global-search::placeholder {
    color: #94a3b8;
}

.header-middle .search-box button[type="submit"] {
    width: 50px;
    min-width: 50px;
    height: 46px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 var(--dz-header-radius) var(--dz-header-radius) 0 !important;
    box-shadow: 0 5px 14px rgba(var(--bs-primary-rgb), .18);
}

[dir="rtl"] .header-middle .search-box button[type="submit"] {
    border-radius: var(--dz-header-radius) 0 0 var(--dz-header-radius) !important;
}

.header-middle .search-box button[type="submit"]:hover {
    transform: none;
    box-shadow: 0 7px 18px rgba(var(--bs-primary-rgb), .24);
}

.header-middle .search-card {
    margin-top: 8px;
    border: 1px solid var(--dz-header-border) !important;
    border-radius: 12px !important;
    box-shadow: var(--dz-header-shadow-strong) !important;
    overflow: hidden;
}

.header-middle .offer-btn {
    flex: 0 0 auto;
}

.header-middle .offer-btn img {
    max-width: 170px !important;
    max-height: 56px !important;
    border-radius: 9px;
}

/* ---------- Main nav bar ---------- */
.header-main {
    background: rgba(255, 255, 255, .96) !important;
    border-bottom: 1px solid var(--dz-header-border);
    box-shadow: 0 4px 18px rgba(15, 23, 42, .045) !important;
}

@supports (backdrop-filter: blur(12px)) {
    .header-main {
        backdrop-filter: saturate(140%) blur(12px);
    }
}

@media (min-width: 1200px) {
    .header-main > .container > .d-flex {
        min-height: 54px;
    }
}

.header-main .select-category-button {
    min-height: 42px;
    border-radius: 10px !important;
    padding-inline: .9rem !important;
    font-size: 12.5px !important;
    letter-spacing: .01em;
    box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb), .14);
}

.header-main .select-category-button .bi-list {
    font-size: 20px !important;
}

.header-main .main-menu {
    gap: 2px;
}

.header-main .main-menu > li {
    position: relative;
}

.header-main .main-menu > li > a,
.header-main .main-menu > li > span {
    min-height: 38px;
    padding: 9px 11px !important;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    font-weight: 650;
    color: var(--dz-header-text);
    transition:
        color var(--dz-header-transition),
        background-color var(--dz-header-transition);
}

.header-main .main-menu > li:hover > a,
.header-main .main-menu > li:hover > span,
.header-main .main-menu > li.active > a {
    color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), .07);
}

.header-main .main-menu .sub-menu,
.header-main .dropdown--menu {
    margin-top: 6px !important;
    padding: 7px !important;
    border: 1px solid var(--dz-header-border) !important;
    border-radius: 12px !important;
    background: var(--dz-header-bg) !important;
    box-shadow: var(--dz-header-shadow-strong) !important;
}

.header-main .main-menu .sub-menu a,
.header-main .dropdown--menu a {
    border-radius: 8px;
    font-size: 12.5px;
    transition:
        color var(--dz-header-transition),
        background-color var(--dz-header-transition);
}

.header-main .main-menu .sub-menu a:hover,
.header-main .dropdown--menu a:hover {
    color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), .07);
}

/* ---------- Desktop utility icons ---------- */
@media (min-width: 1200px) {
    .header-main .list-separator {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .header-main .list-separator > li {
        border: 0 !important;
        padding: 0 !important;
    }

    .header-main .list-separator > li.d-xl-block > a,
    .header-main .profile-dropdown > button {
        width: 40px;
        height: 40px;
        min-width: 40px;
        border-radius: 10px !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        color: var(--dz-header-text);
        background: var(--dz-header-soft) !important;
        border: 1px solid var(--dz-header-border) !important;
        transition:
            color var(--dz-header-transition),
            border-color var(--dz-header-transition),
            background-color var(--dz-header-transition),
            box-shadow var(--dz-header-transition);
    }

    .header-main .list-separator > li.d-xl-block > a:hover,
    .header-main .profile-dropdown > button:hover {
        color: var(--bs-primary);
        border-color: rgba(var(--bs-primary-rgb), .28) !important;
        background: rgba(var(--bs-primary-rgb), .06) !important;
        box-shadow: 0 5px 14px rgba(15, 23, 42, .06);
    }

    .header-main .profile-dropdown .header-avatar {
        width: 28px !important;
        height: 28px !important;
        border-width: 1px !important;
    }

    .header-main .login-register > button.media {
        min-height: 40px;
        border: 1px solid var(--dz-header-border) !important;
        border-radius: 10px !important;
        padding: 0 12px !important;
        background: var(--dz-header-soft) !important;
        font-size: 12px !important;
        font-weight: 650;
    }

    #cart_items {
        min-width: 40px;
    }
}

.header-main .count {
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    font-size: 9px !important;
    font-weight: 750;
    line-height: 17px;
    background: #dc2626 !important;
    color: #fff !important;
    box-shadow: 0 0 0 2px #fff;
}

/* ---------- Mobile header ---------- */
@media (max-width: 1199.98px) {
    .header-top,
    .header-middle {
        display: none !important;
    }

    .header-main {
        padding-top: 6px !important;
        padding-bottom: 6px !important;
    }

    .header-main > .container > .d-flex {
        min-height: 56px;
    }

    .header-main .mobile-logo-cs {
        width: 118px !important;
        height: 52px !important;
        max-width: 118px !important;
        max-height: 52px !important;
        object-fit: contain !important;
    }

    .header-main .login-register {
        gap: 7px !important;
    }

    .header-main .menu-btn,
    .header-main .login-register > button,
    .header-main .profile-dropdown > button {
        width: 38px;
        height: 38px;
        min-width: 38px;
        border-radius: 10px !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        color: var(--dz-header-text);
        background: var(--dz-header-soft) !important;
        border: 1px solid var(--dz-header-border) !important;
        padding: 0 !important;
    }

    .header-main .menu-btn i {
        font-size: 19px !important;
    }

    .header-main .header-avatar {
        width: 26px !important;
        height: 26px !important;
    }

    /* Mobile drawer */
    .header-main .aside {
        width: min(88vw, 360px);
        max-width: 360px;
        background: #fff;
        border-inline-end: 1px solid var(--dz-header-border);
        box-shadow: var(--dz-header-shadow-strong);
    }

    .header-main .aside-close {
        min-height: 54px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        border-bottom: 1px solid var(--dz-header-border);
    }

    .header-main .aside-close i {
        width: 34px;
        height: 34px;
        border-radius: 9px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: var(--dz-header-soft);
    }

    .header-main .aside-body {
        padding: 14px !important;
    }

    .header-main .aside .search-bar {
        min-height: 42px;
        border: 1px solid var(--dz-header-border-strong);
        border-radius: 10px;
        overflow: hidden;
        background: #fff;
    }

    .header-main .aside .search-bar .form-control {
        border: 0 !important;
        box-shadow: none !important;
        min-height: 40px !important;
        font-size: 13px;
    }

    .header-main .aside .search-bar button {
        width: 42px;
        border: 0;
        background: var(--bs-primary);
        color: #fff;
    }

    .header-main .aside .main-nav > li {
        border-bottom: 1px solid var(--dz-header-border);
    }

    .header-main .aside .main-nav > li > a {
        min-height: 44px;
        padding: 10px 4px !important;
        font-size: 13px;
        font-weight: 650;
    }

    .header-main .aside .sub_menu {
        border-inline-start: 2px solid rgba(var(--bs-primary-rgb), .14);
        margin-inline-start: 7px;
        padding-inline-start: 10px;
    }
}

/* ---------- Mobile bottom app bar ---------- */
@media (max-width: 1199.98px) {
    #mobile_app_bar {
        background: rgba(255,255,255,.97) !important;
        border-top: 1px solid var(--dz-header-border) !important;
        box-shadow: 0 -8px 26px rgba(15, 23, 42, .10) !important;
        padding-top: 5px !important;
        padding-bottom: max(5px, env(safe-area-inset-bottom)) !important;
        z-index: 1040 !important;
    }

    @supports (backdrop-filter: blur(14px)) {
        #mobile_app_bar {
            backdrop-filter: saturate(145%) blur(14px);
        }
    }

    #mobile_app_bar a,
    #mobile_app_bar button {
        color: var(--dz-header-muted);
        transition:
            color var(--dz-header-transition),
            background-color var(--dz-header-transition),
            transform var(--dz-header-transition);
    }

    #mobile_app_bar a:hover,
    #mobile_app_bar a:focus,
    #mobile_app_bar button:hover,
    #mobile_app_bar button:focus,
    #mobile_app_bar .active,
    #mobile_app_bar [aria-current="page"] {
        color: var(--bs-primary) !important;
    }

    #mobile_app_bar i,
    #mobile_app_bar svg {
        font-size: 20px;
    }

    #mobile_app_bar .count,
    #mobile_app_bar [class*="count"] {
        border-radius: 999px;
        font-size: 9px !important;
        font-weight: 750;
    }

    #mobile_app_bar .dropdown-menu,
    #mobile_app_bar .cart-dropdown-mobile-view {
        border: 1px solid var(--dz-header-border) !important;
        border-radius: 14px !important;
        box-shadow: 0 -10px 34px rgba(15, 23, 42, .13) !important;
    }
}

/* ---------- Dark mode ---------- */
[theme="dark"] {
    --dz-header-bg: #141414;
    --dz-header-soft: #191c21;
    --dz-header-text: #f3f4f6;
    --dz-header-muted: #a6adbb;
    --dz-header-border: #2a2f37;
    --dz-header-border-strong: #343a44;
}

[theme="dark"] .header-top,
[theme="dark"] .header-middle,
[theme="dark"] .header-main,
[theme="dark"] .header-main .aside,
[theme="dark"] #mobile_app_bar {
    background-color: var(--dz-header-bg) !important;
    color: var(--dz-header-text);
}

[theme="dark"] .header-middle .search-box .select-wrap,
[theme="dark"] .header-main .aside .search-bar {
    background: var(--dz-header-soft) !important;
}

[theme="dark"] .header-middle #global-search,
[theme="dark"] .header-main .aside .search-bar .form-control {
    background: transparent !important;
    color: var(--dz-header-text) !important;
}

[theme="dark"] .header-main .count {
    box-shadow: 0 0 0 2px var(--dz-header-bg);
}
