/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== SITE HEADER ===== */
.site-header {
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    direction: rtl;
    overflow: visible;
}

/* در موبایل، هدر هنگام حرکت رو به پایین فضا را به محتوا می‌دهد. */
@media (max-width: 767.98px) {
    .site-header {
        transition: transform .26s cubic-bezier(.4,0,.2,1), box-shadow .2s ease;
        will-change: transform;
    }
    .site-header.mobile-scroll-hidden {
        transform: translateY(calc(-100% - 6px));
        box-shadow: none;
        pointer-events: none;
    }
}
@media (max-width: 767.98px) and (prefers-reduced-motion: reduce) {
    .site-header { transition: none; }
}

/* ===== TOP BAR (فقط دسکتاپ) ===== */
.top-bar {
    display: none;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.375rem 0;
    direction: rtl;
}
.top-bar__inner {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: flex-start;
    gap: 1.25rem;
}
.top-bar a {
    font-size: 0.75rem;
    color: #6b7280;
    text-decoration: none;
    white-space: nowrap;
}
.top-bar a:hover { color: #e0457b; }

/* ===== MAIN BAR ===== */
.main-bar {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1rem;
    height: 4.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

/* ===== LOGO ===== */
.site-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #e0457b;
    text-decoration: none;
    flex-shrink: 0;
}
.site-logo img { max-width: 100%; height: 3.159rem; }

/* ===== SEARCH (مخفی در موبایل) ===== */
.main-search {
    display: none;
    flex: 1;
    max-width: 36rem;
    position: relative;
    filter: drop-shadow(0 7px 16px rgba(38,55,81,.10));
}
.main-search input {
    width: 100%;
    height: 3.2rem;
    border: 2px solid #9bdfd5;
    border-radius: 1rem;
    padding: 0.65rem 1.15rem 0.65rem 4rem;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    outline: none;
    color:#263751;
    background: linear-gradient(100deg,#f5fffc 0%,#fff 72%);
    transition:border-color .2s,box-shadow .2s,background .2s;
}
.main-search input::placeholder{color:#7c918b;opacity:1}
.main-search input:focus { border-color: #e0457b!important; background: #fff!important; box-shadow:0 0 0 4px rgba(224,69,123,.12),0 10px 24px rgba(38,55,81,.12)!important; }
.main-search button {
    position: absolute;
    left: 0.42rem;
    top: 50%;
    transform: translateY(-50%);
    width:2.38rem;
    height:2.38rem;
    border-radius:.78rem;
    background:linear-gradient(145deg,#ff7192,#df3e76);
    border: none;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content:center;
    padding: 0;
    box-shadow:0 5px 12px rgba(224,69,123,.3);
    transition:transform .18s,box-shadow .18s;
}
.main-search button:hover{transform:translateY(-50%) scale(1.05);box-shadow:0 7px 16px rgba(224,69,123,.4)}
.main-search button svg{width:19px;height:19px;stroke-width:2.4}

/* ===== ACTION ICONS ===== */
.main-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}
.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
    color: #6b7280;
    text-decoration: none;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    gap: 0.25rem;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    position: relative;
}
.action-btn:hover { color: #e0457b; background: #fef2f7; }
.action-btn .label { display: none; }
.cart-badge {
    position: absolute;
    top: 0.2rem;
    right: 0.2rem;
    background: #e0457b;
    color: #fff;
    font-size: 0.625rem;
    border-radius: 50%;
    width: 1rem;
    height: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* ===== HAMBURGER ===== */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.3125rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    flex-shrink: 0;
}
.hamburger:hover { background: #fef2f7; }
.hamburger span {
    display: block;
    width: 1.375rem;
    height: 0.125rem;
    background: #374151;
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s;
}

/* ===== CAT NAV (فقط دسکتاپ) ===== */
.cat-nav {
    display: none;
    border-top: 1px solid #e5e7eb;
    position: relative;
    z-index: 500;
}
.cat-nav__inner {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}
.cat-nav__list {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 0;
    overflow-x: visible;
    scrollbar-width: none;
}
.cat-nav__list::-webkit-scrollbar { display: none; }
.cat-nav__item {
    position: relative;
    flex-shrink: 0;
}
.cat-nav__item > a {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 0.875rem;
    font-size: 0.8125rem;
    color: #374151;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s;
    cursor: pointer;
}
.cat-nav__item > a:hover { color: #e0457b; }
.cat-nav__item > a svg { transition: transform 0.2s; }

/* DROPDOWN - CSS only hover */
.cat-nav__dropdown {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.625rem;
    min-width: 14rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.14);
    z-index: 99999;
    padding: 0.375rem 0;
    transition: opacity 0.15s, visibility 0.15s;
    pointer-events: none;
}
.cat-nav__item:hover > a { color: #e0457b; }
.cat-nav__item:hover > a svg { transform: rotate(180deg); }
.cat-nav__item:hover .cat-nav__dropdown {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}
.cat-nav__dropdown a {
    display: block;
    padding: 0.5625rem 1rem;
    font-size: 0.8125rem;
    color: #374151;
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
}
.cat-nav__dropdown a:hover { background: #fef2f7; color: #e0457b; }

/* ===== MOBILE MENU OVERLAY ===== */
.mob-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9997;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.mob-overlay.active { display: block; }

/* ===== MOBILE MENU PANEL ===== */
.mob-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(18rem, 88vw);
    height: 100%;
    background: #fff;
    z-index: 9998;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: right 0.28s cubic-bezier(0.4,0,0.2,1);
    direction: rtl;
    display: flex;
    flex-direction: column;
}
.mob-panel.active { right: 0; }

.mob-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #e0457b 0%, #f06292 100%);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 1;
}
.mob-panel__head-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}
.mob-panel__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: none;
    cursor: pointer;
    color: #fff;
    font-size: 1.125rem;
    line-height: 1;
    transition: background 0.15s;
}
.mob-panel__close:hover { background: rgba(255,255,255,0.35); }

.mob-panel__section { flex-shrink: 0; }
.mob-panel__section-label {
    padding: 0.625rem 1.25rem 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #f3f4f6;
}

/* دسته‌بندی با آکاردئون */
.mob-acc__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8125rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #1f2937;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    min-height: 2.75rem;
    user-select: none;
}
.mob-acc__trigger:hover { background: #fef2f7; color: #e0457b; }
.mob-acc__trigger.open { color: #e0457b; background: #fef2f7; }
.mob-acc__arrow {
    color: #d1d5db;
    font-size: 0.875rem;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.mob-acc__trigger.open .mob-acc__arrow { transform: rotate(180deg); color: #e0457b; }

.mob-acc__body { display: none; background: #fafafa; }
.mob-acc__body a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6875rem 1.25rem 0.6875rem 1.5rem;
    font-size: 0.875rem;
    color: #4b5563;
    text-decoration: none;
    border-bottom: 1px solid #f3f4f6;
    min-height: 2.75rem;
    transition: background 0.12s, color 0.12s;
}
.mob-acc__body a:hover { background: #fef2f7; color: #e0457b; }
.mob-acc__body a::before { content: "›"; color: #d1d5db; font-size: 1.125rem; }

/* لینک‌های ساده */
.mob-simple-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8125rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #1f2937;
    text-decoration: none;
    border-bottom: 1px solid #f3f4f6;
    min-height: 2.75rem;
    transition: background 0.15s, color 0.15s;
}
.mob-simple-link:hover { background: #fef2f7; color: #e0457b; }
.mob-simple-link span { color: #d1d5db; font-size: 0.875rem; }

/* ===== DESKTOP BREAKPOINT ===== */
@media (min-width: 768px) {
    .top-bar { display: block; }
    .main-bar { padding: 0 1.5rem; height: 4rem; }
    .main-search { display: flex; }
    .action-btn .label { display: inline; }
    .hamburger { display: none; }
    .cat-nav { display: block; }
    .mob-panel, .mob-overlay { display: none !important; }
}
