/* ═══════════════════════════════════════════════════════════
   SG Header Stylesheet
   Enqueue in functions.php:
     wp_enqueue_style( 'sg-header',
         get_template_directory_uri() . '/sg-header.css',
         [], '1.1.0' );
   ═══════════════════════════════════════════════════════════ */

/* ─── Variables ─── */
:root {
    --sg-primary:           #C8102E;
    --sg-primary-gradient:  linear-gradient(135deg, #CF2E2E, #e84040);
    --sg-secondary:         #003554;
    --sg-bg-light:          #f3f4f6;
    --sg-text-dark:         #1f2232;        /* fixed: original had typo #1f22328 */
    --sg-text-muted:        #6b7280;
    --sg-border:            #e5e7eb;
    --sg-shadow:            0 4px 24px rgba(0,0,0,0.06);
    --sg-shadow-hover:      0 8px 32px rgba(207,46,46,0.2);
    --sg-radius:            12px;
    --sg-radius-sm:         8px;
    --sg-transition:        all 0.3s ease;
    --sg-header-z:          9990;
    --sg-topbar-z:          9991;
    --sg-drawer-z:          999999;
}

/* ─── Strict Resets ─── */
.sg-header-wrapper { direction: rtl; }

.sg-header-wrapper *,
.sg-header-wrapper *::before,
.sg-header-wrapper *::after,
.sg-mobile-drawer *,
.sg-mobile-drawer *::before,
.sg-mobile-drawer *::after {
    box-sizing: border-box !important;
    font-family: inherit !important;
}

.sg-header-wrapper a,
.sg-mobile-drawer a  { text-decoration: none !important; color: inherit; }
.sg-header-wrapper button,
.sg-mobile-drawer button { cursor: pointer; outline: none; }

.sg-header-wrapper ul,
.sg-header-wrapper ol,
.sg-header-wrapper li,
.sg-mobile-drawer ul,
.sg-mobile-drawer ol,
.sg-mobile-drawer li {
    list-style: none !important;
    list-style-type: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.sg-header-wrapper li::before, .sg-header-wrapper li::after,
.sg-mobile-drawer  li::before, .sg-mobile-drawer  li::after {
    display: none !important;
}

.sg-container {
    max-width: 1280px !important;
    margin: 0 auto !important;
    padding: 0 16px !important;
    width: 100% !important;
}

/* Non-link items (span instead of a) */
.sg-no-link {
    pointer-events: none !important;
    cursor: default !important;
}

/* ─── Main Header ─── */
.sg-header {
    background-color: #fff !important;
    z-index: var(--sg-header-z) !important;
    width: 100% !important;
    border-bottom: 1px solid var(--sg-border) !important;
    position: sticky !important;
    top: 0 !important;
}

/* ─── Top Bar ─── */
.sg-topbar {
    background: var(--sg-primary-gradient) !important;
    color: rgba(255,255,255,0.9) !important;
    font-size: 13px !important;
    padding: 9px 0 !important;
    display: block !important;
}
.sg-topbar-inner {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
}
.sg-topbar-links {
    display: flex !important;
    gap: 28px !important;
}
.sg-topbar-links a {
    transition: var(--sg-transition) !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    color: rgba(255,255,255,0.88) !important;
    font-weight: 500 !important;
}
.sg-topbar-links a svg  { width: 14px !important; height: 14px !important; flex-shrink: 0 !important; }
.sg-topbar-links a:hover { color: #fff !important; text-shadow: 0 0 8px rgba(255,255,255,0.4) !important; }

/* ─── Header Body ─── */
.sg-header-main { padding: 16px 0 !important; }
.sg-header-main .sg-container {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 24px !important;
}

/* ─── Logo & Mobile Toggle ─── */
.sg-logo-area {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    flex-shrink: 0 !important;
}
.sg-mobile-toggle {
    display: none;
    color: var(--sg-text-dark) !important;
    background: transparent !important;
    border: none !important;
    padding: 4px !important;
    margin: 0 !important;
    transition: var(--sg-transition) !important;
    align-items: center !important;
    justify-content: center !important;
}
.sg-mobile-toggle svg  { width: 26px !important; height: 26px !important; }
.sg-mobile-toggle:hover { color: var(--sg-primary) !important; }
.sg-logo { display: flex !important; align-items: center !important; }
.sg-logo img {
    height: 42px !important;
    width: auto !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ─── Search Form ─── */
.sg-search-wrapper {
    flex: 1 !important;
    max-width: 700px !important;
    position: relative !important;
}
.sg-search-form {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    height: 48px !important;
    background-color: var(--sg-bg-light) !important;
    border: 1.5px solid transparent !important;
    border-radius: var(--sg-radius) !important;
    overflow: visible !important;
    transition: var(--sg-transition) !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
}
.sg-search-form:focus-within {
    background-color: #fff !important;
    border-color: rgba(207,46,46,0.4) !important;
    box-shadow: 0 0 0 4px rgba(207,46,46,0.08) !important;
    border-radius: var(--sg-radius) var(--sg-radius) 0 0 !important;
}
.sg-search-btn {
    color: var(--sg-text-muted) !important;
    background: transparent !important;
    border: none !important;
    padding: 0 16px !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    transition: var(--sg-transition) !important;
    flex-shrink: 0 !important;
}
.sg-search-btn svg { width: 20px !important; height: 20px !important; }
.sg-search-form:focus-within .sg-search-btn { color: var(--sg-primary) !important; }
.sg-search-input {
    flex: 1 !important;
    height: 100% !important;
    min-height: 48px !important;
    font-size: 14px !important;
    color: var(--sg-text-dark) !important;
    padding: 0 12px 0 0 !important;
    margin: 0 !important;
    border: none !important;
    outline: none !important;
    background: transparent !important;
}
.sg-search-input::placeholder { color: var(--sg-text-muted) !important; }

/* ─── AJAX Search Results Dropdown ─── */
.sg-search-results {
    position: absolute !important;
    top: calc(100% - 1px) !important;
    right: 0 !important;
    left: 0 !important;
    background: #fff !important;
    border: 1.5px solid rgba(207,46,46,0.4) !important;
    border-top: none !important;
    border-radius: 0 0 var(--sg-radius) var(--sg-radius) !important;
    box-shadow: 0 16px 40px rgba(0,0,0,0.10) !important;
    z-index: 99999 !important;
    display: none !important;
    overflow: hidden !important;
    max-height: 460px !important;
    overflow-y: auto !important;
}
.sg-search-results.sg-results-active { display: block !important; }
.sg-search-results-header {
    padding: 10px 16px 8px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    color: var(--sg-text-muted) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    border-bottom: 1px solid var(--sg-border) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}
.sg-search-results-header span { font-size: 12px !important; font-weight: 600 !important; color: var(--sg-primary) !important; }
.sg-search-result-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 10px 16px !important;
    transition: var(--sg-transition) !important;
    border-bottom: 1px solid #f9f9f9 !important;
    cursor: pointer !important;
    text-decoration: none !important;
}
.sg-search-result-item:hover { background: #fef5f5 !important; }
.sg-result-thumb {
    width: 44px !important; height: 44px !important;
    border-radius: var(--sg-radius-sm) !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
    background: var(--sg-bg-light) !important;
    border: 1px solid var(--sg-border) !important;
}
.sg-result-thumb-placeholder {
    width: 44px !important; height: 44px !important;
    border-radius: var(--sg-radius-sm) !important;
    background: var(--sg-bg-light) !important;
    border: 1px solid var(--sg-border) !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #ccc !important;
}
.sg-result-info  { flex: 1 !important; min-width: 0 !important; }
.sg-result-type  {
    font-size: 10px !important; font-weight: 700 !important;
    padding: 2px 7px !important; border-radius: 4px !important;
    margin-bottom: 3px !important; display: inline-block !important;
}
.sg-result-type-post    { background: #eff6ff !important; color: #3b82f6 !important; }
.sg-result-type-product { background: #fef3c7 !important; color: #d97706 !important; }
.sg-result-type-page    { background: #f0fdf4 !important; color: #16a34a !important; }
.sg-result-title {
    font-size: 13.5px !important; font-weight: 600 !important;
    color: var(--sg-text-dark) !important;
    white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important;
    display: block !important;
}
.sg-result-price {
    font-size: 12px !important; font-weight: 700 !important;
    color: var(--sg-primary) !important; margin-top: 2px !important; display: block !important;
}
.sg-search-loading {
    display: flex !important; align-items: center !important; justify-content: center !important;
    padding: 24px !important; gap: 10px !important;
    color: var(--sg-text-muted) !important; font-size: 13px !important;
}
.sg-search-spinner {
    width: 18px !important; height: 18px !important;
    border: 2px solid var(--sg-border) !important;
    border-top-color: var(--sg-primary) !important;
    border-radius: 50% !important;
    animation: sg-spin 0.7s linear infinite !important;
    flex-shrink: 0 !important;
}
@keyframes sg-spin { to { transform: rotate(360deg); } }
.sg-search-no-result {
    padding: 24px 16px !important;
    text-align: center !important;
    color: var(--sg-text-muted) !important;
    font-size: 13.5px !important;
}
.sg-search-view-all {
    display: flex !important; align-items: center !important; justify-content: center !important;
    gap: 6px !important; padding: 12px !important;
    background: var(--sg-bg-light) !important;
    color: var(--sg-primary) !important;
    font-size: 13px !important; font-weight: 700 !important;
    transition: var(--sg-transition) !important;
    border-top: 1px solid var(--sg-border) !important;
    text-decoration: none !important;
}
.sg-search-view-all:hover { background: #fef5f5 !important; }

/* ─── Action Buttons ─── */
.sg-action-buttons {
    display: flex !important; align-items: center !important;
    gap: 12px !important; flex-shrink: 0 !important;
}
.sg-btn {
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    gap: 8px !important; height: 44px !important; padding: 0 20px !important;
    border-radius: var(--sg-radius-sm) !important;
    font-size: 14px !important; font-weight: 700 !important;
    transition: var(--sg-transition) !important; margin: 0 !important;
}
.sg-btn svg { width: 18px !important; height: 18px !important; }
.sg-btn-outline {
    color: var(--sg-primary) !important;
    background-color: #fff !important;
    border: 1.5px solid var(--sg-primary) !important;
}
.sg-btn-outline:hover { background-color: rgba(207,46,46,0.05) !important; transform: translateY(-2px); }
.sg-btn-primary {
    color: #fff !important;
    background: var(--sg-primary-gradient) !important;
    box-shadow: 0 8px 16px rgba(207,46,46,0.2) !important;
    border: none !important;
}
.sg-btn-primary:hover { transform: translateY(-2px); box-shadow: var(--sg-shadow-hover) !important; }

/* ─── Common Walker Classes ─── */
.sg-di-arrow {
    display: flex !important; align-items: center !important; justify-content: center !important;
    background: transparent !important; border: none !important;
    color: var(--sg-text-muted) !important;
    transition: var(--sg-transition) !important; cursor: pointer !important;
}
.sg-child-arrow { padding: 0 12px !important; }
.sg-child-arrow svg { width: 14px !important; height: 14px !important; }
.sg-di-arrow svg {
    width: 16px !important; height: 16px !important;
    transition: transform 0.3s ease !important; display: block !important;
}
.sg-di-arrow:hover,
.sg-di-arrow[aria-expanded="true"] { color: var(--sg-primary) !important; }
.sg-di-arrow[aria-expanded="true"] svg { transform: rotate(180deg) !important; }
.sg-di-child-row {
    display: flex !important; align-items: center !important;
    justify-content: space-between !important; width: 100% !important;
}

/* ─── Desktop Nav Bar ─── */
.sg-nav-bar {
    border-top: 1px solid var(--sg-border) !important;
    display: block;
}
.sg-nav-container-inner {
    display: flex !important; align-items: center !important;
    justify-content: space-between !important;
    height: 54px !important; position: relative !important;
}

/* ═══════════════════════════════════════════════════
   MEGA MENU — DESKTOP STYLES
   ═══════════════════════════════════════════════════ */
.sg-cat-wrapper {
    height: 100% !important; display: flex !important;
    align-items: center !important; cursor: pointer !important;
}
.sg-cat-trigger {
    display: flex !important; align-items: center !important;
    gap: 8px !important; font-weight: 800 !important;
    color: var(--sg-primary) !important; font-size: 14px !important;
    padding: 10px !important; background: #cf2e2e24;
    border-radius: 10px; border-left: 1px solid var(--sg-border) !important;
}
.sg-cat-trigger svg { color: var(--sg-primary) !important; width: 20px !important; height: 20px !important; }

.sg-mega-menu-container {
    position: absolute !important;
    top: 100% !important; right: 16px !important; left: 16px !important;
    height: 65vh !important; min-height: 450px !important;
    background: #fff !important;
    border: 1px solid var(--sg-border) !important; border-top: none !important;
    border-radius: 0 0 var(--sg-radius) var(--sg-radius) !important;
    box-shadow: 0 15px 40px rgba(0,0,0,0.08) !important;
    display: none !important; z-index: 9999 !important; overflow: hidden !important;
}
.sg-cat-wrapper:hover .sg-mega-menu-container,
.sg-mega-menu-container:hover { display: flex !important; }

.sg-mega-menu-list {
    width: 260px !important;
    background: #f9fafb !important;
    border-left: 1px solid var(--sg-border) !important;
    height: 100% !important;
    overflow-y: auto !important; overflow-x: hidden !important;
    border-radius: 0 0 var(--sg-radius) 0 !important;
    flex-shrink: 0 !important;
}
.sg-mega-menu-list > .sg-di { border-bottom: 1px solid #f0f0f0 !important; position: static !important; }
.sg-mega-menu-list > .sg-di > .sg-di-row {
    display: flex !important; align-items: center !important; justify-content: space-between !important;
    height: auto !important; padding: 14px 20px !important; transition: 0.2s !important;
}
.sg-mega-menu-list > .sg-di:hover > .sg-di-row { background: #fff !important; color: var(--sg-primary) !important; }
.sg-mega-menu-list .sg-di-link {
    font-size: 14px !important; font-weight: 600 !important;
    color: inherit !important; flex: 1 !important;
    transition: none !important; padding: 0 !important;
}

/* Desktop: arrow rotates to point right (panel opens to the side) */
@media (min-width: 992px) {
    .sg-mega-menu-list .sg-di-arrow {
        display: flex !important; padding: 0 !important;
    }
    .sg-mega-menu-list .sg-di-arrow svg {
        transform: rotate(90deg) !important;
        width: 15px !important; height: 15px !important; color: #9ca3af !important;
    }
    .sg-mega-menu-list > .sg-di:hover .sg-di-arrow svg { color: var(--sg-primary) !important; }
}

/* Panel: absolute sub-panel to the left of the sidebar */
.sg-mega-menu-list > .sg-di > .sg-scroll-wrapper {
    position: absolute !important;
    right: 260px !important; top: 0 !important; bottom: 0 !important;
    width: calc(100% - 260px) !important;
    background: #fff !important;
    padding: 24px 32px !important;
    display: none !important;
    overflow-y: auto !important; overflow-x: hidden !important;
    border-radius: 0 0 0 var(--sg-radius) !important;
}
.sg-mega-menu-list > .sg-di:hover > .sg-scroll-wrapper { display: block !important; }

/* 5-column grid inside the panel */
.sg-mega-menu-list > .sg-di > .sg-scroll-wrapper > .sg-sub-links {
    display: block !important; column-count: 5 !important; column-gap: 24px !important;
    position: static !important; width: 100% !important;
    opacity: 1 !important; visibility: visible !important; transform: none !important;
    box-shadow: none !important; border: none !important;
    padding: 0 !important; background: transparent !important;
}

/* Hide item without children: no panel */
.sg-mega-menu-list > .sg-di:not(.menu-item-has-children) > .sg-scroll-wrapper { display: none !important; }

/* ── Depth layout for desktop (min-width: 992px) ── */
@media (min-width: 992px) {
    .sg-mega-menu-list .sg-depth-1 {
        display: block !important;
        break-inside: auto !important; page-break-inside: auto !important;
        -webkit-column-break-inside: auto !important;
        margin-bottom: 20px !important; width: 100% !important;
    }
    .sg-mega-menu-list .sg-sub-depth-1,
    .sg-mega-menu-list .sg-sub-depth-2,
    .sg-mega-menu-list .sg-sub-depth-3 {
        display: block !important; position: static !important; width: 100% !important;
        opacity: 1 !important; visibility: visible !important; transform: none !important;
        box-shadow: none !important; border: none !important; padding: 0 !important; margin: 0 !important;
    }
    .sg-mega-menu-list .sg-depth-2,
    .sg-mega-menu-list .sg-depth-3 {
        display: block !important; width: 100% !important;
        margin-bottom: 2px !important;
        break-inside: avoid !important; page-break-inside: avoid !important;
    }
    .sg-mega-menu-list .sg-sub-links .sg-di-arrow           { display: none !important; }
    .sg-mega-menu-list .sg-depth-1 > .sg-di-child-row > .sg-di-arrow { display: none !important; }
}

/* DEPTH-1: section header row */
.sg-mega-menu-list .sg-depth-1 > .sg-di-child-row {
    display: block !important; width: 100% !important;
    padding: 0 0 6px 0 !important; margin-bottom: 8px !important;
    border-bottom: 2px solid var(--sg-primary) !important;
    break-after: avoid !important; page-break-after: avoid !important;
}
.sg-mega-menu-list .sg-depth-1 > .sg-di-child-row > .sg-di-child-link {
    display: inline-flex !important; align-items: center !important; gap: 5px !important;
    font-size: 13px !important; font-weight: 800 !important; color: var(--sg-primary) !important;
    padding: 0 !important; white-space: normal !important;
}
.sg-mega-menu-list .sg-depth-1 > .sg-di-child-row > .sg-di-child-link::before,
.sg-mega-menu-list .sg-depth-1 > .sg-di-child-row > .sg-di-child-link::after { display: none !important; }
.sg-mega-menu-list .sg-depth-1 > .sg-di-child-row > .sg-di-child-link:hover {
    color: #a01f1f !important; transform: none !important;
}

/* DEPTH-2 / DEPTH-3 base */
.sg-mega-menu-list .sg-di-child { text-align: right !important; }
.sg-mega-menu-list .sg-di-child-link {
    display: inline-flex !important; align-items: flex-start !important;
    width: 100% !important; padding: 3px 0 !important;
    font-size: 13px !important; font-weight: 500 !important;
    color: #374151 !important; background: transparent !important;
    transition: var(--sg-transition) !important; position: relative !important;
    line-height: 1.6 !important; text-align: right !important;
}

/* DEPTH-2 leaf: glowing red dot */
.sg-mega-menu-list .sg-depth-2:not(.menu-item-has-children) > .sg-di-child-row > .sg-di-child-link::before {
    content: "" !important; display: inline-block !important;
    width: 4px !important; height: 4px !important; min-width: 4px !important;
    border-radius: 50% !important; background: #cf2e2e !important;
    box-shadow: 0 0 4px 1px rgba(207,46,46,0.4) !important;
    margin-left: 7px !important; margin-top: 8px !important; flex-shrink: 0 !important;
}
.sg-mega-menu-list .sg-depth-2:not(.menu-item-has-children) > .sg-di-child-row > .sg-di-child-link:hover {
    color: var(--sg-primary) !important; transform: translateX(-3px) !important;
}

/* DEPTH-2 with children: sub-group header */
.sg-mega-menu-list .sg-depth-2.menu-item-has-children > .sg-di-child-row {
    margin-top: 8px !important; padding-bottom: 4px !important;
    border-bottom: 1px solid #e9eef4 !important;
}
.sg-mega-menu-list .sg-depth-2.menu-item-has-children > .sg-di-child-row > .sg-di-child-link {
    font-size: 12.5px !important; font-weight: 700 !important; color: #1f2937 !important;
    text-transform: uppercase !important; letter-spacing: 0.04em !important;
}
.sg-mega-menu-list .sg-depth-2.menu-item-has-children > .sg-di-child-row > .sg-di-child-link::before { display: none !important; }
.sg-mega-menu-list .sg-depth-2.menu-item-has-children > .sg-di-child-row > .sg-di-child-link:hover {
    color: var(--sg-primary) !important; transform: none !important;
}
.sg-mega-menu-list .sg-depth-2.menu-item-has-children > .sg-scroll-wrapper {
    padding-right: 10px !important; border-right: 2px solid #f0f2f5 !important;
    margin-right: 1px !important; margin-top: 2px !important; margin-bottom: 4px !important;
}

/* DEPTH-3 leaves */
.sg-mega-menu-list .sg-depth-3:not(.menu-item-has-children) > .sg-di-child-row > .sg-di-child-link {
    font-size: 12px !important; font-weight: 400 !important; color: #6b7280 !important; padding-right: 0 !important;
}
.sg-mega-menu-list .sg-depth-3:not(.menu-item-has-children) > .sg-di-child-row > .sg-di-child-link::before {
    content: "" !important; display: inline-block !important;
    width: 3px !important; height: 3px !important; min-width: 3px !important;
    border-radius: 50% !important; background: #9ca3af !important;
    margin-left: 6px !important; margin-top: 9px !important; flex-shrink: 0 !important;
}
.sg-mega-menu-list .sg-depth-3:not(.menu-item-has-children) > .sg-di-child-row > .sg-di-child-link:hover {
    color: var(--sg-primary) !important; transform: translateX(-3px) !important;
}

/* Mega menu scrollbars */
.sg-mega-menu-list::-webkit-scrollbar,
.sg-mega-menu-list > .sg-di > .sg-scroll-wrapper::-webkit-scrollbar        { width: 5px !important; }
.sg-mega-menu-list::-webkit-scrollbar-track,
.sg-mega-menu-list > .sg-di > .sg-scroll-wrapper::-webkit-scrollbar-track   { background: #f1f5f9 !important; border-radius: 10px !important; }
.sg-mega-menu-list::-webkit-scrollbar-thumb,
.sg-mega-menu-list > .sg-di > .sg-scroll-wrapper::-webkit-scrollbar-thumb   { background: #cbd5e1 !important; border-radius: 10px !important; }
.sg-mega-menu-list::-webkit-scrollbar-thumb:hover,
.sg-mega-menu-list > .sg-di > .sg-scroll-wrapper::-webkit-scrollbar-thumb:hover { background: var(--sg-primary) !important; }

/* ═══════════════════════════════════════════════════
   SECONDARY MENU — DESKTOP STYLES
   ═══════════════════════════════════════════════════ */
.sg-secondary-menu-wrapper {
    flex: 1 !important; margin-right: 24px !important; height: 100% !important;
}
.sg-secondary-menu-list {
    display: flex !important; align-items: center !important; gap: 24px !important; height: 100% !important;
}
.sg-secondary-menu-list > .sg-di { position: relative !important; height: auto !important; }
.sg-secondary-menu-list .sg-di-row { display: flex !important; align-items: center !important; height: 100% !important; }
.sg-secondary-menu-list .sg-di-link {
    font-size: 14px !important; font-weight: 600 !important;
    color: var(--sg-text-dark) !important; transition: var(--sg-transition) !important;
}
.sg-secondary-menu-list > .sg-di:hover .sg-di-link { color: var(--sg-primary) !important; }

/* Active underline indicator */
.sg-secondary-menu-list > .sg-di > .sg-di-row::after {
    content: ''; position: absolute !important; bottom: 0 !important; left: 0 !important;
    width: 0 !important; height: 3px !important;
    background: var(--sg-primary) !important;
    border-radius: 3px 3px 0 0 !important; opacity: 0 !important; transition: var(--sg-transition) !important;
}
.sg-secondary-menu-list > .sg-di:hover > .sg-di-row::after { width: 100% !important; opacity: 1 !important; }

/* Desktop dropdown */
.sg-secondary-menu-list > .sg-di > .sg-scroll-wrapper {
    position: absolute !important; top: 100% !important; right: 0 !important;
    background: #fff !important; min-width: 240px !important;
    border-radius: var(--sg-radius) !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08) !important;
    border: 1px solid var(--sg-border) !important;
    padding: 12px 0 !important;
    opacity: 0 !important; visibility: hidden !important; transform: translateY(10px) !important;
    transition: var(--sg-transition) !important; z-index: 9999 !important;
    display: block !important; max-height: 70vh !important; overflow-y: auto !important;
}
.sg-secondary-menu-list > .sg-di:hover > .sg-scroll-wrapper {
    opacity: 1 !important; visibility: visible !important; transform: translateY(0) !important;
}
.sg-secondary-menu-list > .sg-di > .sg-scroll-wrapper > .sg-sub-links {
    position: static !important; box-shadow: none !important; border: none !important;
    padding: 0 !important; background: transparent !important;
    transform: none !important; opacity: 1 !important; visibility: visible !important; display: block !important;
}

/* Nested fly-out (desktop only) */
@media (min-width: 992px) {
    .sg-secondary-menu-list .sg-sub-depth-1,
    .sg-secondary-menu-list .sg-sub-depth-2,
    .sg-secondary-menu-list .sg-sub-depth-3 {
        position: absolute !important; top: 0 !important; right: 100% !important;
        margin-right: 0 !important; display: none !important; transform: translateX(10px) !important;
    }
    .sg-secondary-menu-list .sg-di-child { position: relative !important; }
    .sg-secondary-menu-list .sg-di-child:hover > .sg-sub-links {
        display: block !important; opacity: 1 !important; visibility: visible !important; transform: translateX(0) !important;
    }
    .sg-secondary-menu-list .sg-di-child-row > .sg-di-arrow { display: flex !important; }
    .sg-secondary-menu-list .sg-di-child-row > .sg-di-arrow svg { transform: rotate(90deg) !important; }
}

.sg-secondary-menu-list .sg-di-child { border: none !important; }
.sg-secondary-menu-list .sg-di-child-link {
    display: block !important; padding: 10px 20px !important;
    font-size: 13.5px !important; font-weight: 500 !important;
    color: var(--sg-text-dark) !important; transition: var(--sg-transition) !important;
}
.sg-secondary-menu-list .sg-di-child-link:hover { color: var(--sg-primary) !important; padding-right: 26px !important; }

/* ─── Mobile Sticky Actions ─── */
.sg-mobile-top-actions {
    display: none;
    background: #fff !important;
    padding: 12px 16px !important;
    border-bottom: 1px solid var(--sg-border) !important;
    width: 100% !important;
    position: sticky !important; top: 0 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05) !important;
}
.sg-mobile-top-actions-inner { display: flex !important; gap: 12px !important; width: 100% !important; }
.sg-mobile-top-actions .sg-btn {
    flex: 1 !important; height: 44px !important; font-size: 13px !important;
    border-radius: var(--sg-radius-sm) !important; width: 100% !important;
}

/* ─── Mobile Drawer ─── */
.sg-mobile-overlay {
    position: fixed !important; inset: 0 !important;
    background: rgba(0,0,0,0.5) !important;
    z-index: var(--sg-drawer-z) !important;
    opacity: 0; visibility: hidden;
    transition: all 0.3s ease !important;
}
.sg-mobile-overlay.active { opacity: 1 !important; visibility: visible !important; }
.sg-mobile-drawer {
    position: fixed !important; top: 0 !important; right: 0 !important; bottom: 0 !important;
    width: 300px !important; max-width: 85vw !important;
    background: #fff !important;
    z-index: calc(var(--sg-drawer-z) + 1) !important;
    transform: translateX(100%) !important;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: flex !important; flex-direction: column !important;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1) !important;
    direction: rtl !important;
}
.sg-mobile-drawer.active { transform: translateX(0) !important; }
.sg-mobile-drawer-header {
    display: flex !important; align-items: center !important; justify-content: space-between !important;
    padding: 16px !important; border-bottom: 1px solid var(--sg-border) !important;
    flex-shrink: 0 !important; background: #f9fafb !important;
}
.sg-mobile-drawer-header img { height: 32px !important; }
.sg-mobile-drawer-close {
    background: #e5e7eb !important; border: none !important;
    width: 36px !important; height: 36px !important; border-radius: 50% !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    color: var(--sg-text-dark) !important;
}
.sg-mobile-drawer-close:hover { background: var(--sg-primary) !important; color: #fff !important; }
.sg-mobile-drawer-body { flex: 1 !important; overflow-y: auto !important; padding: 0 0 40px 0 !important; }
.sg-mobile-menu-label {
    padding: 16px 20px 8px !important; margin: 0 !important;
    font-size: 12px !important; font-weight: 800 !important;
    color: var(--sg-text-muted) !important; background: #fff !important;
}

/* Mobile Accordion — both menus stacked vertically */
.sg-mobile-drawer-body .sg-main-menu-list,
.sg-mobile-drawer-body .sg-secondary-menu-list,
.sg-mobile-drawer-body .sg-sec-menu-mobile {
    display: block !important;
    height: auto !important;
    flex-direction: unset !important;
    align-items: unset !important;
    gap: 0 !important;
}
/* Reset desktop positioning for secondary menu items inside drawer */
.sg-mobile-drawer-body .sg-secondary-menu-list > .sg-di,
.sg-mobile-drawer-body .sg-sec-menu-mobile > .sg-di {
    height: auto !important;
    position: static !important;
}
/* Reset desktop dropdown scroll-wrapper inside drawer */
.sg-mobile-drawer-body .sg-secondary-menu-list > .sg-di > .sg-scroll-wrapper,
.sg-mobile-drawer-body .sg-sec-menu-mobile > .sg-di > .sg-scroll-wrapper {
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    min-width: unset !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    transition: max-height 0.35s ease !important;
}
.sg-mobile-drawer-body .sg-secondary-menu-list > .sg-di > .sg-scroll-wrapper.sg-open,
.sg-mobile-drawer-body .sg-sec-menu-mobile > .sg-di > .sg-scroll-wrapper.sg-open {
    max-height: 3000px !important;
}
/* Hide desktop underline animation in drawer */
.sg-mobile-drawer-body .sg-secondary-menu-list > .sg-di > .sg-di-row::after,
.sg-mobile-drawer-body .sg-sec-menu-mobile > .sg-di > .sg-di-row::after {
    display: none !important;
}
.sg-mobile-drawer-body .sg-di { border-bottom: 1px solid #f0f0f0 !important; position: static !important; }
.sg-mobile-drawer-body .sg-di:last-child { border-bottom: none !important; }
.sg-mobile-drawer-body .sg-di-row { display: flex !important; align-items: stretch !important; padding: 0 !important; height: auto !important; }
.sg-mobile-drawer-body .sg-di-link {
    display: flex !important; align-items: center !important; gap: 10px !important;
    flex: 1 !important; padding: 14px 20px !important;
    color: #222 !important; font-size: 14px !important; font-weight: 600 !important;
    transition: none !important;
}
.sg-mobile-drawer-body .sg-di-link::before {
    content: "" !important; width: 6px !important; height: 6px !important; border-radius: 50% !important;
    background: var(--sg-primary) !important;
    box-shadow: 0 0 0 3px rgba(207,46,46,.15) !important; flex-shrink: 0 !important;
}
.sg-mobile-drawer-body .sg-di-arrow {
    display: flex !important; padding: 0 16px !important;
    border-right: 1px solid #f0f0f0 !important;
    min-width: 48px !important; align-items: center !important; justify-content: center !important;
}
.sg-mobile-drawer-body .sg-di.sg-active > .sg-di-row .sg-di-arrow {
    color: var(--sg-primary) !important; background: rgba(207,46,46,0.05) !important;
}

/* Accordion scroll-wrappers */
.sg-mobile-drawer-body .sg-scroll-wrapper {
    position: static !important; width: 100% !important;
    background: #fafafa !important; padding: 0 !important;
    max-height: 0 !important; overflow: hidden !important;
    transition: max-height 0.35s ease !important;
    display: block !important; box-shadow: none !important; border: none !important;
    opacity: 1 !important; visibility: visible !important; transform: none !important;
}
.sg-mobile-drawer-body .sg-scroll-wrapper.sg-open { max-height: 3000px !important; }
.sg-mobile-drawer-body .sg-scroll-wrapper > .sg-sub-links {
    position: static !important; width: 100% !important;
    display: block !important; opacity: 1 !important; visibility: visible !important; transform: none !important;
    box-shadow: none !important; border: none !important; padding: 0 !important; margin: 0 !important; background: transparent !important;
}

/* Child items in mobile */
.sg-mobile-drawer-body .sg-di-child {
    border-top: 1px solid #f0f0f0 !important; width: 100% !important; position: static !important;
}
.sg-mobile-drawer-body .sg-di-child-row {
    display: flex !important; align-items: stretch !important; width: 100% !important;
}
.sg-mobile-drawer-body .sg-di-child-link {
    display: flex !important; align-items: center !important; gap: 8px !important;
    flex: 1 !important; padding: 12px 20px 12px 16px !important;
    color: #555 !important; font-size: 13px !important; font-weight: 500 !important;
    background: transparent !important; border: none !important; box-shadow: none !important;
}
.sg-mobile-drawer-body .sg-di-child-link::before { display: none !important; }
.sg-mobile-drawer-body .sg-di-child .sg-di-arrow {
    border-right: 1px solid #e5e7eb !important; min-width: 40px !important;
}
.sg-mobile-drawer-body .sg-di-child > .sg-scroll-wrapper {
    max-height: 0 !important; overflow: hidden !important; transition: max-height 0.3s ease !important;
    background: #f1f5f9 !important;
}
.sg-mobile-drawer-body .sg-di-child > .sg-scroll-wrapper.sg-open { max-height: 2000px !important; }

/* Depth indentation */
.sg-mobile-drawer-body .sg-sub-depth-1 { background: #f4f6f8 !important; }
.sg-mobile-drawer-body .sg-sub-depth-2 { background: #eaeef2 !important; }
.sg-mobile-drawer-body .sg-sub-depth-2 .sg-di-child-link { padding-right: 28px !important; }
.sg-mobile-drawer-body .sg-sub-depth-3 { background: #e0e6ec !important; }
.sg-mobile-drawer-body .sg-sub-depth-3 .sg-di-child-link { padding-right: 40px !important; }

/* ─── Desktop: مخفی کردن المان‌های موبایل ─── */
@media (min-width: 992px) {
    .sg-mobile-toggle,
    .sg-mobile-top-actions,
    .sg-mobile-overlay,
    .sg-mobile-drawer       { display: none !important; }
}

/* ─── Responsive ─── */
@media (max-width: 991px) {
    .sg-nav-bar { display: none !important; }
    .sg-header-main .sg-action-buttons { display: none !important; }
    .sg-mobile-toggle       { display: flex !important; }
    .sg-mobile-top-actions  { display: block !important; }
    .sg-header-main         { padding: 12px 0 !important; }
    .sg-header-main .sg-container { gap: 12px !important; }
    .sg-logo-area { gap: 10px !important; }
    .sg-logo img  { height: 32px !important; }
    .sg-search-form   { height: 44px !important; border-radius: var(--sg-radius-sm) !important; }
    .sg-search-input  { font-size: 13px !important; min-height: 44px !important; }
    .sg-search-btn    { padding: 0 12px !important; }
    .sg-topbar        { padding: 7px 0 !important; }
    .sg-topbar-links  { gap: 16px !important; }
    .sg-topbar-links a { font-size: 11.5px !important; gap: 4px !important; }
    .sg-topbar-links a svg { width: 12px !important; height: 12px !important; }
}
@media (max-width: 480px) {
    .sg-logo img { height: 26px !important; }
    .sg-search-input::placeholder { font-size: 12px !important; }
    .sg-mobile-toggle svg { width: 22px !important; height: 22px !important; }
    .sg-topbar-links { gap: 10px !important; }
    .sg-topbar-links a span { display: none !important; }
}