/* ==========================================
   استایل‌های اضافی برای هدر ساده، مینی‌کارت و بهبودها
   ========================================== */

/* ----- Topbar ----- */
.topbar-welcome {
    display: none;
    font-size: 0.82rem;
    color: #94A3B8;
}

@media (min-width: 992px) {
    .topbar-welcome { display: block; }
}

/* حالت تک‌ستونه نوار بالا — متن آزاد (برای اطلاع‌رسانی جشنواره/تعطیلی و...) */
.topbar-single {
    text-align: center;
    width: 100%;
    font-weight: 600;
}

/* اطمینان از اینکه فونت و رنگ inline استایل از تنظیمات ادمین، اولویت دارد */
.topbar[style] .topbar-welcome,
.topbar[style] .topbar-single,
.topbar[style] .topbar-content > div,
.topbar[style] .topbar-content > div a {
    color: inherit;
}
/* ----- متن موبایل نوار بالا -----
   اگر مدیر یک متن موبایل مجزا تنظیم کرده باشد، در دسکتاپ محتوای اصلی
   (که داخل .topbar-desktop-only قرار می‌گیرد) نمایش داده می‌شود و
   .topbar-mobile-text پنهان می‌شود. در موبایل برعکس. */
.topbar-mobile-text {
    display: none;
    text-align: center;
    width: 100%;
    font-weight: 600;
}

.topbar-desktop-only {
    display: contents; /* به‌صورت پیش‌فرض، محتوا را نشان بده */
}

@media (max-width: 991.98px) {
    /* اگر متن موبایل تنظیم شده باشد، در موبایل فقط آن را نشان بده */
    .topbar.has-mobile-text .topbar-desktop-only {
        display: none !important;
    }
    .topbar.has-mobile-text .topbar-mobile-text {
        display: block !important;
    }
}

/* ----- هدر ساده شده با آیکون‌باتن ----- */
.header-btns {
    display: flex;
    gap: 6px;
    align-items: center;
}

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    color: var(--navy);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    font-size: 1rem;
}

.icon-btn:hover {
    background: var(--primary);
    color: #FFF;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.cart-icon-btn {
    background: var(--primary);
    color: #FFF;
    border-color: var(--primary);
}

.cart-icon-btn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.cart-badge {
    position: absolute;
    top: -6px;
    left: -6px;
    background: var(--accent);
    color: #FFF;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    font-size: 0.7rem;
    font-weight: 800;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid #FFF;
}

/* ----- Header Search (آیکون جستجو + dropdown زیر هدر) ----- */
.search-icon-btn {
    background: var(--bg-light);
}
.search-icon-btn.active {
    background: var(--primary);
    color: #FFFFFF;
}

/* باکس جستجوی کشویی زیر هدر */
.header-search-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: #FFFFFF;
    z-index: 999;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.25s ease, opacity 0.2s ease, visibility 0.25s ease;
    box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.18);
    border-top: 1px solid #E2E8F0;
    pointer-events: none;
}

.header-search-dropdown.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* باکس input */
.header-search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 4px;
    border-bottom: 1px solid #F1F5F9;
}

.header-search-icon {
    color: var(--primary, #00A3E0);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.header-search-box input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--navy, #0F172A);
    padding: 4px 0;
}

.header-search-box input::placeholder {
    color: #94A3B8;
}

.header-search-close {
    background: transparent;
    border: none;
    color: #64748B;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.header-search-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

/* محتویات dropdown */
.header-search-body {
    padding: 16px 4px 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.header-search-section {
    margin-bottom: 18px;
}
.header-search-section:last-child {
    margin-bottom: 0;
}

.header-search-section h4 {
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748B;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-search-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.header-search-chips a {
    padding: 7px 14px;
    background: var(--bg-light, #F8FAFC);
    color: var(--navy, #0F172A);
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    border: 1px solid #E2E8F0;
}

.header-search-chips a:hover {
    background: var(--primary, #00A3E0);
    color: #FFFFFF;
    border-color: var(--primary, #00A3E0);
}

/* نتایج جستجو */
.header-search-results {
    border-top: 1px solid #F1F5F9;
    padding-top: 14px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--navy, #0F172A);
    transition: background 0.15s;
    margin-bottom: 2px;
}

.search-result-item:hover {
    background: var(--bg-light, #F8FAFC);
}

.search-result-img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-light, #F8FAFC);
    flex-shrink: 0;
}

.search-result-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-info h5 {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--navy, #0F172A);
    margin-bottom: 2px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-cat {
    font-size: 0.72rem;
    color: var(--primary, #00A3E0);
    font-weight: 600;
}

.search-result-price {
    font-size: 0.84rem;
    font-weight: 800;
    color: var(--accent, #FF6600);
    flex-shrink: 0;
}

/* موبایل: باکس جستجو تمام‌عرض */
@media (max-width: 992px) {
    .header-search-dropdown .container {
        padding: 0 16px;
    }
    .header-search-box input {
        font-size: 0.9rem;
    }
    .header-search-body {
        max-height: 70vh;
    }
}

/* ----- Bottom cart badge (گوشه بالا-چپ) ----- */
.bottom-cart-badge {
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-26px);
    background: var(--accent);
    color: #FFF;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    font-size: 0.6rem;
    font-weight: 800;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid #FFF;
    z-index: 2;
    line-height: 1;
}

.bottom-nav-item {
    position: relative;
}

/* ----- Toast message ----- */
.toast-msg {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--navy);
    color: #FFF;
    padding: 14px 22px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    animation: toastIn 0.3s ease;
    max-width: 90%;
    text-align: center;
}

@media (min-width: 992px) {
    .toast-msg { bottom: 30px; }
}

/* ----- مینی‌کارت (Mini Cart Sidebar) ----- */
.mini-cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    z-index: 3500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mini-cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mini-cart {
    position: fixed;
    top: 0;
    left: -100%;
    width: 400px;
    max-width: 90%;
    height: 100%;
    background: #FFF;
    z-index: 3600;
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
}

.mini-cart.open { left: 0; }

.mini-cart-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
    color: #FFF;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mini-cart-header h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: #FFF;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mini-cart-header h3 i { color: var(--accent); }

.mini-cart-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #FFF;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.mini-cart-close:hover {
    background: var(--accent);
}

.mini-cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    background: var(--bg-light);
}

.mini-cart-empty {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}

.mini-cart-empty .empty-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #FFF;
    color: var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
}

.mini-cart-empty h4 {
    color: var(--navy);
    font-size: 1.05rem;
    margin-bottom: 6px;
}

.mini-cart-empty p {
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.mini-cart-item {
    background: #FFF;
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.25s ease;
}

.mini-cart-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.mci-img {
    width: 70px;
    height: 80px;
    background: var(--bg-light);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mci-img img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.mci-info h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 4px;
    line-height: 1.4;
}

.mci-school {
    font-size: 0.74rem;
    color: var(--primary);
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.mci-sizes {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.mci-sizes .size-pill {
    font-size: 0.7rem;
    padding: 2px 8px;
}

.mci-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mci-price {
    font-weight: 800;
    color: var(--accent);
    font-size: 0.92rem;
}

.mci-price small {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
}

.mci-remove {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.mci-remove:hover {
    background: #EF4444;
    color: #FFF;
}

.mini-cart-footer {
    padding: 18px 24px;
    background: #FFF;
    border-top: 1px solid var(--border-color);
}

.mini-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding: 14px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
}

.mini-cart-total span {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.mini-cart-total strong {
    color: var(--accent);
    font-size: 1.15rem;
    font-weight: 900;
}

.mini-cart-total strong small {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
}

.mini-cart-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ----- فوتر پیشرفته ----- */
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (min-width: 576px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 992px) {
    .footer-grid { grid-template-columns: 2fr 1fr 1fr 1.5fr; }
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    color: #64748B;
    font-size: 0.82rem;
}

.footer-trust {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-trust span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-trust i {
    color: var(--primary);
}

/* ----- بهبود کارت محصول در فروشگاه ----- */
.product-price {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.product-price > div:first-child {
    display: flex;
    gap: 8px;
    align-items: center;
}

.price-current {
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--accent);
}

/* ----- فرم سفارش ترکیبی پیشرفته ----- */
.combo-advanced {
    background: var(--bg-light);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-top: 16px;
}

.combo-advanced-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.combo-advanced-title i { color: var(--primary); }

.combo-item-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed var(--border-color);
}

.combo-item-row:last-child { border-bottom: none; }

.combo-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.combo-item-info .combo-item-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.combo-item-info .combo-item-text {
    flex: 1;
}

.combo-item-info .combo-item-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--navy);
}

.combo-item-info .combo-item-price {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.combo-item-qty {
    display: flex;
    align-items: center;
    gap: 6px;
}

.combo-item-qty button {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #FFF;
    color: var(--navy);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.combo-item-qty button:hover {
    background: var(--primary);
    color: #FFF;
    border-color: var(--primary);
}

.combo-item-qty input {
    width: 42px;
    height: 32px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-weight: 700;
    color: var(--navy);
    outline: none;
    background: #FFF;
}

.combo-item-qty input:disabled {
    background: var(--bg-light);
    color: var(--text-muted);
}

.combo-summary-mini {
    margin-top: 14px;
    padding: 12px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.combo-summary-mini .label { color: var(--primary-dark); font-weight: 700; }
.combo-summary-mini .value { color: var(--accent); font-weight: 900; font-size: 1rem; }

/* ----- بهبود no-مهریز alert ----- */
.alert-no-mehriz {
    /* این کلاس فقط برای اطمینان از حذف کامل مهریز است */
    display: none;
}

/* ==========================================
   بازطراحی کارت محصول (نسخه مدرن - موبایل-friendly)
   ========================================== */
.product-card {
    background: #FFF;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card:active {
    transform: scale(0.98);
}

@media (hover: hover) {
    .product-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.15);
        border-color: transparent;
    }
}

.product-img-wrap {
    position: relative;
    overflow: hidden;
}

.product-img-wrap .product-img-box {
    display: block;
    padding: 0;
    background: #F1F5F9;
}

.product-img-wrap .product-img-box img {
    transition: transform 0.5s ease;
}

@media (hover: hover) {
    .product-card:hover .product-img-wrap .product-img-box img {
        transform: scale(1.08);
    }
}

/* دکمه افزودن به سبد در پایین کارت محصول */
.product-add-cart-btn {
    margin-top: 12px;
    padding: 11px 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #FFF;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s ease;
    font-family: inherit;
}

.product-add-cart-btn:active {
    transform: scale(0.97);
}

@media (hover: hover) {
    .product-add-cart-btn:hover {
        background: linear-gradient(135deg, var(--primary-dark) 0%, #005A7E 100%);
        box-shadow: 0 6px 16px rgba(0, 163, 224, 0.3);
    }
}

/* Product body compact */
.product-card .product-body {
    padding: 16px 18px 18px;
}

.product-card .product-category {
    font-size: 0.72rem;
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
}

.product-card .product-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 8px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
}

.product-card .product-title:hover {
    color: var(--primary);
}

.product-card .product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.78rem;
}

.product-rating-mini {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-weight: 600;
}

.product-rating-mini i {
    color: #F59E0B;
    font-size: 0.75rem;
}

.product-stock-mini {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    font-size: 0.75rem;
}

.product-stock-mini i {
    font-size: 0.5rem;
}

.product-stock-mini.in-stock {
    color: #16A34A;
}

.product-stock-mini.out-stock {
    color: #DC2626;
}

.product-card .product-price {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
}

.product-card .product-price .old-price {
    font-size: 0.78rem;
}

.product-card .product-price .price-current {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--navy);
}

.product-card .product-price .price-current .currency {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
}

.price-variable {
    font-size: 0.95rem !important;
    color: var(--accent) !important;
    display: flex;
    align-items: center;
    gap: 6px;
}

.price-variable i {
    font-size: 0.85rem;
}

/* Discount tag on image */
.product-img-wrap .discount-tag {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 3;
    background: #EF4444;
    color: #FFF;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 800;
}

/* Product badge position */
.product-img-wrap .product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    background: var(--accent);
    color: #FFF;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(255, 102, 0, 0.25);
}

/* ==========================================
   گالری محصول - با انیمیشن (حالت اصلی)
   ========================================== */

/* ==========================================
   بخش انتخاب مدرسه در صفحه اصلی - بازطراحی
   ========================================== */
.school-select-section {
    padding: 50px 0;
    background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 100%);
    position: relative;
    overflow: hidden;
}

.school-select-card {
    background: #FFF;
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    box-shadow: var(--shadow-md);
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.school-select-title {
    text-align: center;
    margin-bottom: 24px;
}

.school-select-title h2 {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--navy);
    margin-bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.school-select-title h2 i {
    color: var(--primary);
    font-size: 1.5rem;
}

.school-select-title p {
    color: var(--text-muted);
    font-size: 0.92rem;
}

/* Search input بازطراحی شده */
.school-search-wrap {
    position: relative;
    margin-bottom: 24px;
}

.school-search-input {
    width: 100%;
    padding: 16px 50px 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    color: var(--navy);
    background: #FFF;
    outline: none;
    transition: all 0.25s ease;
    font-family: inherit;
}

.school-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 163, 224, 0.12);
}

.school-search-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 1.1rem;
    pointer-events: none;
}

/* ردیف جستجو + دکمه همه مدارس */
.school-search-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: stretch;
}

.school-search-row .school-search-wrap {
    flex: 1;
    margin-bottom: 0;
}

.school-search-row .btn {
    white-space: nowrap;
    padding: 12px 20px;
}

@media (max-width: 576px) {
    .school-search-row {
        flex-direction: column;
    }
    .school-search-row .btn {
        width: 100%;
    }
}

/* دکمه‌های دسترسی سریع (گرید ۴ تایی) */
.school-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (min-width: 768px) {
    .school-quick-actions {
        grid-template-columns: repeat(4, 1fr);
    }
}

.quick-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 12px;
    background: #FFF;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--navy);
    transition: all 0.25s ease;
    text-align: center;
    cursor: pointer;
}

.quick-action-card i {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.25s ease;
}

.quick-action-card span {
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.4;
}

.quick-action-card:active {
    transform: scale(0.98);
    background: var(--primary-light);
}

@media (hover: hover) {
    .quick-action-card:hover {
        border-color: var(--primary);
        transform: translateY(-3px);
        box-shadow: var(--shadow-md);
    }
    .quick-action-card:hover i {
        background: var(--primary);
        color: #FFF;
        transform: scale(1.05);
    }
}

/* Modal همه مدارس */
.schools-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 4000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.schools-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.schools-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    background: #FFF;
    border-radius: var(--radius-lg);
    z-index: 4001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.schools-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.schools-modal-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #FFF;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.schools-modal-header h3 {
    color: #FFF;
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.schools-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #FFF;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.schools-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.schools-modal-search {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.schools-modal-search i {
    position: absolute;
    right: 36px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 1rem;
}

.schools-modal-search input {
    width: 100%;
    padding: 12px 42px 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    outline: none;
    transition: all 0.25s ease;
    font-family: inherit;
}

.schools-modal-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 163, 224, 0.12);
}

.schools-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

@media (min-width: 480px) {
    .schools-modal-body {
        grid-template-columns: 1fr 1fr;
    }
}

.schools-modal-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-light);
    border: 1.5px solid transparent;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--navy);
    transition: all 0.2s ease;
    cursor: pointer;
}

.schools-modal-item:hover {
    background: #FFF;
    border-color: var(--primary);
    transform: translateX(-4px);
}

.schools-modal-item i {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.schools-modal-item:hover i {
    background: var(--primary);
    color: #FFF;
}

.schools-modal-item span {
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.4;
}

.schools-modal-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==========================================
   بنر جستجوی محصول در فروشگاه - کادر آبی
   ========================================== */
.shop-search-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    margin-bottom: 24px;
    color: #FFF;
    position: relative;
    overflow: hidden;
}

.shop-search-banner::before {
    content: '';
    position: absolute;
    width: 220px;
    height: 220px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    top: -80px;
    left: -80px;
}

.search-banner-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.search-banner-text {
    flex: 1;
    min-width: 180px;
}

.search-banner-text h3 {
    color: #FFF;
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-banner-text h3 i {
    color: #FFF;
    background: rgba(255, 255, 255, 0.2);
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.search-banner-text p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.82rem;
    margin: 0;
}

.search-banner-input {
    flex: 1;
    min-width: 200px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-banner-input > i {
    position: absolute;
    right: 16px;
    color: var(--primary);
    font-size: 1rem;
    pointer-events: none;
    z-index: 1;
}

.search-banner-input input {
    width: 100%;
    padding: 13px 44px 13px 44px;
    border-radius: var(--radius-md);
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.95);
    color: var(--navy);
    font-size: 0.92rem;
    font-weight: 600;
    outline: none;
    font-family: inherit;
    transition: all 0.25s ease;
}

.search-banner-input input::placeholder {
    color: var(--text-muted);
}

.search-banner-input input:focus {
    background: #FFF;
    border-color: #FFF;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.search-clear-btn {
    position: absolute;
    left: 12px;
    background: var(--bg-light);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    z-index: 1;
}

.search-clear-btn:hover {
    background: #EF4444;
    color: #FFF;
}

@media (max-width: 576px) {
    .search-banner-content {
        flex-direction: column;
        align-items: stretch;
    }

    .search-banner-text {
        text-align: center;
    }

    .search-banner-text h3 {
        justify-content: center;
        font-size: 0.98rem;
    }

    .search-banner-text p {
        font-size: 0.78rem;
    }
}

/* ============================================================
   مگامنو دسته‌بندی محصولات (نسخه ساده) — هدر دسکتاپ
   ============================================================ */

/* wrapper دراپ‌داون داخل nav-menu */
.nav-cats-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* دکمه «دسته‌بندی» — استایل ساده مثل nav-link (فقط متن آبی در hover) */
.nav-cats-btn {
    background: transparent !important;
    color: var(--navy, #0F172A) !important;
    border: none;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0 !important;
    transition: color 0.2s;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    white-space: nowrap;
    text-decoration: none;
}
.nav-cats-btn:hover,
.nav-cats-btn.active {
    background: transparent !important;
    color: var(--primary, #00A3E0) !important;
}
.nav-cats-btn > i.fa-layer-group {
    font-size: 0.92rem;
    color: inherit;
}
.nav-cats-btn .nav-cats-chevron {
    font-size: 0.7rem;
    transition: transform 0.25s;
    color: inherit;
    opacity: 0.7;
}
.nav-cats-btn.active .nav-cats-chevron {
    transform: rotate(180deg);
}

/* پانل مگامنو */
.mega-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 280px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.18);
    padding: 8px;
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    z-index: 1000;
}
.mega-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* محیط داخلی: ستون عمودی ساده */
.mega-menu-inner {
    display: flex;
    flex-direction: column;
}

/* بلاک هر دسته اصلی (ساده) */
.mega-cat-block-simple {
    border-bottom: 1px solid #F1F5F9;
}
.mega-cat-block-simple:last-child {
    border-bottom: none;
}

/* هدر هر دسته اصلی */
.mega-cat-head-simple {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    text-decoration: none;
    color: var(--navy, #0F172A);
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}
.mega-cat-head-simple > i:first-child {
    color: var(--primary, #00A3E0);
    font-size: 0.92rem;
    width: 16px;
    text-align: center;
}
.mega-cat-head-simple:hover {
    background: rgba(0, 163, 224, 0.06);
    color: var(--primary, #00A3E0);
}

/* زیردسته‌ها داخل هر بلاک (ساده) */
.mega-subs-simple {
    display: flex;
    flex-direction: column;
    padding: 2px 0 6px;
}
.mega-sub-simple {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 36px;
    text-decoration: none;
    color: var(--navy, #0F172A);
    font-size: 0.84rem;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.mega-sub-simple i {
    color: #94A3B8;
    font-size: 0.74rem;
    width: 14px;
    text-align: center;
    transition: color 0.15s;
}
.mega-sub-simple:hover {
    background: rgba(0, 163, 224, 0.06);
    color: var(--primary, #00A3E0);
}
.mega-sub-simple:hover i {
    color: var(--primary, #00A3E0);
}

/* ============================================================
   منوی موبایل: آیتم «دسته‌بندی» درون منوی اصلی
   ============================================================ */

/* trigger آیتم «دسته‌بندی» — استایل ساده مثل بقیه offcanvas-link */
.offcanvas-cats-trigger {
    width: 100%;
    text-align: right;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    /* ارث بری استایل از .offcanvas-link */
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    text-decoration: none;
    color: var(--navy, #0F172A);
    font-size: 0.92rem;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}
.offcanvas-cats-trigger:hover,
.offcanvas-cats-trigger.open {
    background: rgba(0, 163, 224, 0.06);
    color: var(--primary, #00A3E0);
}
.offcanvas-cats-trigger > i:first-child {
    color: var(--primary, #00A3E0);
    font-size: 0.92rem;
    width: 18px;
    text-align: center;
}
.offcanvas-cats-trigger-chevron {
    color: #94A3B8;
    transition: transform 0.25s;
}
.offcanvas-cats-trigger.open .offcanvas-cats-trigger-chevron {
    transform: rotate(180deg);
    color: var(--primary, #00A3E0);
}

/* زیرلیست دسته‌ها — باز شده زیر آیتم دسته‌بندی */
.offcanvas-cats-sublist {
    background: var(--bg-light, #F8FAFC);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

/* هر بلاک دسته اصلی */
.cats-block-simple {
    /* بدون border-bottom اضافه */
}

/* دکمه هر دسته اصلی */
.cats-toggle-simple {
    width: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 11px 18px 11px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--navy, #0F172A);
    font-size: 0.86rem;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
    text-align: right;
}
.cats-toggle-simple > span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.cats-toggle-simple > span > i {
    color: #64748B;
    font-size: 0.78rem;
    width: 14px;
    text-align: center;
    transition: color 0.15s;
}
.cats-toggle-simple:hover,
.cats-toggle-simple.open {
    background: rgba(0, 163, 224, 0.06);
    color: var(--primary, #00A3E0);
}
.cats-toggle-simple:hover > span > i,
.cats-toggle-simple.open > span > i {
    color: var(--primary, #00A3E0);
}
.cats-chevron-simple {
    font-size: 0.7rem;
    color: #94A3B8;
    transition: transform 0.25s;
}
.cats-toggle-simple.open .cats-chevron-simple {
    transform: rotate(180deg);
    color: var(--primary, #00A3E0);
}

/* زیردسته‌ها */
.cats-children-wrap-simple {
    background: #FFFFFF;
    padding: 2px 0;
}
.cats-sublink-simple {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px 9px 48px;
    text-decoration: none;
    color: var(--navy, #0F172A);
    font-size: 0.82rem;
    transition: background 0.15s, color 0.15s;
}
.cats-sublink-simple i {
    color: #94A3B8;
    font-size: 0.72rem;
    width: 14px;
    text-align: center;
    transition: color 0.15s;
}
.cats-sublink-simple:hover {
    background: rgba(0, 163, 224, 0.06);
    color: var(--primary, #00A3E0);
}
.cats-sublink-simple:hover i {
    color: var(--primary, #00A3E0);
}

/* (نگه داشتن استایل‌های قدیمی برای shop.html) */
.offcanvas-sublink {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 28px 9px 18px;
    text-decoration: none;
    color: var(--navy, #0F172A);
    font-size: 0.85rem;
    transition: background 0.15s, color 0.15s;
}
.offcanvas-sublink:hover {
    background: rgba(0, 163, 224, 0.06);
    color: var(--primary, #00A3E0);
}
.offcanvas-sublink i {
    color: #64748B;
    font-size: 0.78rem;
    width: 16px;
    text-align: center;
}

/* ============================================================
   درخت دسته‌بندی سلسله‌مراتبی در سایدبار فروشگاه (نسخه ساده)
   ============================================================ */

#categoryTreeContainer {
    margin-top: 4px;
}

.cat-tree-block {
    border-bottom: 1px solid #F1F5F9;
}
.cat-tree-block:last-child {
    border-bottom: none;
}

/* ریشه (دسته اصلی) */
.cat-tree-block .cat-tree-root {
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
}

/* سمت راست: شمارنده + chevron */
.cat-tree-right-side {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* chevron واقعی (عنصر <i>) */
.cat-tree-chevron-icon {
    font-size: 0.7rem;
    color: #94A3B8;
    transition: transform 0.2s, color 0.15s;
}
.cat-tree-block.expanded .cat-tree-chevron-icon {
    transform: rotate(180deg);
    color: var(--primary, #00A3E0);
}

.cat-tree-block .cat-tree-root:hover {
    background: rgba(0, 163, 224, 0.04);
    color: var(--primary, #00A3E0);
}
.cat-tree-block .cat-tree-root:hover .cat-tree-chevron-icon {
    color: var(--primary, #00A3E0);
}
.cat-tree-block .cat-tree-root.active {
    color: var(--primary, #00A3E0);
    background: rgba(0, 163, 224, 0.06);
}
.cat-tree-block .cat-tree-root.active .cat-tree-chevron-icon {
    color: var(--primary, #00A3E0);
}

/* زیردسته‌ها - push-down ساده */
.cat-tree-children {
    padding: 2px 0 4px;
    background: #FFFFFF;
    animation: fadeInDown 0.2s ease;
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cat-tree-sub {
    cursor: pointer;
    padding: 9px 12px 9px 32px !important;
    font-size: 0.84rem !important;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.cat-tree-sub:hover {
    background: rgba(0, 163, 224, 0.04);
    color: var(--primary, #00A3E0);
}
.cat-tree-sub.active {
    color: var(--primary, #00A3E0);
    background: rgba(0, 163, 224, 0.06);
    font-weight: 600;
}

/* شمارنده‌ها - رنگ ملایم، بدون تداخل */
.cat-tree-root .count,
.cat-tree-sub .count {
    background: var(--bg-light, #F8FAFC);
    color: var(--text-muted, #64748B);
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    border: 1px solid #E2E8F0;
}
.cat-tree-root:hover .count,
.cat-tree-sub:hover .count {
    background: #FFFFFF;
    color: var(--primary, #00A3E0);
    border-color: rgba(0, 163, 224, 0.3);
}
.cat-tree-root.active .count,
.cat-tree-sub.active .count {
    background: var(--primary, #00A3E0);
    color: #FFFFFF;
    border-color: var(--primary, #00A3E0);
}

/* آیتم «همه محصولات» */
#categoryFilterList .category-filter-item[data-cat="all"] {
    cursor: pointer;
    border-bottom: 1px solid #F1F5F9;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.15s, color 0.15s;
}
#categoryFilterList .category-filter-item[data-cat="all"]:hover {
    background: rgba(0, 163, 224, 0.04);
    color: var(--primary, #00A3E0);
}
#categoryFilterList .category-filter-item[data-cat="all"].active {
    color: var(--primary, #00A3E0);
    background: rgba(0, 163, 224, 0.06);
}
#categoryFilterList .category-filter-item[data-cat="all"].active .count {
    background: var(--primary, #00A3E0);
    color: #FFFFFF;
}

/* ============================================================
   دکمه‌های ابزار سایز (ماژول پیشنهاد سایز + راهنمای اندازه)
   ============================================================ */

.size-tools-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.size-tool-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: var(--bg-light, #F8FAFC);
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    color: var(--navy, #0F172A);
    font-size: 0.86rem;
    font-weight: 600;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.1s;
    text-align: right;
    justify-content: flex-start;
}
.size-tool-btn i {
    color: var(--primary, #00A3E0);
    font-size: 1rem;
    transition: transform 0.2s;
}
.size-tool-btn:hover {
    background: rgba(0, 163, 224, 0.08);
    border-color: var(--primary, #00A3E0);
    color: var(--primary, #00A3E0);
}
.size-tool-btn:hover i {
    transform: scale(1.1);
}
.size-tool-btn:active {
    transform: scale(0.98);
}
@media (max-width: 480px) {
    .size-tools-row {
        grid-template-columns: 1fr;
    }
    .size-tool-btn {
        font-size: 0.82rem;
    }
}

/* ============================================================
   انتخابگر رنگ محصول (color chips)
   ============================================================ */

.color-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
}
.color-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px 8px 8px;
    background: #FFFFFF;
    border: 2px solid #E2E8F0;
    border-radius: 30px;
    cursor: pointer;
    font-family: inherit;
    color: var(--navy, #0F172A);
    font-size: 0.84rem;
    font-weight: 500;
    transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.1s;
}
.color-chip .color-swatch {
    display: inline-block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}
.color-chip:hover {
    border-color: var(--primary, #00A3E0);
    transform: translateY(-1px);
}
.color-chip.selected {
    border-color: var(--primary, #00A3E0);
    background: rgba(0, 163, 224, 0.08);
    color: var(--primary, #00A3E0);
    font-weight: 700;
}
.color-chip.selected::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free', 'FontAwesome', sans-serif;
    font-weight: 900;
    color: var(--primary, #00A3E0);
    font-size: 0.72rem;
    margin-left: -2px;
    margin-right: -4px;
    display: inline-block;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   ردیف‌های مستقل سفارش (هر ردیف با سایز/رنگ/تعداد مستقل)
   ============================================================ */

#orderRowsContainer {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-row {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.order-row:hover {
    border-color: rgba(0, 163, 224, 0.4);
    box-shadow: 0 4px 12px -4px rgba(0, 163, 224, 0.15);
}

@keyframes flashNew {
    0%   { background: rgba(0, 163, 224, 0.12); border-color: var(--primary, #00A3E0); }
    100% { background: #FFFFFF; border-color: #E2E8F0; }
}

.order-row-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #E2E8F0;
}
.order-row-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary, #00A3E0);
    color: #FFFFFF;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}
.order-row-title {
    flex: 1;
    font-weight: 700;
    color: var(--navy, #0F172A);
    font-size: 0.92rem;
}
.order-row-remove {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #EF4444;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.15s, transform 0.15s;
    font-size: 0.9rem;
}
.order-row-remove:hover {
    background: rgba(239, 68, 68, 0.1);
    transform: scale(1.1);
}

.order-row-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
@media (max-width: 480px) {
    .order-row-body {
        grid-template-columns: 1fr;
    }
}
.order-row-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.order-row-field label {
    font-size: 0.74rem;
    color: var(--text-muted, #64748B);
    font-weight: 600;
}
.order-row-field .form-control {
    padding: 7px 10px;
    font-size: 0.84rem;
}
.order-row-qty-field .combo-item-qty {
    display: flex;
    align-items: center;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #E2E8F0;
}
.order-row-qty-field .combo-item-qty button {
    background: var(--bg-light, #F8FAFC);
    border: none;
    width: 34px;
    height: 34px;
    cursor: pointer;
    color: var(--navy, #0F172A);
    transition: background 0.15s, color 0.15s;
}
.order-row-qty-field .combo-item-qty button:hover {
    background: var(--primary, #00A3E0);
    color: #FFFFFF;
}
.order-row-qty-field .combo-item-qty input {
    flex: 1;
    border: none;
    border-right: 1px solid #E2E8F0;
    border-left: 1px solid #E2E8F0;
    text-align: center;
    width: 50px;
    height: 34px;
    font-family: inherit;
    font-size: 0.88rem;
    background: #FFFFFF;
}

.order-row-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #E2E8F0;
    font-size: 0.78rem;
}
.order-row-unit-price {
    color: var(--text-muted, #64748B);
}
.order-row-subtotal {
    color: var(--accent, #FF6600);
    font-weight: 700;
}

/* دکمه افزودن ردیف جدید */
.add-row-btn {
    border: 2px dashed #CBD5E1 !important;
    background: transparent !important;
    color: var(--navy, #0F172A) !important;
    font-weight: 600;
    transition: border-color 0.2s, background 0.2s, color 0.2s !important;
}
.add-row-btn:hover {
    border-color: var(--primary, #00A3E0) !important;
    background: rgba(0, 163, 224, 0.04) !important;
    color: var(--primary, #00A3E0) !important;
}

/* ردیف ناموجور (سایز ناموجور) */
.order-row-out-of-stock {
    border-color: #FCA5A5 !important;
    background: #FEF2F2 !important;
}
.order-row-out-of-stock .order-row-header {
    border-bottom-color: #FECACA;
}
.order-row-out-of-stock .order-row-title {
    color: #991B1B;
}
.select-out-of-stock {
    border-color: #FCA5A5 !important;
    background: #FEF2F2 !important;
    color: #991B1B !important;
}
.order-row-out-of-stock .combo-item-qty button {
    background: #F3F4F6 !important;
    color: #9CA3AF !important;
    cursor: not-allowed !important;
}
.order-row-out-of-stock .combo-item-qty button:hover {
    background: #F3F4F6 !important;
    color: #9CA3AF !important;
}
.order-row-out-of-stock .row-qty-input {
    background: #F9FAFB !important;
    color: #9CA3AF !important;
}

/* ===== v3.6.10 -> v3.7.0: Forced size/color selection styles =====
   v3.7.0 redesign:
   - Background changed from orange-tinted (#FFFBEB) to white.
     The orange was too aggressive and competed with the orange CTA button.
   - The "in your face" effect is now achieved via an animated SVG
     "marching ants" dashed border (same technique as .product-order-banner),
     so the unselected row stays visible WITHOUT screaming orange.
   - The .select-unselected dropdown keeps a solid orange border (no pulse)
     so the user knows exactly which field needs attention.
   ========================================================================== */

/* Unselected dropdown — solid orange border, white background, no pulse.
   The static orange border is enough to draw attention; the pulse was
   visually noisy and overlapped with the marching-ants row border. */
.select-unselected {
    border: 2px solid #F59E0B !important;
    background: #FFFFFF !important;
    color: #92400E !important;
    font-weight: 600;
}
/* Selected dropdown — green border to confirm (unchanged) */
.select-selected {
    border: 2px solid #10B981 !important;
    background: #F0FDF4 !important;
    transition: all 0.3s ease;
}

/* Locked row (size or color not yet selected).
   - White background (was: #FFFBEB) so it doesn't compete with the CTA.
   - Solid border is removed — the SVG marching-ants layer provides the border.
   - position:relative + overflow:hidden create the clipping frame for the SVG. */
.order-row-locked {
    opacity: 1;                  /* v3.7.0: was 0.85, no longer dimmed */
    border: 1px solid transparent !important;  /* SVG provides the visible border */
    background: #FFFFFF;        /* White, not orange-tinted */
    position: relative;
    overflow: hidden;
}

/* The .order-row-locked's qty controls are still disabled, but kept at
   reduced opacity so the row doesn't look "broken" — the
   marching-ants border is the primary "needs attention" cue. */
.order-row-locked .combo-item-qty button,
.order-row-locked .row-qty-input {
    opacity: 0.5;
    pointer-events: none;
}

/* === SVG marching-ants border layer (injected via JS into each .order-row-locked) ===
   The SVG fills the row, and its <rect> carries an animated stroke-dashoffset.
   This is the SAME technique used by .product-order-banner — see product.html L317. */
.order-row-locked .row-marching-ants {
    position: absolute;
    /* v3.7.1 Android compat: explicit offsets instead of `inset: 0` —
       the shorthand is unsupported on older Android WebViews (Chromium < 87),
       where it is silently ignored and the SVG collapses. */
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: visible;
}
.order-row-locked .row-marching-ants rect {
    fill: none;
    stroke: #F59E0B;                        /* Orange */
    stroke-width: 2;                        /* 2px - matches original `border: 2px dashed` thickness */
    stroke-dasharray: 8 6;                  /* Same pattern as .product-order-banner */
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;      /* Keeps stroke at 2px regardless of SVG scale */
    animation: row-dash-march 1.6s linear infinite;
}
/* "marching ants" — shift the dash pattern around the perimeter.
   14 = dash (8) + gap (6) — one full pattern cycle, so motion is seamless. */
@keyframes row-dash-march {
    from { stroke-dashoffset: 0; }
    to   { stroke-dashoffset: -14; }
}
/* All row content sits above the SVG layer */
.order-row-locked > *:not(.row-marching-ants) {
    position: relative;
    z-index: 1;
}

/* Pending badge — softer palette (gray pill + orange icon only).
   v3.7.0: was #FEF3C7 / #92400E which felt too orange-heavy next to the
   already-orange SVG border. Now neutral gray with a single orange icon. */
.order-row-pending-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    background: #F1F5F9;        /* Slate-100 */
    color: #475569;             /* Slate-600 */
    font-size: 0.72rem;
    font-weight: 600;
    margin-right: auto;
}
.order-row-pending-badge i {
    font-size: 0.68rem;
    color: #F59E0B;             /* Single orange cue */
}
/* End-result preview at the bottom of each row (shown when row is complete) */
.order-row-preview {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    margin-top: 6px;
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-radius: 8px;
    font-size: 0.82rem;
    color: #166534;
    font-weight: 600;
    animation: slide-in-preview 0.4s ease;
}
@keyframes slide-in-preview {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   مودال‌های سایز (ماژول پیشنهاد سایز + راهنمای اندازه)
   ============================================================ */

.size-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}
.size-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.size-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 92%;
    max-width: 640px;
    max-height: 90vh;
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 20px 60px -10px rgba(15, 23, 42, 0.3);
    z-index: 1501;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.size-modal.open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.size-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid #E2E8F0;
    background: var(--bg-light, #F8FAFC);
}
.size-modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--navy, #0F172A);
    display: flex;
    align-items: center;
    gap: 10px;
}
.size-modal-header h3 i {
    color: var(--primary, #00A3E0);
    font-size: 1.1rem;
}
.size-modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #64748B;
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s, transform 0.15s;
}
.size-modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    transform: rotate(90deg);
}

.size-modal-body {
    padding: 22px;
    overflow-y: auto;
    flex: 1;
}

.size-modal-intro {
    background: var(--bg-light, #F8FAFC);
    border-right: 3px solid var(--primary, #00A3E0);
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.86rem;
    color: var(--navy, #0F172A);
    line-height: 1.7;
    margin-bottom: 18px;
}

/* مودال راهنمای اندازه: جدول‌های سایز */
.size-chart-block {
    margin-bottom: 20px;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    overflow: hidden;
}
.size-chart-block:last-child {
    margin-bottom: 0;
}
.size-chart-title {
    background: var(--navy, #0F172A);
    color: #FFFFFF;
    padding: 10px 14px;
    font-size: 0.92rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.size-chart-title::before {
    content: '\\f0cb';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--accent, #FF6600);
}
.size-chart-table-wrap {
    overflow-x: auto;
    max-width: 100%;
}
.size-chart-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.size-chart-table thead th {
    background: var(--bg-light, #F8FAFC);
    color: var(--navy, #0F172A);
    font-weight: 700;
    padding: 10px 8px;
    text-align: center;
    border-bottom: 2px solid #E2E8F0;
    white-space: nowrap;
}
.size-chart-table tbody td {
    padding: 8px;
    text-align: center;
    border-bottom: 1px solid #F1F5F9;
    color: var(--navy, #0F172A);
}
.size-chart-table tbody td:first-child {
    font-weight: 700;
    background: rgba(0, 163, 224, 0.04);
    color: var(--primary, #00A3E0);
}
.size-chart-table tbody tr:hover td {
    background: rgba(0, 163, 224, 0.04);
}
.size-chart-table tbody tr:hover td:first-child {
    background: rgba(0, 163, 224, 0.1);
}

/* فرم ماژول پیشنهاد سایز داخل مودال */
.smart-size-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 480px) {
    .smart-size-form {
        grid-template-columns: 1fr;
    }
}
.smart-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.smart-field label {
    font-size: 0.78rem;
    color: var(--text-muted, #64748B);
    font-weight: 600;
}
.smart-field input,
.smart-field select {
    padding: 9px 12px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.88rem;
    background: #FFFFFF;
    color: var(--navy, #0F172A);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.smart-field input:focus,
.smart-field select:focus {
    outline: none;
    border-color: var(--primary, #00A3E0);
    box-shadow: 0 0 0 3px rgba(0, 163, 224, 0.15);
}

/* نتیجه پیشنهاد سایز */
.smart-result {
    display: none;
    margin-top: 18px;
    padding: 16px;
    background: linear-gradient(135deg, #F0F9FF, #E0F2FE);
    border: 1px solid #BAE6FD;
    border-radius: 12px;
    text-align: center;
    color: var(--navy, #0F172A);
    font-size: 0.92rem;
}
.smart-result.show {
    display: block;
    animation: slideUp 0.3s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.smart-result .size-suggest {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 14px 0;
    flex-wrap: wrap;
}
.smart-result .size-tag {
    display: inline-block;
    background: var(--accent, #FF6600);
    color: #FFFFFF;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1.05rem;
    margin-top: 4px;
}

/* موبایل: مودال تمام‌عرض */
@media (max-width: 640px) {
    .size-modal {
        width: 96%;
        max-height: 92vh;
        border-radius: 12px;
    }
    .size-modal-header {
        padding: 14px 16px;
    }
    .size-modal-header h3 {
        font-size: 0.96rem;
    }
    .size-modal-body {
        padding: 16px;
    }
    .size-modal-intro {
        font-size: 0.82rem;
        padding: 10px 12px;
    }
    .smart-result .size-suggest {
        gap: 16px;
    }
}

/* ============================================================
   هشدار زمان تحویل (۳۰ روز کاری) — فقط محصولات مدارس
   ============================================================ */

.delivery-warning {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border: 1px solid #F59E0B;
    border-right: 4px solid #D97706;
    border-radius: 12px;
    margin: 16px 0;
    color: #78350F;
    font-size: 0.88rem;
    line-height: 1.7;
    animation: pulseWarning 2.5s ease-in-out infinite;
}
@keyframes pulseWarning {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.3); }
    50%      { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}
.delivery-warning > i {
    font-size: 1.4rem;
    color: #D97706;
    flex-shrink: 0;
    margin-top: 2px;
}
.delivery-warning strong {
    color: #78350F;
    display: block;
    margin-bottom: 2px;
    font-size: 0.92rem;
}
.delivery-warning b {
    color: #B45309;
}
.delivery-warning span {
    color: #92400E;
}







/* ============================================================
   محصولات مرتبط — راهکار A (نسخه بازطراحی‌شده)
   جایگاه: زیر نوار اعتماد در ستون گالری، کنار فرم سفارش
   ============================================================ */

.related-section-v2 {
    background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 60%, #FFE4C4 100%);
    border: 2px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: 18px 14px 16px;
    box-shadow: 0 12px 32px -10px rgba(255, 102, 0, 0.35);
    position: relative;
    overflow: hidden;
}

/* لایه دکوراتیو بالا */
.related-section-v2::before {
    content: '';
    position: absolute;
    top: -60px;
    left: -60px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(255, 102, 0, 0.18) 0%, transparent 70%);
    pointer-events: none;
}
.related-section-v2::after {
    content: '';
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(0, 163, 224, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

/* === هدر بولد === */
.related-v2-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    position: relative;
    z-index: 2;
}

.related-v2-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.related-v2-icon {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent) 0%, #FF8838 100%);
    color: #FFF;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 6px 16px rgba(255, 102, 0, 0.4);
    animation: related-icon-pulse 2.4s ease-in-out infinite;
}

@keyframes related-icon-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 6px 16px rgba(255, 102, 0, 0.4); }
    50% { transform: scale(1.08); box-shadow: 0 10px 24px rgba(255, 102, 0, 0.55); }
}

.related-v2-title-wrap h2 {
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--navy);
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.related-v2-sub {
    font-size: 0.78rem;
    color: var(--accent-hover);
    font-weight: 600;
    margin: 2px 0 0 0;
    line-height: 1.2;
}

/* بج چشمک‌زن «جا نمونه!» */
.related-v2-badge {
    flex-shrink: 0;
    background: var(--accent);
    color: #FFF;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.74rem;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.45);
    animation: badge-blink 1.8s ease-in-out infinite;
    white-space: nowrap;
}

@keyframes badge-blink {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(255, 102, 0, 0.45);
    }
    50% {
        opacity: 0.75;
        transform: scale(1.05);
        box-shadow: 0 6px 18px rgba(255, 102, 0, 0.6);
    }
}

/* === پیکربندی اسلایدر === */
.related-slider-wrapper {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
}

.related-slider-viewport {
    overflow: hidden;
    flex: 1;
    min-width: 0;
    /* padding برای سایه کارت‌ها هنگام hover */
    padding: 4px 0 8px;
}

.related-slider-track {
    display: flex;
    gap: 12px;
    transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
    /* در RTL، translateX مثبت یعنی حرکت به چپ (آیتم بعدی) */
}

.related-slider-track .product-card {
    /* 1.2 cards visible: card width = ~83% of viewport (1 full + 20% peek) */
    flex: 0 0 calc(83% - 6px);
    max-width: calc(83% - 6px);
    min-width: 0;
    border: 2px solid transparent;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.related-slider-track .product-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 14px 28px -8px rgba(255, 102, 0, 0.35);
}

/* === فلش‌های ناوبری (شناور روی کارت‌ها) === */
.related-slider-arrow {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #FFF;
    border: 2px solid var(--accent);
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    box-shadow: 0 4px 10px rgba(255, 102, 0, 0.18);
    transition: all 0.2s ease;
    z-index: 5;
}

.related-slider-arrow:hover:not(:disabled) {
    background: var(--accent);
    color: #FFF;
    transform: scale(1.1);
    box-shadow: 0 6px 18px rgba(255, 102, 0, 0.4);
}

.related-slider-arrow:active:not(:disabled) {
    transform: scale(0.95);
}

.related-slider-arrow:disabled {
    cursor: default;
}

/* === دات‌ها === */
.related-slider-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 14px;
    position: relative;
    z-index: 2;
}

.related-slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 102, 0, 0.3);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
}

.related-slider-dot.active {
    width: 24px;
    border-radius: 5px;
    background: var(--accent);
    box-shadow: 0 2px 6px rgba(255, 102, 0, 0.4);
}

.related-slider-dot:hover:not(.active) {
    background: rgba(255, 102, 0, 0.55);
}

/* === ریسپانسیو === */
@media (max-width: 1199px) {
    .related-slider-track .product-card {
        flex: 0 0 calc(50% - 6px);
        max-width: calc(50% - 6px);
    }
}

/* در صفحات خیلی بزرگ (>1800px)، ۳ کارت نمایش بده */
@media (min-width: 1800px) {
    .related-slider-track .product-card {
        flex: 0 0 calc(33.333% - 11px);
        max-width: calc(33.333% - 11px);
    }
}

@media (max-width: 767px) {
    .related-section-v2 {
        padding: 16px 12px 14px;
    }
    .related-v2-title-wrap h2 {
        font-size: 0.95rem;
    }
    .related-v2-icon {
        width: 40px;
        height: 40px;
        font-size: 1.05rem;
    }
    .related-slider-track .product-card {
        flex: 0 0 calc(50% - 6px);
        max-width: calc(50% - 6px);
    }
    .related-slider-arrow {
        width: 32px;
        height: 32px;
        font-size: 0.78rem;
    }
}

@media (max-width: 479px) {
    .related-slider-track .product-card {
        flex: 0 0 83%;
        max-width: 83%;
    }
    .related-v2-badge {
        display: none;
    }
    .related-v2-title-wrap h2 {
        font-size: 0.88rem;
    }
    .related-slider-wrapper {
        gap: 6px;
    }
    .related-slider-arrow {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
}

/* پشتیبانی reduced motion */
@media (prefers-reduced-motion: reduce) {
    .related-v2-icon,
    .related-v2-badge {
        animation: none;
    }
    .related-slider-track {
        transition: transform 0.1s linear;
    }
}
