/* هدر بندراستایل — مزون و لباس بندری */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1040;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 8px rgba(12, 34, 56, 0.06);
}

.site-header-unified {
    position: relative;
    border-bottom: 1px solid var(--bs-border-light, #f0ebe3);
    overflow: visible;
}

.site-header-unified--desktop { display: block; }
.site-header-mobile { display: none; }

.site-header-container {
    width: 100%;
    max-width: 1676px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.site-header-top {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0.7rem 0 0.6rem;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
    color: inherit;
}

.site-logo-img {
    display: block;
    height: 46px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.site-logo--sm .site-logo-img {
    height: 36px;
    max-width: min(180px, 58vw);
}

.header-search-form {
    flex: 1;
    min-width: 0;
    max-width: 520px;
    position: relative;
}

.header-search-field {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    height: 44px;
    padding: 0 1rem;
    background: var(--bs-cream-dark, #f0e9df);
    border: 1px solid transparent;
    border-radius: 10px;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.header-search-field:focus-within {
    background: #fff;
    border-color: var(--bs-teal, #1a6b6b);
    box-shadow: 0 0 0 3px rgba(26, 107, 107, 0.1);
}

.header-search-field i {
    color: var(--bs-ink-muted, #5c6b7f);
    font-size: 1.05rem;
    flex-shrink: 0;
}

.header-search-field input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.9rem;
    color: var(--bs-ink, #1a2433);
    font-family: inherit;
}

.header-search-field input::placeholder { color: var(--bs-ink-muted, #5c6b7f); opacity: 0.65; }

.header-search-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.08);
    color: #666;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.header-search-clear:hover { background: rgba(0, 0, 0, 0.14); }

.site-header-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-right: auto;
}

.header-support-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1.1rem;
    border: 1px solid var(--bs-border, #e5ddd2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--bs-navy, #0c2238);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}

.header-support-btn i {
    font-size: 1rem;
    color: var(--bs-teal, #1a6b6b);
}

.header-support-btn:hover {
    background: var(--bs-gold-pale, #f7edd4);
    border-color: var(--bs-gold, #c9a227);
    color: var(--bs-teal, #1a6b6b);
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(12, 34, 56, 0.06);
}

.header-actions-divider {
    width: 1px;
    height: 28px;
    background: #e0e0e2;
    margin: 0 1rem;
    flex-shrink: 0;
}

.header-auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--bs-border, #e5ddd2);
    border-radius: 10px;
    color: var(--bs-navy, #0c2238);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    background: #fff;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.header-auth-btn:hover {
    color: var(--bs-teal, #1a6b6b);
    background: var(--bs-gold-pale, #f7edd4);
    border-color: var(--bs-gold, #c9a227);
}

.header-auth-btn i { font-size: 1.1rem; }
.header-auth-sep { color: #c0c2c5; font-weight: 400; }

.header-cart-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    color: #424750;
    text-decoration: none;
    padding: 0.15rem 0;
    border: none;
    background: transparent;
    cursor: pointer;
    font: inherit;
}

.header-cart-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: #f0f0f1;
    border-radius: 8px;
    flex-shrink: 0;
}

.header-cart-btn i {
    font-size: 1.3rem;
    color: #3f4064;
}

.header-cart-btn:hover .header-cart-icon-wrap { background: #e8e8ed; }
.header-cart-btn:hover i,
.header-cart-btn:hover .header-cart-total { color: var(--teal); }

.header-cart-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    background: var(--coral);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 2px solid #fff;
    z-index: 1;
}

.header-cart-badge.is-empty { display: none; }

.header-cart-divider {
    width: 1px;
    height: 28px;
    background: #e0e0e2;
    flex-shrink: 0;
}

.header-cart-total {
    font-size: 0.9rem;
    font-weight: 700;
    color: #2d2a32;
    white-space: nowrap;
}

.header-cart-total small {
    font-size: 0.78rem;
    font-weight: 600;
}

/* دسته‌بندی افقی */
.horiz-cat-nav {
    position: relative;
    width: 100%;
    background: transparent;
    overflow: visible;
}

.horiz-cat-nav--bar {
    border-top: 1px solid #f0f0f1;
    padding: 0.45rem 0 0.15rem;
}

.horiz-cat-nav-scroll {
    overflow-x: auto;
    scrollbar-width: none;
    display: flex;
    justify-content: center;
}

.horiz-cat-nav-scroll::-webkit-scrollbar { display: none; }

.horiz-cat-list {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0 auto;
    padding: 0;
    width: max-content;
    min-width: 100%;
}

.horiz-cat-item {
    position: relative;
    flex: 0 0 auto;
}

.horiz-cat-item.is-active > .horiz-cat-link {
    background: var(--gold-pale);
    color: var(--teal);
}

.horiz-cat-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem 0.65rem;
    text-decoration: none;
    color: #3f4064;
    font-size: 0.94rem;
    font-weight: 700;
    white-space: nowrap;
    border-radius: 10px;
    transition: background 0.2s, color 0.2s;
}

.horiz-cat-link:hover,
.horiz-cat-item:hover > .horiz-cat-link {
    background: var(--gold-pale);
    color: var(--teal);
}

.horiz-cat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 0.95rem;
    flex-shrink: 0;
    position: relative;
    right: -4px;
}

.horiz-cat-icon-0 { background: #e0f2f1; color: var(--teal); }
.horiz-cat-icon-1 { background: #f5e6c0; color: #b8860b; }
.horiz-cat-icon-2 { background: #e3f2fd; color: #1565c0; }
.horiz-cat-icon-3 { background: #fce4ec; color: #c2185b; }
.horiz-cat-icon-sale { background: #ffebee; color: #e53935; }

.horiz-cat-chevron {
    font-size: 0.72rem;
    color: #bbb;
    flex-shrink: 0;
}

.horiz-cat-link-sale {
    font-size: 1.02rem;
    font-weight: 800;
    color: #c62828;
    gap: 0.12rem;
    padding: 0.5rem 0.95rem;
}

.horiz-cat-link-sale .horiz-cat-icon {
    width: 34px;
    height: 34px;
    font-size: 1.05rem;
    right: 2px;
}

.horiz-cat-link-sale:hover,
.horiz-cat-item:hover > .horiz-cat-link-sale {
    color: #e53935;
    background: #fff5f5;
}

/* مگامنو */
.horiz-mega-panels {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
}

.horiz-mega-panel {
    display: none;
    position: relative;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    max-height: 70vh;
    overflow-y: auto;
}

.horiz-mega-panel.is-open { display: block; }

.horiz-mega-inner { padding: 1.5rem 0 0.75rem; }

.horiz-mega-layout {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1.25rem 2rem;
}

.horiz-mega-branches {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.85rem;
}

.horiz-mega-branch {
    flex: 0 0 auto;
    width: auto;
    min-width: 176px;
    max-width: 210px;
}

.horiz-mega-leaf-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.85rem;
    width: min(100%, 28rem);
}

.horiz-mega-leaf-grid .horiz-mega-branch--leaf {
    flex: 0 0 calc(50% - 0.45rem);
    width: calc(50% - 0.45rem);
    max-width: calc(50% - 0.45rem);
}

.horiz-mega-col {
    height: 100%;
    padding: 0.9rem 1rem 1rem;
    background: #fafafa;
    border: 1px solid #e8e8ed;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: border-color 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.horiz-mega-branch:hover .horiz-mega-col {
    border-color: var(--gold-light);
    box-shadow: 0 4px 16px rgba(26, 107, 107, 0.08);
}

.horiz-mega-branch--leaf .horiz-mega-col {
    padding: 0.6rem 0.85rem;
    align-items: center;
    justify-content: center;
}

.horiz-mega-branch--leaf .horiz-mega-heading {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    justify-content: center;
}

.horiz-mega-heading {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 700;
    font-size: 0.85rem;
    color: #2d2a32;
    text-decoration: none;
    margin-bottom: 0.65rem;
    padding-bottom: 0.45rem;
    border-bottom: 2px solid var(--gold-pale);
}

.horiz-mega-heading:hover { color: var(--teal); }

.horiz-mega-col-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 0.95rem;
    line-height: 1;
    color: #1c1917;
    background: #fff;
    border: 1px solid #e7e5e4;
    flex-shrink: 0;
}

.horiz-mega-heading:hover .horiz-mega-col-icon {
    color: #1c1917;
    border-color: #d6d3d1;
}

.horiz-mega-col-label {
    line-height: 1.3;
}

.horiz-mega-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.horiz-mega-list a {
    display: block;
    padding: 5px 0;
    font-size: 0.98rem;
    color: #555;
    text-decoration: none;
    transition: color 0.15s;
}

.horiz-mega-list a:hover { color: var(--teal); }

.horiz-mega-all {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: auto;
    padding-top: 0.65rem;
    border-top: 1px solid #ececf1;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--teal);
    text-decoration: none;
}

.horiz-mega-all:hover { color: var(--navy); }

.horiz-mega-foot {
    padding: 0.75rem 0;
    margin-top: 0.5rem;
    border-top: 1px solid #f0f0f0;
}

.horiz-mega-foot a {
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--teal);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.horiz-mega-foot a:hover { color: var(--navy); }

/* موبایل — هم‌تراز با هوم‌لینو */
@media (max-width: 991px) {
    .site-header-unified--desktop { display: none; }
    .site-header-mobile {
        display: block;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
    }

    .site-header-mobile-bar {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.55rem 1rem;
    }

    .site-header-logo--mobile {
        flex: none;
        display: flex;
        justify-content: center;
    }

    .site-header-mobile-actions {
        display: flex;
        align-items: center;
        gap: 0.35rem;
        flex-shrink: 0;
    }

    .btn-mobile-icon {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        border: none;
        border-radius: 10px;
        background: var(--light-bg);
        color: var(--dark);
        font-size: 1.1rem;
        transition: background 0.15s, color 0.15s;
        cursor: pointer;
        text-decoration: none;
    }

    .btn-mobile-icon:hover,
    .btn-mobile-icon:focus-visible {
        background: var(--primary-light);
        color: var(--primary);
    }

    .header-cart-btn--mobile .header-cart-badge {
        top: -2px;
        left: -2px;
        min-width: 16px;
        height: 16px;
        font-size: 0.6rem;
    }

    .site-header-mobile-search { padding: 0 1rem 0.65rem; }

    .mobile-search-field {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        background: var(--light-bg);
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 0.5rem 0.75rem;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

    .mobile-search-field:focus-within {
        border-color: var(--primary-muted);
        box-shadow: 0 0 0 3px rgba(26, 107, 107, 0.1);
    }

    .mobile-search-field > .bi-search {
        color: var(--gray);
        font-size: 0.9rem;
        flex-shrink: 0;
    }

    .mobile-search-field input {
        flex: 1;
        min-width: 0;
        border: none;
        background: transparent;
        outline: none;
        font-size: 0.88rem;
        font-family: inherit;
    }

    .mobile-search-submit {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border: none;
        border-radius: 8px;
        background: var(--primary);
        color: #fff;
        font-size: 0.85rem;
        flex-shrink: 0;
        cursor: pointer;
        transition: background 0.15s;
    }

    .mobile-search-submit:hover { background: var(--primary-dark); }

    .horiz-cat-nav--mobile {
        border-top: 1px solid #f0f0f1;
        background: #fff;
    }

    .horiz-cat-nav--mobile .horiz-cat-link {
        padding: 0.55rem 0.75rem;
        font-size: 0.8rem;
    }

    .mobile-nav-panel {
        display: flex;
        flex-direction: column;
        gap: 2px;
        padding: 0.5rem 1rem 1rem;
        border-top: 1px solid #f0f0f1;
        background: #fff;
    }

    .mobile-nav-panel[hidden] { display: none; }

    .mobile-nav-panel a {
        padding: 0.65rem 0.85rem;
        border-radius: 10px;
        color: var(--text);
        font-size: 0.9rem;
        font-weight: 500;
        text-decoration: none;
    }

    .mobile-nav-panel a:hover {
        background: var(--gold-pale);
        color: var(--navy);
    }

    .mobile-nav-group { border-bottom: 1px solid #f0f0f1; }

    .mobile-nav-group summary {
        padding: 0.75rem 0.85rem;
        font-weight: 600;
        color: var(--navy);
        cursor: pointer;
        list-style: none;
    }

    .mobile-nav-group summary::-webkit-details-marker { display: none; }

    .mobile-nav-group-body {
        display: flex;
        flex-direction: column;
        gap: 2px;
        padding: 0 0.5rem 0.5rem;
    }

    .mobile-nav-subtitle {
        padding: 0.45rem 0.85rem 0.15rem;
        font-size: 0.78rem;
        font-weight: 700;
        color: var(--text-muted);
    }

    .mobile-nav-all {
        font-weight: 600 !important;
        color: var(--teal) !important;
    }
}

@media (min-width: 1200px) {
    .site-header-container { padding: 0 2rem; }
}
