.ds-header-space {
    position: sticky; top: -14px; z-index: 1000; min-height: 108px; display: block !important;
    padding: 14px 0 18px;
}
.ds-header, .ds-header * { box-sizing: border-box; }
.ds-header {
    --ds-brand: #0aa391; --ds-brand-dark: #087f72; --ds-soft: #effaf8;
    --ds-ink: #151f16; --ds-muted: #686666; --ds-line: #e2e9e6;
    position: relative; isolation: isolate; z-index: 1000; width: min(1320px, calc(100% - 40px));
    margin: 0 auto; padding: 0; color: var(--ds-ink); background: #fff;
    border: 1px solid var(--ds-line); border-radius: 16px;
    box-shadow: 0 8px 24px rgba(21,31,22,.07); font-family: Vazirmatn, Tahoma, sans-serif;
}
.ds-header::before {
    content: ""; position: absolute; z-index: -1; top: -1px; bottom: -1px; left: 50%;
    width: 100vw; background: #fff; border-top: 1px solid var(--ds-line);
    border-bottom: 1px solid var(--ds-line); box-shadow: 0 5px 20px rgba(21,31,22,.08);
    clip-path: inset(0 50%); transform: translateX(-50%); pointer-events: none;
    transition: clip-path .24s ease;
}
.ds-header.is-full-width::before { clip-path: inset(0); }
.ds-header a { color: inherit; text-decoration: none; }
.ds-header.is-full-width {
    border-color: transparent; border-radius: 0; box-shadow: none;
}
.ds-header button { font: inherit; cursor: pointer; }
.ds-header-bar { width: 100%; max-width: 1320px; min-height: 76px; display: grid; grid-template-columns: 190px minmax(0,1fr) auto; align-items: center; gap: 20px; margin: 0 auto; padding: 0 18px; }
.ds-logo { display: flex; align-items: center; min-width: 0; }
.ds-logo img { display: block; width: 168px; height: auto; }
.ds-nav { min-width: 0; padding-right: 24px; }
.ds-nav-list { display: flex; align-items: center; justify-content: flex-start; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ds-nav-item { position: static; padding: 0 !important; list-style: none; }
.ds-nav-button, .ds-nav-link {
    position: relative; min-height: 44px; display: inline-flex; align-items: center; gap: 5px;
    padding: 8px 12px; color: #3a4741 !important; background: transparent; border: 0;
    border-radius: 9px; font-family: Vazirmatn, Tahoma, sans-serif !important;
    font-size: 15px !important; font-weight: 700 !important; white-space: nowrap;
    transition: color .18s ease, background .18s ease;
}
.ds-nav-button::after, .ds-nav-link::after { content: ""; position: absolute; right: 12px; bottom: 1px; left: 12px; height: 2px; background: var(--ds-brand); border-radius: 2px; transform: scaleX(0); transition: transform .18s ease; }
.ds-nav-item:hover > :is(.ds-nav-button,.ds-nav-link), .ds-nav-item.open > .ds-nav-button { color: var(--ds-brand-dark) !important; background: var(--ds-soft); }
.ds-nav-item:hover > :is(.ds-nav-button,.ds-nav-link)::after, .ds-nav-item.open > .ds-nav-button::after { transform: scaleX(1); }
.ds-chevron { width: 16px; height: 16px; flex: 0 0 16px; transition: transform .18s ease; }
.ds-nav-item.open .ds-chevron, .menu-item-with-children.open > .menu-toggle .ds-chevron { transform: rotate(180deg); }

.ds-mega { position: absolute; top: calc(100% + 10px); right: 0; left: 0; display: none; max-height: min(72vh,650px); overflow-y: auto; padding: 24px; background: rgba(255,255,255,.99); border: 1px solid var(--ds-line); border-radius: 16px; box-shadow: 0 18px 50px rgba(21,31,22,.11); }
.ds-nav-item.open .ds-mega { display: block; animation: ds-reveal .16s ease-out; }
@keyframes ds-reveal { from { opacity: 0; transform: translateY(6px); } }
.ds-mega-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--ds-line); }
.ds-mega-head h2 { margin: 0; font-size: 17px; font-weight: 800; }
.ds-mega-head a { color: var(--ds-brand-dark); font-size: 14px; font-weight: 700; }
.ds-mega-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 28px; }
.ds-mega-group h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: var(--ds-ink); font-size: 14px; font-weight: 800; }
.ds-mega-group h3::before { content: ""; width: 7px; height: 7px; flex: 0 0 7px; background: var(--ds-brand); border-radius: 50%; }
.ds-mega-group ul, .ds-mega-list { margin: 0; padding: 0; list-style: none; }
.ds-mega-group a, .ds-mega-group span, .ds-mega-list a, .ds-mega-list span { display: block; padding: 8px 15px 8px 8px; color: var(--ds-muted); border-radius: 8px; font-size: 14px !important; font-weight: 500; line-height: 1.65; transition: color .15s ease, background .15s ease, transform .15s ease; }
.ds-mega-group a:hover, .ds-mega-list a:hover { color: var(--ds-brand-dark); background: var(--ds-soft); transform: translateX(-2px); }
.ds-mega-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px 20px; }

.ds-actions { position: relative; display: flex; align-items: center; gap: 8px; direction: ltr; }
.ds-action-wrap { position: relative; }
.ds-icon-button, .ds-mobile-toggle { position: relative; width: 42px; height: 42px; display: grid; place-items: center; padding: 0; color: #50615a !important; background: #fff; border: 1px solid var(--ds-line); border-radius: 11px; transition: color .18s ease, border-color .18s ease, background .18s ease; }
.ds-icon-button:hover, .ds-icon-button[aria-expanded="true"], .ds-mobile-toggle:hover { color: var(--ds-brand-dark) !important; border-color: rgba(10,163,145,.35); background: var(--ds-soft); }
.ds-icon-button svg, .ds-mobile-toggle svg { width: 21px; height: 21px; }
.ds-cart-count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; color: #fff; background: var(--ds-brand); border: 2px solid #fff; border-radius: 99px; font-size: 10px; line-height: 1; }
.ds-mobile-toggle { display: none; }
.ds-action-popover { position: absolute; top: calc(100% + 14px); z-index: 1100; display: none; direction: rtl; background: #fff; border: 1px solid var(--ds-line); border-radius: 14px; box-shadow: 0 18px 45px rgba(21,31,22,.13); }
.ds-action-wrap.open .ds-action-popover { display: block; animation: ds-reveal .16s ease-out; }
.ds-profile-popover { left: 0; width: 310px; overflow: hidden; }
.ds-search-popover { right: auto; left: 0; width: 340px; padding: 12px; }
.ds-search-popover form, .ds-mobile-search { position: relative; }
.ds-search-popover input, .ds-mobile-search input { width: 100%; height: 46px; padding: 0 43px 0 12px; color: var(--ds-ink); background: #f8faf9; border: 1px solid var(--ds-line); border-radius: 10px; outline: 0; font: inherit; }
.ds-search-popover input:focus, .ds-mobile-search input:focus { border-color: var(--ds-brand); box-shadow: 0 0 0 3px rgba(10,163,145,.1); }
.ds-search-popover form > button, .ds-mobile-search > button { position: absolute; top: 0; right: 0; width: 43px; height: 46px; display: grid; place-items: center; padding: 0; color: var(--ds-muted); background: transparent; border: 0; }
.ds-search-popover button svg, .ds-mobile-search button svg { width: 20px; height: 20px; }
.ds-profile-info { padding: 12px 14px; background: #fbfcfc; border-bottom: 1px solid var(--ds-line); }
.ds-profile-info-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 5px; color: var(--ds-muted); direction: ltr; background: transparent; border: 0; text-align: left; }
.ds-profile-info-row svg { width: 21px; height: 21px; flex: 0 0 21px; color: #98a29e; }
.ds-profile-info-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.ds-profile-menu { margin: 0; padding: 7px; list-style: none; }
.ds-profile-menu + .ds-profile-menu { border-top: 1px solid var(--ds-line); }
.ds-profile-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 11px; color: #303a35; border-radius: 8px; font-size: 13.5px; font-weight: 600; }
.ds-profile-menu a:hover { color: var(--ds-brand-dark); background: var(--ds-soft); }
.ds-profile-menu svg { width: 19px; height: 19px; flex: 0 0 19px; color: var(--ds-brand); }
.ds-profile-menu .ds-logout { color: #8b3f3f; }
.ds-profile-menu .ds-logout svg { color: #a85b5b; }

.ds-mobile-panel { display: none; }
@media (max-width: 1120px) and (min-width: 1025px) {
    .ds-header-bar { grid-template-columns: 150px minmax(0,1fr) auto; gap: 10px; }
    .ds-logo img { width: 140px; }
    .ds-nav-list { gap: 4px; }
    .ds-nav { padding-right: 14px; }
    .ds-nav-button, .ds-nav-link { padding-inline: 7px; font-size: 14px !important; }
    .ds-mega { padding: 20px; }
    .ds-mega-grid { gap: 18px; }
}

@media (max-width: 1024px) {
    .ds-header-space { top: -8px; min-height: 90px; padding: 8px 0 16px; }
    .ds-header { width: calc(100% - 24px); border-radius: 14px; }
    .ds-header-bar { min-height: 66px; grid-template-columns: 44px 1fr auto; gap: 10px; padding: 0 11px; }
    .ds-mobile-toggle { display: grid; }
    .ds-logo { justify-content: center; }
    .ds-logo img { width: 142px; }
    .ds-nav { display: none; }
    .ds-search-action { display: none; }
    .ds-profile-popover { width: min(310px,calc(100vw - 24px)); }
    .ds-mobile-panel { position: absolute; top: calc(100% + 8px); right: 0; left: 0; z-index: 1100; max-height: calc(100dvh - 92px); overflow-y: auto; padding: 10px; background: #fff; border: 1px solid var(--ds-line); border-radius: 14px; box-shadow: 0 18px 45px rgba(21,31,22,.12); }
    .ds-mobile-panel.show-menu { display: block; }
    .ds-mobile-search { margin-bottom: 8px; }
    .ds-mobile-panel > ul { margin: 0; padding: 0; list-style: none; }
    .ds-mobile-panel > ul > li { border-bottom: 1px solid var(--ds-line); list-style: none; }
    .ds-mobile-panel > ul > li:last-child { border-bottom: 0; }
    .ds-mobile-panel > ul > li > a, .ds-mobile-panel .menu-toggle { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 12px; color: var(--ds-ink); background: transparent; border: 0; border-radius: 9px; font-size: 14px; font-weight: 650; text-align: right; }
    .ds-mobile-panel > ul > li > a:hover, .ds-mobile-panel .menu-toggle:hover, .ds-mobile-panel .menu-item-with-children.open > .menu-toggle { color: var(--ds-brand-dark); background: var(--ds-soft); }
    .ds-mobile-panel .submenu { display: none; margin: 0; padding: 4px 8px 10px; list-style: none; background: #fff; }
    .ds-mobile-panel .menu-item-with-children.open > .submenu { display: block; }
    .ds-mobile-panel .submenu li { list-style: none; }
    .ds-mobile-panel .submenu a { display: block; padding: 9px 12px; color: var(--ds-muted); border-radius: 8px; font-size: 12.5px; font-weight: 550; line-height: 1.7; }
    .ds-mobile-panel .submenu a:hover { color: var(--ds-brand-dark); background: var(--ds-soft); }
    .ds-mobile-group-title { padding: 12px 12px 5px; color: var(--ds-ink); font-size: 12px; font-weight: 800; }
}

@media (max-width: 420px) {
    .ds-header { width: calc(100% - 16px); border-radius: 12px; }
    .ds-header-bar { min-height: 62px; grid-template-columns: 38px minmax(86px,1fr) auto; gap: 6px; padding: 0 8px; }
    .ds-logo img { width: min(118px,100%); }
    .ds-actions { gap: 6px; }
    .ds-icon-button, .ds-mobile-toggle { width: 38px; height: 38px; border-radius: 9px; }
    .ds-icon-button svg, .ds-mobile-toggle svg { width: 19px; height: 19px; }
}

@media (prefers-reduced-motion: reduce) { .ds-header *, .ds-header *::before, .ds-header *::after { animation: none !important; transition: none !important; } }
