/* =====================================================
   اصلاحات ظاهری و ریسپانسیو (نسخه‌ی جدید)
   این فایل در همه‌ی صفحات «آخر از همه» لود می‌شه تا
   استایل‌های قبلی رو بدون دست‌کاری اون فایل‌ها اصلاح کنه.
===================================================== */

html {
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
}

img,
svg,
video {
    max-width: 100%;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed !important;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}


/* آیتم‌های گرید نباید به‌خاطر محتوای عریض از صفحه بیرون بزنن */
.products-layout > *,
.profile-layout > *,
.checkout-layout > *,
.cart-layout > * {
    min-width: 0;
}


/* ================= هدر و دکمه‌ی حساب کاربری ================= */

.header-actions .user-btn {
    color: var(--dark);
    flex-shrink: 0;
}

.header-actions .user-btn.logged-in {
    background: #dcfce7;
    box-shadow: inset 0 0 0 1px #bbf7d0;
}

.header-actions .user-btn:hover {
    background: var(--primary);
    color: #fff;
}

.cart-btn {
    flex-shrink: 0;
    transition: 0.3s;
}

.cart-btn:hover {
    background: #dcfce7;
    transform: translateY(-2px);
}

.logo {
    white-space: nowrap;
    line-height: 1.6;
}


/* ================= فوتر: لوگوی خوانا روی پس‌زمینه‌ی تیره ================= */

.footer .logo,
.footer .footer-logo {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.04);
}

.footer .logo span,
.footer .footer-logo span {
    color: #4ade80;
}

.footer .logo:hover {
    border-color: #4ade80;
}

.footer-column a:hover {
    color: #ffffff;
}


/* ================= دکمه‌هایی که استایل نداشتن ================= */

.pay-remaining-btn {
    margin-top: 15px;
    border: 1px solid #f59e0b;
    background: #fffbeb;
    color: #b45309;
    padding: 9px 15px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.pay-remaining-btn:hover {
    background: #f59e0b;
    color: #fff;
}

.order-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.order-buttons .view-order-btn,
.order-buttons .pay-remaining-btn,
.order-buttons .cancel-order-btn {
    margin: 15px 0 0 !important;
}

#editTicketBtn {
    border: 1px solid var(--primary) !important;
    background: #fff !important;
    color: var(--primary) !important;
    padding: 7px 14px !important;
    border-radius: 8px !important;
    font-size: 11px !important;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

#editTicketBtn:hover {
    background: var(--primary) !important;
    color: #fff !important;
}

#closeSuccess,
.success-box button {
    border: 0;
    background: var(--primary);
    color: #fff;
    padding: 12px 26px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

#closeSuccess:hover {
    background: var(--primary-dark);
}

#resetFilters {
    padding: 5px 10px;
    border-radius: 8px;
    transition: 0.2s;
}

#resetFilters:hover {
    background: #fee2e2;
}

.cart-quantity button,
.quantity-box button {
    transition: 0.2s;
}

.cart-quantity button:hover {
    background: var(--primary);
    color: #fff;
}

.add-cart {
    transition: 0.2s;
}

.add-cart:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}


/* ================= پنل کاربری: منو ================= */

/* قبلاً همه‌ی دکمه‌های منو قرمز می‌شدن (فقط «خروج» باید قرمز باشه) */
.profile-menu .profile-tab {
    color: var(--dark);
    font-size: 13px;
    font-weight: 500;
}

.profile-menu .profile-tab:hover,
.profile-menu .profile-tab.active {
    background: var(--light);
    color: var(--primary);
}

.profile-menu .profile-tab.active {
    font-weight: 700;
    box-shadow: inset -3px 0 0 var(--primary);
}

.profile-menu .logout-btn {
    color: #d64545;
}

.profile-menu .logout-btn:hover {
    background: #fef2f2;
}


/* ================= پنل کاربری: وضعیت حساب ================= */

.profile-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    background: #dcfce7;
    color: #15803d;
}

.profile-status-badge[data-status="inactive"] {
    background: #fee2e2;
    color: #b91c1c;
}

.profile-status-badge[data-status="vip"] {
    background: #fef3c7;
    color: #92400e;
}

.account-status[data-status="active"] {
    color: #15803d !important;
}

.account-status[data-status="inactive"] {
    color: #dc2626 !important;
}

.account-status[data-status="vip"] {
    color: #b45309 !important;
}

.inactive-account-notice {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 16px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.inactive-account-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #fed7aa;
    color: #c2410c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
}

.inactive-account-text {
    flex: 1;
}

.inactive-account-text strong {
    display: block;
    color: #9a3412;
    font-size: 14px;
    margin-bottom: 4px;
}

.inactive-account-text p {
    color: #7c2d12;
    font-size: 12px;
    line-height: 2;
    margin: 0;
}

.inactive-account-btn {
    flex-shrink: 0;
    border: 0;
    background: #ea580c;
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.inactive-account-btn:hover {
    background: #c2410c;
}

/* حساب غیرفعال: دکمه‌هایی که کاری نمی‌تونن انجام بدن کم‌رنگ می‌شن */
body.account-inactive .pay-remaining-btn,
body.account-inactive .cancel-order-btn,
body.account-inactive #topupWalletButton {
    opacity: 0.5;
}


/* ================= پنل کاربری: جستجو و فیلتر سفارش‌ها ================= */

.order-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.order-search-box {
    flex: 1 1 240px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 12px;
    background: #fff;
    transition: 0.2s;
}

.order-search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.order-search-box span {
    font-size: 14px;
    opacity: 0.6;
}

.order-search-box input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    padding: 11px 0;
    font-size: 12.5px;
    background: transparent;
}

.order-status-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
    flex: 0 1 auto;
}

.order-status-filter span {
    white-space: nowrap;
}

.order-status-filter select {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 12.5px;
    background: #fff;
    color: var(--dark);
    cursor: pointer;
    outline: 0;
    min-width: 170px;
}

.order-status-filter select:focus {
    border-color: var(--primary);
}

.no-order-results {
    text-align: center;
    padding: 30px 15px;
    color: var(--muted);
    font-size: 13px;
    border: 1px dashed var(--border);
    border-radius: 14px;
}

.order-status-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.order-status[data-status="پرداخت نشده"] {
    background: #fef3c7;
    color: #b45309 !important;
}

.order-status[data-status="در انتظار بررسی"] {
    background: #e0f2fe;
    color: #0369a1 !important;
}

.order-status[data-status="تأیید شده"],
.order-status[data-status="در حال آماده‌سازی"] {
    background: #ede9fe;
    color: #6d28d9 !important;
}

.order-status[data-status="ارسال شده"] {
    background: #dbeafe;
    color: #1d4ed8 !important;
}

.order-status[data-status="تکمیل شده"] {
    background: #dcfce7;
    color: #15803d !important;
}

.order-status[data-status="لغو شده"] {
    background: #fee2e2;
    color: #b91c1c !important;
}

.order-payment-status {
    padding: 6px 10px;
    border-radius: 7px;
    font-size: 10px !important;
    font-weight: 600;
}

.order-payment-status.paid {
    background: #f0fdf4;
    color: #15803d !important;
}

.order-payment-status.unpaid {
    background: #fff7ed;
    color: #c2410c !important;
}


/* ================= پنل مدیریت ================= */

.admin-order-status[data-status="پرداخت نشده"] {
    background: #fef3c7 !important;
    color: #b45309 !important;
}

.order-status-locked {
    flex: 1 1 auto;
    align-self: center;
    background: #fffbeb;
    border: 1px dashed #f59e0b;
    color: #92400e;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 11.5px;
    line-height: 1.9;
}

.admin-excel-hint {
    flex-basis: 100%;
    width: 100%;
    margin: 6px 0 0;
    padding: 10px 14px;
    border-radius: 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    font-size: 11.5px;
    line-height: 2;
}

/* نوار ابزار صفحه‌ی محصولات مدیریت: عنوان بالا، دکمه‌ها کنار هم */
.admin-page-title:has(#importExcelBtn) {
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
}

.admin-page-title:has(#importExcelBtn) > div:first-child {
    flex-basis: 100%;
    margin-bottom: 4px;
}

.admin-page-title:has(#importExcelBtn) .admin-add-product-btn {
    margin: 0;
    min-height: 40px;
    padding: 8px 16px;
    box-sizing: border-box;
    line-height: 1.6;
}

a.admin-add-product-btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}


/* ================= مودال‌ها ================= */

.address-modal,
.admin-modal,
.change-password-modal,
.edit-profile-modal,
.success-modal {
    overscroll-behavior: contain;
}

.address-modal > div,
.admin-modal-content,
.success-box {
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}


/* ================= ریسپانسیو: تبلت ================= */

@media (max-width: 900px) {

    .header-content {
        gap: 16px;
    }

    .nav {
        gap: 18px;
    }

    .section {
        padding: 50px 0;
    }

    .admin-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .admin-header-actions {
        flex-wrap: wrap;
        gap: 8px;
    }

}


/* ================= ریسپانسیو: موبایل ================= */

@media (max-width: 700px) {

    /* هدر دو ردیفه: لوگو + دکمه‌ها، و زیرش منو (به‌جای مخفی‌شدن منو) */
    .header-content {
        flex-wrap: wrap;
        min-height: auto;
        padding: 10px 0 0;
        row-gap: 6px;
    }

    .header-content .logo {
        order: 1;
        font-size: 20px;
        padding: 3px 12px;
    }

    .header-actions {
        order: 2;
        gap: 8px;
    }

    .header-content .nav {
        order: 3;
        display: flex !important;
        width: 100%;
        justify-content: center;
        gap: 22px;
        overflow-x: auto;
        padding: 6px 0 8px;
        border-top: 1px solid var(--border);
        scrollbar-width: none;
    }

    .header-content .nav::-webkit-scrollbar {
        display: none;
    }

    .header-content .nav a {
        white-space: nowrap;
        font-size: 13px;
    }

    .user-btn,
    .cart-btn,
    .search-btn {
        width: 40px;
        height: 40px;
    }

    .container {
        width: calc(100% - 32px);
    }

    /* کارت‌های محصول: دو ستونه به‌جای یک کارت خیلی بزرگ */
    .products,
    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }

    .product-image {
        height: 140px;
        font-size: 60px;
    }

    .product-info {
        padding: 12px;
    }

    .product-info h3 {
        font-size: 13px;
        line-height: 1.7;
    }

    .product-bottom {
        margin-top: 12px;
        gap: 8px;
        flex-wrap: wrap;
    }

    .price strong {
        font-size: 13px;
    }

    .product-footer-page {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
    }

    .product-footer-page .qty-controls {
        align-self: flex-end;
    }

    .unit-price-hint {
        display: block;
        font-size: 10px !important;
        line-height: 1.8;
    }

    .product-bottom {
        flex-direction: column;
        align-items: stretch !important;
    }

    .product-bottom .price {
        line-height: 1.8;
    }

    .product-bottom .qty-controls,
    .product-bottom > .add-cart {
        justify-content: flex-end;
        align-self: flex-end;
    }

    .add-cart {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }

    .section-header {
        gap: 10px;
    }

    .section h2 {
        font-size: 21px;
    }

    .categories {
        gap: 10px;
    }

    /* فیلتر صفحه‌ی محصولات: جمع‌شونده */
    .filter-sidebar.is-collapsible .filter-group {
        display: none;
    }

    .filter-sidebar.is-collapsible.is-open .filter-group {
        display: block;
    }

    .filter-sidebar.is-collapsible .filter-header {
        border-bottom: 0;
        padding-bottom: 0;
    }

    .filter-sidebar.is-collapsible.is-open .filter-header {
        border-bottom: 1px solid var(--border);
        padding-bottom: 15px;
    }

    .filter-toggle-btn {
        border: 1px solid var(--primary) !important;
        color: var(--primary) !important;
        background: #fff !important;
        border-radius: 8px;
        padding: 5px 12px !important;
        font-size: 11px !important;
    }

    .brands-list {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        padding-bottom: 6px;
    }

    .brands-list > * {
        flex-shrink: 0;
    }

    .products-page {
        padding: 30px 0;
    }

    .products-hero {
        padding: 36px 0;
    }

    /* پنل کاربری: منو به‌صورت نوار افقی قابل اسکرول */
    .profile-layout {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .profile-sidebar {
        position: static !important;
    }

    .profile-menu {
        flex-direction: row !important;
        overflow-x: auto;
        scrollbar-width: none;
        border-top: 1px solid var(--border);
    }

    .profile-menu::-webkit-scrollbar {
        display: none;
    }

    .profile-menu .profile-tab,
    .profile-menu .logout-btn {
        width: auto !important;
        flex-shrink: 0;
        white-space: nowrap;
        padding: 13px 14px !important;
        text-align: center;
    }

    .profile-menu .profile-tab.active {
        box-shadow: inset 0 -3px 0 var(--primary);
    }

    .profile-header h1 {
        font-size: 26px;
    }

    .profile-page {
        padding: 30px 0 !important;
    }

    .order-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .order-search-box {
        flex-basis: auto;
    }

    .order-status-filter {
        justify-content: space-between;
    }

    .order-status-filter select {
        flex: 1;
        min-width: 0;
    }

    .order-buttons > button {
        flex: 1 1 auto;
    }

    .inactive-account-notice {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .inactive-account-icon {
        margin: 0 auto;
    }

    .inactive-account-btn {
        width: 100%;
    }

    /* پنل مدیریت */
    .admin-header {
        padding: 14px 16px !important;
        flex-direction: column;
        align-items: stretch !important;
    }

    .admin-logo {
        justify-content: space-between;
    }

    .admin-header-actions {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px !important;
        width: 100%;
    }

    .admin-header-actions > a,
    .admin-header-actions > button {
        width: 100%;
        margin: 0 !important;
        text-align: center;
        justify-content: center;
        white-space: normal;
        font-size: 12px !important;
        padding: 10px 8px !important;
        line-height: 1.6;
    }

    .admin-stats,
    .admin-customer-statistics {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .admin-stat-card,
    .admin-customer-stat-card {
        padding: 14px !important;
        gap: 10px !important;
        min-width: 0;
    }

    .admin-stat-card span {
        font-size: 24px !important;
    }

    .admin-page-title {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .admin-page-title .admin-add-product-btn {
        width: 100%;
        margin: 0 !important;
    }

    .admin-order-actions,
    .order-status-actions {
        flex-wrap: wrap;
        gap: 8px;
    }

    .order-status-actions select,
    .order-status-actions button {
        flex: 1 1 auto;
        min-height: 0;
        height: auto;
    }

    .admin-modal-content {
        width: calc(100% - 24px) !important;
        padding: 18px !important;
    }

    /* جدول‌ها روی موبایل اسکرول افقی بگیرن نه کل صفحه */
    table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
    }

    /* فوتر */
    .footer {
        padding-top: 40px;
    }

    .footer-content {
        gap: 26px;
        padding-bottom: 30px;
    }

    .footer-brand p {
        max-width: none;
    }

    /* فرم‌ها: جلوگیری از زوم خودکار iOS روی فیلدها */
    input,
    select,
    textarea {
        font-size: 16px !important;
    }

}


@media (max-width: 360px) {

    .products,
    .products-grid {
        grid-template-columns: 1fr !important;
    }

    .admin-stats,
    .admin-customer-statistics,
    .admin-header-actions {
        grid-template-columns: 1fr !important;
    }

    .header-content .logo {
        font-size: 18px;
    }

}


/* =====================================================
   به‌روزرسانی ۳: منوی کشویی برندها، نوار متحرک برندها و
   دسته‌بندی‌ها، فوتر جدید، روش‌های پرداخت، عکس برند/دسته‌بندی
===================================================== */

/* ---------- لوگوی برند (عکس یا حرف اول) ---------- */

.brand-logo {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
    box-sizing: border-box;
}

.brand-logo.is-placeholder {
    background: linear-gradient(135deg, #dcfce7, #f0fdf4);
    color: var(--primary-dark);
    font-size: 24px;
    font-weight: 800;
}

.brand-logo.small {
    width: 38px;
    height: 38px;
    border-radius: 10px;
}

.brand-logo.small.is-placeholder {
    font-size: 16px;
}


/* ---------- منوی کشویی «محصولات» در هدر ---------- */

.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.nav-caret {
    font-size: 10px;
    transition: transform 0.2s;
}

.nav-dropdown.is-open .nav-caret {
    transform: rotate(180deg);
}

.nav-dropdown.is-open > .nav-dropdown-toggle {
    color: var(--primary);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 50%;
    transform: translate(50%, 8px);
    padding-top: 14px; /* پل نامرئی بین لینک و منو تا با حرکت ماوس بسته نشه */
    width: 420px;
    max-width: calc(100vw - 32px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    z-index: 200;
}

.nav-dropdown.is-open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(50%, 0);
}

.nav-dropdown-inner {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.12);
    padding: 14px;
}

.nav-dropdown-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    padding: 0 6px 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.nav-brands-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    max-height: min(360px, 60vh);
    overflow-y: auto;
}

.nav-brand-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border-radius: 10px;
    color: var(--dark) !important;
    font-size: 13px !important;
    transition: background 0.15s;
}

.nav-brand-item:hover,
.nav-brand-item:focus-visible {
    background: var(--light);
    color: var(--primary) !important;
}

.nav-brand-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-brands-loading {
    grid-column: 1 / -1;
    padding: 10px;
    font-size: 12px;
    color: var(--muted);
}

.nav-dropdown-all {
    display: block;
    margin-top: 10px;
    padding: 9px;
    text-align: center;
    border-radius: 10px;
    background: #f0fdf4;
    color: var(--primary) !important;
    font-size: 12px !important;
    font-weight: 700;
}

.nav-dropdown-all:hover {
    background: #dcfce7;
}


/* ---------- نوار متحرک (برندها و دسته‌بندی‌ها) ---------- */

.marquee {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.marquee-track {
    display: flex;
    gap: 16px;
    width: max-content;
    margin: 0 auto;
    padding: 6px 0 10px;
}

.marquee.is-moving {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}

.marquee.is-moving {
    direction: ltr; /* برای محاسبه‌ی ساده‌ی حرکت؛ محتوای هر کارت راست‌به‌چپ می‌مونه */
}

.marquee.is-moving .marquee-track > * {
    direction: rtl;
}

.marquee.is-moving .marquee-track {
    margin: 0;
    animation: marquee-scroll linear infinite;
}

/* با رفتن ماوس (یا فوکوس کیبورد) روی نوار، حرکت متوقف می‌شه */
.marquee.is-moving:hover .marquee-track,
.marquee.is-moving:focus-within .marquee-track {
    animation-play-state: paused;
}

/* در صفحه‌ی راست‌به‌چپ، نوار از چپ به راست حرکت می‌کنه */
@keyframes marquee-scroll {
    from { transform: translateX(calc(-1 * var(--marquee-distance, 50%))); }
    to { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {

    .marquee.is-moving .marquee-track {
        animation-duration: 120s !important;
    }

}


/* ---------- دسته‌بندی‌های صفحه اصلی ---------- */

.categories.categories-row {
    display: block;
}

.categories-row .category-card {
    flex: 0 0 150px;
    width: 150px;
    background: #fff;
}

.categories-row .category-card:hover {
    transform: translateY(-3px);
}

.category-icon {
    overflow: hidden;
}

.category-icon img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.category-icon.has-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* ---------- برندهای صفحه اصلی ---------- */

.brands-section {
    background: #fafafa;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.brand-card {
    flex: 0 0 150px;
    width: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 10px 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.brand-card .brand-logo {
    width: 84px;
    height: 84px;
    border: 0;
    background: var(--light);
}

.brand-card:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 25px rgba(22, 163, 74, 0.12);
    transform: translateY(-3px);
}

.brand-card-name {
    color: var(--dark);
    font-size: 13px;
    font-weight: 700;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ---------- فوتر: همه‌ی بخش‌ها در یک ردیف و با بوردر سفید ---------- */

.footer-content {
    grid-template-columns: 1.4fr repeat(4, minmax(0, 1fr)) !important;
    gap: 16px !important;
    align-items: stretch;
}

.footer-brand,
.footer-column {
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 16px;
    padding: 20px 18px;
    min-width: 0;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-column h3 {
    color: #fff;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.social-link img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

/* اگه فایل لوگو هنوز در assets/social قرار نگرفته، فقط یک آیکون ساده نمایش داده می‌شه (بدون اسم) */
.social-link.is-missing {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.social-link.is-missing img {
    display: none;
}

.social-link.is-missing::before {
    content: "";
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
}

a.social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

span.social-link {
    cursor: default;
}

@media (max-width: 1000px) {

    .footer-content {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .footer-brand,
    .footer-social {
        grid-column: 1 / -1;
    }

}

@media (max-width: 480px) {

    .footer-content {
        grid-template-columns: 1fr !important;
    }

}


/* ---------- تکمیل سفارش: دو روش پرداخت ---------- */

.payment-methods {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.payment-methods-title {
    color: var(--dark);
    font-size: 14px;
    margin-bottom: 12px;
}

.payment-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.payment-buttons .submit-order {
    width: 100%;
    margin: 0 !important;
}

.payment-buttons .pay-wallet-btn {
    background: #fff;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.payment-buttons .pay-wallet-btn:hover:not(:disabled) {
    background: #f0fdf4;
}

.payment-wallet-info {
    margin-top: 10px;
    font-size: 12px;
    color: var(--muted);
    line-height: 2;
}

@media (max-width: 520px) {

    .payment-buttons {
        grid-template-columns: 1fr;
    }

}


/* ---------- فرم محصول مدیریت: عکس برند و دسته‌بندی ---------- */

.form-optional {
    color: var(--muted);
    font-weight: 400;
    font-size: 10.5px;
}

.image-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.image-input-row input[type="file"] {
    flex: 1;
    min-width: 0;
}

.form-image-preview {
    width: 46px;
    height: 46px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    flex-shrink: 0;
}


/* ---------- موبایل: منوی کشویی تمام‌عرض زیر هدر ---------- */

@media (max-width: 700px) {

    .header-content .nav {
        overflow: visible;
    }

    .nav-dropdown {
        position: static;
    }

    .nav-dropdown-menu {
        right: 16px;
        left: 16px;
        width: auto;
        max-width: none;
        transform: translateY(8px);
        padding-top: 6px;
    }

    .nav-dropdown.is-open .nav-dropdown-menu {
        transform: translateY(0);
    }

    .categories-row .category-card,
    .brand-card {
        flex-basis: 120px;
        width: 120px;
    }

    .brand-card .brand-logo {
        width: 64px;
        height: 64px;
    }

    .marquee-track {
        gap: 10px;
    }

}


/* اصلاحات جزئی */
.view-all {
    white-space: nowrap;
}

#productModal .admin-modal-close {
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* =====================================================
   صفحه‌های اطلاعاتی (درباره ما، تماس، قوانین، حریم خصوصی)
===================================================== */

.info-hero {
    background: linear-gradient(135deg, #ecfdf5, #f7fee7);
    padding: 50px 0 40px;
    text-align: center;
}

.info-hero h1 {
    color: var(--dark);
    font-size: 32px;
    margin: 8px 0;
}

.info-hero p {
    color: var(--muted);
    font-size: 14px;
}

.info-page {
    padding: 40px 0 70px;
}

.info-container {
    max-width: 860px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 28px 30px;
}

.info-card h2 {
    color: var(--dark);
    font-size: 17px;
    margin: 22px 0 10px;
}

.info-card h2:first-child {
    margin-top: 0;
}

.info-card p,
.info-list li {
    color: var(--text);
    font-size: 14px;
    line-height: 2.2;
}

.info-card a:not(.hero-button):not(.info-secondary-btn) {
    color: var(--primary);
    font-weight: 600;
}

.info-list {
    padding-right: 20px;
}

.info-list li::marker {
    color: var(--primary);
}

/* متن‌هایی که صاحب فروشگاه باید قبل از راه‌اندازی تکمیل کند */
.fill-in {
    background: #fef9c3;
    border: 1px dashed #eab308;
    border-radius: 6px;
    padding: 1px 6px;
    color: #854d0e;
}

.info-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.info-actions .hero-button {
    margin-top: 0;
}

.info-secondary-btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 10px;
    border: 1px solid var(--primary);
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
}

.info-secondary-btn:hover {
    background: #f0fdf4;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.contact-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px 16px;
    text-align: center;
    transition: border-color 0.2s, transform 0.2s;
}

.contact-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
}

.contact-icon {
    font-size: 30px;
}

.contact-card h3 {
    color: var(--dark);
    font-size: 15px;
    margin: 6px 0 2px;
}

.contact-card p {
    color: var(--muted);
    font-size: 12.5px;
}

.footer-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.footer-trust:empty {
    display: none;
}

.footer-trust img {
    max-height: 90px;
    background: #fff;
    border-radius: 10px;
    padding: 4px;
}

.auth-terms-note,
.payment-terms-note {
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 12px;
    line-height: 2;
    text-align: center;
}

.auth-terms-note a,
.payment-terms-note a {
    color: var(--primary);
    font-weight: 600;
}

.payment-terms-note {
    text-align: right;
    margin: 10px 0 0;
}

@media (max-width: 700px) {

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .info-card {
        padding: 20px 18px;
    }

    .info-hero h1 {
        font-size: 26px;
    }

}


/* دکمه‌ی فاکتور در سفارش‌ها */
.invoice-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 15px;
    border: 1px solid #94a3b8;
    background: #fff;
    color: #334155 !important;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    transition: 0.2s;
}

.invoice-btn:hover {
    background: #f1f5f9;
}

.order-buttons .invoice-btn,
.admin-order-actions .invoice-btn {
    margin: 15px 0 0;
}

.admin-order-actions .invoice-btn {
    margin: 0;
}

.reorder-btn {
    margin-top: 15px;
    border: 1px solid #0ea5e9;
    background: #f0f9ff;
    color: #0369a1;
    padding: 8px 14px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.reorder-btn:hover {
    background: #0ea5e9;
    color: #fff;
}

.order-buttons .reorder-btn {
    margin: 15px 0 0;
}


/* =====================================================
   تخفیف‌ها
===================================================== */

.bulk-discount-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 8px;
    border-radius: 7px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.7;
}

.cart-line-discount,
.checkout-line-discount {
    color: #c2410c;
    font-size: 11.5px;
    font-weight: 700;
    margin-top: 4px;
    display: block;
}

.discount-row strong {
    color: #c2410c !important;
}

.coupon-box {
    margin: 14px 0 6px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
}

.coupon-box label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
}

.coupon-input-row {
    display: flex;
    gap: 8px;
}

.coupon-input-row input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 12px;
    font-family: inherit;
    font-size: 13px;
    outline: 0;
    text-transform: uppercase;
}

.coupon-input-row input:focus {
    border-color: var(--primary);
}

.coupon-input-row button {
    border: 1px solid var(--primary);
    background: #fff;
    color: var(--primary);
    border-radius: 10px;
    padding: 0 16px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
}

.coupon-input-row button:hover {
    background: #f0fdf4;
}

.coupon-message {
    font-size: 11.5px;
    margin-top: 6px;
    color: #15803d;
    min-height: 1em;
}

.coupon-message.error {
    color: #dc2626;
}

.bulk-discount-inputs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
}

.bulk-discount-inputs input {
    width: 90px !important;
    flex: 0 0 auto;
}


/* ---------- صفحه‌های مدیریت جدید (کدهای تخفیف، گزارش‌ها) ---------- */

.admin-panel-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
    margin-top: 20px;
}

.admin-panel-card h3 {
    color: var(--dark);
    font-size: 15px;
    margin-bottom: 14px;
}

.coupon-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.coupon-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
}

.coupon-form label.wide {
    grid-column: span 3;
}

.coupon-form input,
.coupon-form select {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 11px;
    font-family: inherit;
    font-size: 13px;
    outline: 0;
    background: #fff;
}

.coupon-form input:focus,
.coupon-form select:focus {
    border-color: var(--primary);
}

.coupon-form .admin-add-product-btn {
    margin: 0;
    height: 42px;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    display: table !important;
}

.admin-table th,
.admin-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
    text-align: right;
    white-space: nowrap;
}

.admin-table th {
    color: var(--muted);
    font-weight: 600;
    background: #f9fafb;
}

.admin-table td small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    white-space: normal;
}

.coupon-status {
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: #f3f4f6;
    color: #6b7280;
}

.coupon-status.active {
    background: #dcfce7;
    color: #15803d;
}

.coupon-actions button + button {
    margin-right: 6px;
}

.coupon-toggle-btn,
.coupon-delete-btn {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 8px;
    padding: 5px 10px;
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
}

.coupon-toggle-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.coupon-delete-btn {
    color: #dc2626;
}

.coupon-delete-btn:hover {
    background: #fef2f2;
    border-color: #fecaca;
}

@media (max-width: 900px) {

    .coupon-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .coupon-form label.wide {
        grid-column: span 2;
    }

}

@media (max-width: 520px) {

    .coupon-form {
        grid-template-columns: 1fr;
    }

    .coupon-form label.wide {
        grid-column: auto;
    }

    .admin-panel-card {
        padding: 16px;
    }

}

.low-stock-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 8px;
    border-radius: 7px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 10.5px;
    font-weight: 700;
}


/* =====================================================
   گزارش فروش
===================================================== */

.report-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}

.report-toolbar .admin-add-product-btn {
    margin: 0;
}

.report-periods {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.report-period {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    border-radius: 999px;
    padding: 7px 14px;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
}

.report-period:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.report-period.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.report-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.report-stat {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.report-stat span {
    color: var(--muted);
    font-size: 12px;
}

.report-stat strong {
    color: var(--dark);
    font-size: 18px;
}

.report-stat.main strong {
    color: var(--primary-dark);
    font-size: 22px;
}

.report-empty {
    color: var(--muted);
    font-size: 13px;
    padding: 20px 0;
    text-align: center;
    grid-column: 1 / -1;
}

.report-chart {
    position: relative;
    padding-top: 22px;
}

.chart-axis-max {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 10.5px;
    color: var(--muted);
}

.chart-bars {
    display: flex;
    align-items: stretch;
    gap: 2px;
    height: 220px;
    border-bottom: 1px solid #d1d5db;
    background-image: linear-gradient(to top, #f1f5f1 1px, transparent 1px);
    background-size: 100% 25%;
    direction: ltr; /* روزها از چپ به راست، مثل محور زمان */
}

.chart-bar-slot {
    flex: 1 1 0;
    min-width: 4px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
    cursor: pointer;
    outline: none;
}

.chart-bar {
    background: #16a34a;
    border-radius: 4px 4px 0 0;
    max-width: 36px;
    width: 100%;
    margin: 0 auto;
    transition: background 0.15s;
}

.chart-bar-slot.hover .chart-bar,
.chart-bar-slot:focus-visible .chart-bar {
    background: #15803d;
}

.chart-bar-label {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 4px;
    font-size: 10px;
    color: var(--muted);
    white-space: nowrap;
}

.report-chart {
    padding-bottom: 26px;
}

.chart-tooltip {
    position: absolute;
    z-index: 500;
    background: #172018;
    color: #fff;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    pointer-events: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.chart-tooltip[hidden] {
    display: none;
}

.report-table-toggle {
    margin-top: 10px;
}

.report-table-toggle summary {
    cursor: pointer;
    color: var(--primary);
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 8px;
}

.report-note {
    color: var(--muted);
    font-size: 11.5px;
    margin: 14px 0 30px;
}

@media (max-width: 700px) {

    .report-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chart-bars {
        height: 170px;
    }

    .report-toolbar .admin-add-product-btn {
        width: 100%;
    }

}


/* اعلان سفارش جدید در پنل مدیریت */
.admin-order-toast {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9000;
    background: #172018;
    color: #fff !important;
    border-radius: 14px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    opacity: 0;
    transition: 0.3s;
    max-width: calc(100vw - 40px);
}

.admin-order-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.admin-order-toast strong {
    font-size: 14px;
}

.admin-order-toast span {
    font-size: 12px;
    color: #cbd5ce;
}

.admin-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-right: 6px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
}


/* کد کالا */
.admin-product-code {
    display: inline-block;
    font-size: 11px;
    color: #475569;
    background: #f1f5f9;
    border-radius: 6px;
    padding: 1px 8px;
    margin: 2px 0 4px;
    font-family: monospace;
}

.product-code-hint {
    display: block;
    font-size: 11.5px;
    margin-top: 4px;
    min-height: 0;
}

.product-code-hint.info {
    color: #0369a1;
}

.product-code-hint.error {
    color: #dc2626;
}

.product-code-line {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 6px;
}


/* =====================================================
   فوتر (نسخه‌ی جدید): برند در بالا با عرض کامل، بقیه‌ی بخش‌ها زیر آن
===================================================== */

.footer .footer-content {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 16px !important;
}

.footer .footer-brand {
    grid-column: 1 / -1 !important;
    flex-direction: row;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.footer .footer-brand p {
    margin-top: 0;
    max-width: none;
    font-size: 13px;
}

.footer-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 0;
}

.footer-trust:empty {
    display: none;
}

/* جایگاه خالی نماد (تا وقتی کد نماد جایگزینش نشده) */
.trust-slot {
    width: 92px;
    height: 92px;
    border: 1px dashed rgba(255, 255, 255, 0.45);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px;
    font-size: 10px;
    line-height: 1.7;
    color: #9ca3af;
}

.footer-trust img {
    max-height: 92px;
    background: #fff;
    border-radius: 12px;
    padding: 4px;
}

@media (max-width: 900px) {

    .footer .footer-content {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .footer .footer-brand,
    .footer .footer-social {
        grid-column: auto;
    }

    .footer .footer-brand {
        grid-column: 1 / -1 !important;
    }

}

@media (max-width: 480px) {

    .footer .footer-content {
        grid-template-columns: 1fr !important;
    }

    .footer .footer-brand {
        flex-direction: column;
        align-items: flex-start;
    }

}

.footer .footer-content > .footer-social {
    grid-column: auto !important;
}


.must-change-password-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #fef2f2;
    border-bottom: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px 6%;
    font-size: 13px;
    font-weight: 600;
}

.must-change-password-banner button {
    border: 0;
    background: #dc2626;
    color: #fff;
    border-radius: 10px;
    padding: 8px 16px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
}

.logout-all-btn {
    color: #b91c1c !important;
    border-color: #fecaca !important;
}


/* مدیران کمکی */
.team-form .wide {
    grid-column: 1 / -1;
}

.team-permissions {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
}

.team-permissions legend {
    padding: 0 6px;
    font-size: 12px;
    color: var(--muted);
}

#teamPermissions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 16px;
}

.team-permission {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 8px !important;
    font-size: 12.5px;
    color: var(--text) !important;
    cursor: pointer;
}

.team-permission input {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

.team-form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.team-chips-cell {
    white-space: normal !important;
    max-width: 320px;
}

.team-chip {
    display: inline-block;
    margin: 2px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f0fdf4;
    color: #166534;
    font-size: 11px;
}

.admin-staff-name {
    display: block;
    font-size: 11px;
    color: var(--muted);
}

body.no-perm-customers .admin-customer-status-select {
    display: none !important;
}

@media (max-width: 600px) {

    #teamPermissions {
        grid-template-columns: 1fr;
    }

}

[hidden] {
    display: none !important;
}


/* دکمه‌ی «نمایش بیشتر» در لیست‌های طولانی */
.load-more-btn {
    display: block;
    width: 100%;
    grid-column: 1 / -1;
    margin: 14px 0 4px;
    padding: 12px;
    border: 1px dashed var(--primary);
    border-radius: 12px;
    background: #f0fdf4;
    color: var(--primary-dark);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.load-more-btn:hover {
    background: #dcfce7;
}


/* وضعیت سیستم */
.system-checks {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.system-checks li {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
    background: #f9fafb;
}

.system-checks li strong {
    min-width: 170px;
    color: var(--dark);
}

.system-checks li span:last-child {
    color: var(--muted);
}

.system-check-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
}

.system-checks li.ok .system-check-icon {
    background: #dcfce7;
    color: #15803d;
}

.system-checks li.bad .system-check-icon {
    background: #fee2e2;
    color: #dc2626;
}

.system-log-toolbar input {
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 12px;
    font-family: inherit;
    font-size: 13px;
    margin-bottom: 12px;
    outline: 0;
}

.log-details {
    white-space: normal !important;
    max-width: 420px;
    color: var(--muted);
    font-size: 12px;
}

.system-errors {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 420px;
    overflow-y: auto;
}

.system-error {
    border-radius: 10px;
    padding: 8px 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
}

.system-error.error {
    background: #fef2f2;
    border-color: #fecaca;
}

.system-error small {
    color: var(--muted);
    font-size: 11px;
}

.system-error pre {
    white-space: pre-wrap;
    word-break: break-word;
    unicode-bidi: plaintext;
    text-align: start;
    font-size: 11.5px;
    margin: 4px 0 0;
    font-family: monospace;
}


/* =====================================================
   برداشت از کیف پول و درخواست‌ها
===================================================== */

.wallet-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.add-address-btn.secondary-btn {
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.add-address-btn.secondary-btn:hover {
    background: #f0fdf4;
}

.wallet-transaction-item:has(.transaction-status-badge.rejected) .wallet-transaction-amount {
    text-decoration: line-through;
    opacity: 0.55;
}

.requests-box {
    margin-top: 26px;
}

.requests-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.request-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    background: #fff;
}

.request-item[data-status="pending"] {
    border-color: #fcd34d;
    background: #fffdf5;
}

.request-main,
.request-side {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.request-side {
    align-items: flex-end;
    text-align: left;
    flex-shrink: 0;
}

.request-main strong {
    font-size: 13px;
    color: var(--dark);
}

.request-main span,
.request-amount {
    font-size: 11.5px;
    color: var(--muted);
    line-height: 1.9;
    overflow-wrap: anywhere;
}

.request-amount b {
    color: var(--dark);
}

.request-note {
    color: #0f5132 !important;
    background: #f0fdf4;
    border-radius: 8px;
    padding: 4px 8px;
}

.request-item[data-status="rejected"] .request-note {
    color: #9b1c1c !important;
    background: #fef2f2;
}

.request-status {
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    background: #f3f4f6;
    color: #374151;
    white-space: nowrap;
}

.request-status.pending { background: #fff7e6; color: #a86b00; }
.request-status.approved { background: #e6f7ee; color: #1a7f4e; }
.request-status.rejected { background: #fdecec; color: #c62828; }
.request-status.cancelled { background: #f3f4f6; color: #6b7280; }

.request-cancel-btn {
    border: 1px solid #fca5a5;
    background: #fff;
    color: #b91c1c;
    border-radius: 8px;
    padding: 5px 12px;
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
}

.request-cancel-btn:hover {
    background: #fef2f2;
}

.modal-hint {
    font-size: 12px;
    color: var(--muted);
    line-height: 2;
    margin: -6px 0 16px;
}

.field-hint {
    display: block;
    font-size: 11px;
    color: var(--muted);
    margin-top: 6px;
    line-height: 1.8;
}

.field-hint.is-error { color: #c62828; }
.field-hint.is-ok { color: #1a7f4e; }

.sheba-input {
    display: flex;
    direction: ltr;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.sheba-input:focus-within {
    border-color: var(--primary);
}

.sheba-input span {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: #f3f4f6;
    font-weight: 700;
    color: #374151;
    font-size: 13px;
    border-left: 1px solid var(--border);
}

.auth-group .sheba-input input {
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0;
    letter-spacing: 0.5px;
    flex: 1;
    min-width: 0;
}

.address-modal-box {
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.return-modal-box {
    max-width: 560px;
}

.return-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.return-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    cursor: default;
}

.return-item.is-disabled {
    opacity: 0.5;
}

.return-item-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.return-item-name strong {
    font-size: 12.5px;
    color: var(--dark);
}

.return-item-name small,
.return-item-qty small {
    font-size: 10.5px;
    color: var(--muted);
}

.return-item-qty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.return-item-qty input {
    width: 70px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px;
    font-family: inherit;
    font-size: 13px;
}

.return-estimate {
    font-size: 12px;
    color: #0f5132;
    background: #f0fdf4;
    border-radius: 10px;
    padding: 8px 12px;
    margin: 0 0 14px;
    line-height: 1.9;
}

.return-order-btn {
    margin: 15px 0 0;
    border: 1px solid #a78bfa;
    background: #f5f3ff;
    color: #5b21b6;
    padding: 8px 14px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.return-order-btn:hover {
    background: #7c3aed;
    color: #fff;
}

body.account-inactive .return-order-btn {
    display: none;
}

@media (max-width: 560px) {

    .request-item {
        flex-direction: column;
    }

    .request-side {
        align-items: flex-start;
        text-align: right;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }

    .wallet-actions {
        width: 100%;
    }

    .wallet-actions .add-address-btn {
        flex: 1;
    }
}


/* =====================================================
   لیست خرید ثابت
===================================================== */

.favorites-hint {
    font-size: 12px;
    color: var(--muted);
    line-height: 2;
    margin: -4px 0 16px;
}

.favorites-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.favorite-item {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
}

.favorite-item.is-out {
    background: #fafafa;
}

.favorite-thumb {
    width: 58px;
    height: 58px;
    border-radius: 10px;
    background: #f8faf8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
    overflow: hidden;
}

.favorite-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.favorite-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.favorite-info strong {
    font-size: 13px;
    color: var(--dark);
}

.favorite-info small {
    font-size: 11px;
    color: var(--muted);
}

.favorite-price {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-dark, #15803d);
}

.favorite-out {
    color: #c62828;
    font-weight: 600;
}

.favorite-controls {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.favorite-controls label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 10.5px;
    color: var(--muted);
}

.favorite-qty {
    width: 76px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px;
    font-family: inherit;
    font-size: 13px;
}

.favorite-remove {
    border: 1px solid #fca5a5;
    background: #fff;
    color: #b91c1c;
    border-radius: 8px;
    padding: 7px 12px;
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
}

.favorites-browse-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 560px) {

    .favorite-item {
        flex-wrap: wrap;
    }

    .favorite-controls {
        width: 100%;
        justify-content: space-between;
    }
}

/* دکمه‌ی ستاره روی کارت و صفحه‌ی محصول */
.fav-btn {
    font-family: inherit;
    cursor: pointer;
    border: 1px solid var(--border, #e5e7eb);
    background: #fff;
    color: #6b7280;
    transition: 0.2s;
}

.fav-btn.is-active {
    color: #d97706;
    border-color: #fcd34d;
    background: #fffbeb;
}

.fav-btn.on-card {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.fav-btn.on-card .fav-icon {
    font-size: 17px;
    line-height: 1;
}

.fav-btn.on-card .fav-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.fav-btn.on-card:hover {
    color: #d97706;
    transform: scale(1.06);
}

.product-actions {
    flex-wrap: wrap;
}

.fav-btn.on-detail {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 52px;
    padding: 0 18px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    flex: 0 1 auto;
}

@media (max-width: 520px) {

    .fav-btn.on-detail {
        flex-basis: 100%;
    }
}

.fav-btn.on-detail .fav-icon {
    font-size: 17px;
}

.fav-btn.on-detail:hover {
    border-color: #fcd34d;
    color: #b45309;
}

.favorite-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translate(-50%, 20px);
    background: #172018;
    color: #fff;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: 0.2s;
    z-index: 99999;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.favorite-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}


/* =====================================================
   پنل مدیریت: برداشت و مرجوعی
===================================================== */

.requests-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.requests-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.requests-tab {
    border: 1px solid var(--border, #e5e7eb);
    background: #fff;
    color: #374151;
    border-radius: 10px;
    padding: 8px 14px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.requests-tab.active {
    background: var(--primary, #16a34a);
    border-color: var(--primary, #16a34a);
    color: #fff;
}

.tab-count {
    background: #ef4444;
    color: #fff;
    border-radius: 20px;
    font-size: 10px;
    min-width: 18px;
    padding: 0 5px;
    line-height: 18px;
    text-align: center;
}

.requests-filter {
    font-size: 12px;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 6px;
}

.requests-filter select {
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    padding: 7px 10px;
    font-family: inherit;
    font-size: 12px;
    background: #fff;
}

.admin-requests-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.admin-empty {
    text-align: center;
    color: #6b7280;
    font-size: 13px;
    padding: 24px 0;
}

.admin-request-card {
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 14px;
    padding: 14px 16px;
    background: #fff;
}

.admin-request-card[data-status="pending"] {
    border-color: #fcd34d;
    box-shadow: 0 0 0 3px rgba(252, 211, 77, 0.15);
}

.admin-request-card header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.admin-request-card header > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.admin-request-card header strong {
    font-size: 14px;
    color: #172018;
}

.admin-request-card header span {
    font-size: 12px;
    color: #4b5563;
}

.admin-request-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.admin-request-meta small {
    font-size: 11px;
    color: #6b7280;
}

.admin-request-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.admin-request-grid > div {
    background: #f8faf8;
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.admin-request-grid span {
    font-size: 11px;
    color: #6b7280;
}

.admin-request-grid b {
    font-size: 13px;
    color: #172018;
    overflow-wrap: anywhere;
}

.sheba-text {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 12.5px !important;
    letter-spacing: 0.3px;
}

.copy-btn {
    align-self: flex-start;
    border: 1px solid #cbd5e1;
    background: #fff;
    border-radius: 6px;
    padding: 2px 10px;
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
    margin-top: 4px;
}

.admin-request-items {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-bottom: 8px;
}

.admin-request-items th,
.admin-request-items td {
    border: 1px solid #e5e7eb;
    padding: 6px 8px;
    text-align: center;
}

.admin-request-items th {
    background: #f0fdf4;
    color: #166534;
}

.admin-request-items td:first-child {
    text-align: right;
}

.admin-request-items small {
    display: block;
    color: #6b7280;
    font-size: 10.5px;
}

.admin-request-desc {
    font-size: 12px;
    color: #374151;
    margin: 4px 0;
    line-height: 1.9;
}

.admin-request-desc span {
    color: #6b7280;
}

.admin-request-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    border-top: 1px dashed #e5e7eb;
    padding-top: 12px;
    margin-top: 8px;
}

.admin-request-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11.5px;
    color: #374151;
    font-weight: 600;
}

.admin-request-field.wide {
    flex: 1;
    min-width: 220px;
}

.admin-request-field input {
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 13px;
}

.admin-request-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #374151;
    padding-bottom: 8px;
}

.admin-request-buttons {
    display: flex;
    gap: 8px;
}

.approve-request-btn,
.reject-request-btn {
    border-radius: 9px;
    padding: 9px 16px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.approve-request-btn {
    border: 0;
    background: #16a34a;
    color: #fff;
}

.approve-request-btn:hover {
    background: #15803d;
}

.reject-request-btn {
    border: 1px solid #fca5a5;
    background: #fff;
    color: #b91c1c;
}

.reject-request-btn:hover {
    background: #fef2f2;
}

.approve-request-btn:disabled,
.reject-request-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.admin-request-result {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
    color: #4b5563;
    border-top: 1px dashed #e5e7eb;
    padding-top: 8px;
    margin-top: 6px;
}

@media (max-width: 560px) {

    .admin-request-card header {
        flex-direction: column;
    }

    .admin-request-meta {
        align-items: flex-start;
        flex-direction: row;
        gap: 8px;
    }

    .admin-request-buttons {
        width: 100%;
    }

    .admin-request-buttons button {
        flex: 1;
    }
}

.wallet-transaction-item .transaction-info .transaction-status-badge {
    display: inline-block;
    width: fit-content;
}

.sheba-text {
    white-space: nowrap;
}

@media (min-width: 700px) {

    .admin-request-grid > div:has(.sheba-text) {
        grid-column: span 2;
    }
}

@media (max-width: 699px) {

    .sheba-text {
        white-space: normal;
    }
}


/* =====================================================
   پیشنهاد در جستجو
===================================================== */

.search-box.search-suggest-wrapper {
    position: relative;
    overflow: visible;
}

.search-box.search-suggest-wrapper input {
    border-radius: 0 14px 14px 0;
    min-width: 0;
    font-family: inherit;
}

.search-box.search-suggest-wrapper button {
    border-radius: 14px 0 0 14px;
}

.search-box input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
}

.search-suggest-box {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    z-index: 60;
    background: #fff;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(15, 23, 18, 0.14);
    max-height: min(70vh, 460px);
    overflow-y: auto;
    padding: 6px;
    text-align: right;
}

.suggest-title {
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    padding: 8px 10px 4px;
}

.suggest-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    color: #172018;
    text-decoration: none;
    font-size: 13px;
}

.suggest-option:hover,
.suggest-option.is-active {
    background: #f0fdf4;
}

.suggest-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #f8faf8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    overflow: hidden;
}

.suggest-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.suggest-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.suggest-text strong {
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.suggest-text small,
.suggest-chip small {
    font-size: 11px;
    color: #6b7280;
}

.suggest-chip small {
    margin-right: auto;
}

.suggest-price {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-dark, #15803d);
    white-space: nowrap;
}

.suggest-price em {
    font-style: normal;
    color: #c62828;
    font-weight: 600;
}

.suggest-option mark {
    background: #fef08a;
    color: inherit;
    border-radius: 3px;
    padding: 0 1px;
}

.suggest-all {
    justify-content: center;
    color: var(--primary, #16a34a);
    font-weight: 700;
    border-top: 1px solid #f1f5f9;
    margin-top: 4px;
}

.suggest-empty {
    padding: 16px;
    text-align: center;
    font-size: 13px;
    color: #6b7280;
}

@media (max-width: 480px) {

    .suggest-price {
        display: none;
    }
}


/* =====================================================
   پیشنهاد نصب اپلیکیشن
===================================================== */

.pwa-install-chip {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translate(-50%, 30px);
    opacity: 0;
    z-index: 9000;
    width: calc(100% - 32px);
    max-width: 440px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #d1fae5;
    border-radius: 16px;
    padding: 10px 12px;
    box-shadow: 0 16px 40px rgba(15, 23, 18, 0.18);
    font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
    direction: rtl;
    transition: 0.25s ease;
}

.pwa-install-chip.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.pwa-install-chip img {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    flex-shrink: 0;
}

.pwa-install-chip span {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.pwa-install-chip strong {
    font-size: 13px;
    color: #172018;
}

.pwa-install-chip small {
    font-size: 11px;
    color: #6b7280;
}

.pwa-install-btn {
    border: 0;
    background: #16a34a;
    color: #fff;
    border-radius: 10px;
    padding: 8px 18px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.pwa-close-btn {
    border: 0;
    background: transparent;
    color: #9ca3af;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

@media (display-mode: standalone) {

    .pwa-install-chip {
        display: none;
    }
}


/* =====================================================
   روش‌های پرداخت، حداقل سفارش و ارسال
===================================================== */

.payment-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.payment-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1.5px solid var(--border, #e5e7eb);
    border-radius: 14px;
    padding: 12px;
    cursor: pointer;
    background: #fff;
    transition: 0.2s;
    min-width: 0;
}

.payment-option[hidden] {
    display: none !important;
}

.payment-option:hover {
    border-color: #86efac;
}

.payment-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.payment-option.is-selected {
    border-color: var(--primary, #16a34a);
    background: #f0fdf4;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.payment-option.is-selected::after {
    content: "✓";
    position: absolute;
    top: 8px;
    left: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary, #16a34a);
    color: #fff;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.payment-option.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.payment-option-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    flex-shrink: 0;
}

.payment-option.is-selected .payment-option-icon {
    background: #dcfce7;
}

.payment-option-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.payment-option-text strong {
    font-size: 13px;
    color: var(--dark, #172018);
}

.payment-option-text small {
    font-size: 11px;
    color: var(--muted, #6b7280);
    line-height: 1.8;
}

#submitOrderBtn {
    width: 100%;
    margin: 0;
}

@media (max-width: 520px) {

    .payment-options {
        grid-template-columns: 1fr;
    }
}

.order-rules-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
}

.order-rule {
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.9;
}

.order-rule-text {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2px 10px;
}

.order-rule.is-warning {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

.order-rule.is-info {
    background: #eff6ff;
    color: #1e3a8a;
    border: 1px solid #bfdbfe;
}

.order-rule.is-ok {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.order-rule-bar {
    height: 6px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.07);
    margin-top: 6px;
    overflow: hidden;
}

.order-rule-bar i {
    display: block;
    height: 100%;
    border-radius: 6px;
    background: currentColor;
    opacity: 0.6;
    transition: width 0.3s;
}

.checkout-button.is-disabled {
    background: #9ca3af !important;
    cursor: not-allowed;
}


/* =====================================================
   پنجره‌ی پرداخت کارت‌به‌کارت
===================================================== */

body.card-pay-open {
    overflow: hidden;
}

.card-pay-overlay {
    position: fixed;
    inset: 0;
    z-index: 9500;
    background: rgba(15, 23, 18, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.15s;
    direction: rtl;
}

.card-pay-overlay.show {
    opacity: 1;
}

.card-pay-box {
    position: relative;
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 24px 20px 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.card-pay-close {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: #f3f4f6;
    font-size: 20px;
    cursor: pointer;
}

.card-pay-box h2 {
    font-size: 18px;
    margin: 0 0 2px;
    color: #172018;
}

.card-pay-sub {
    font-size: 12px;
    color: #6b7280;
    margin: 0 0 14px;
}

.card-pay-amount {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 12px;
    background: #f0fdf4;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.card-pay-amount span {
    font-size: 12px;
    color: #166534;
}

.card-pay-amount strong {
    font-size: 17px;
    color: #15803d;
    margin-left: auto;
}

.card-pay-card {
    border-radius: 16px;
    padding: 16px;
    color: #fff;
    background: linear-gradient(135deg, #15803d, #0f5132 70%);
    box-shadow: 0 12px 26px rgba(21, 128, 61, 0.3);
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.card-pay-bank {
    font-size: 12px;
    opacity: 0.85;
}

.card-pay-number {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-align: center;
    font-family: ui-monospace, Menlo, Consolas, monospace;
}

.card-pay-holder,
.card-pay-sheba {
    font-size: 12.5px;
    overflow-wrap: anywhere;
}

.card-pay-copy {
    border: 0;
    border-radius: 9px;
    padding: 6px 12px;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    background: #16a34a;
    color: #fff;
}

.card-pay-copy.light {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    align-self: flex-start;
}

.card-pay-copy.small {
    padding: 2px 8px;
    font-size: 10.5px;
}

.card-pay-steps {
    margin: 0 0 14px;
    padding-right: 18px;
    font-size: 12px;
    color: #4b5563;
    line-height: 2;
}

.card-pay-file {
    display: block;
    cursor: pointer;
    margin-bottom: 10px;
}

.card-pay-file-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    border: 2px dashed #86efac;
    border-radius: 14px;
    padding: 14px;
    background: #f8fdf9;
    color: #166534;
    font-size: 13px;
}

.card-pay-file-box small {
    color: #6b7280;
    font-size: 11px;
}

.card-pay-preview {
    display: block;
    max-height: 180px;
    margin: 8px auto 0;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.card-pay-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.card-pay-fields label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 600;
    color: #374151;
}

.card-pay-fields input {
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    padding: 9px 10px;
    font-family: inherit;
    font-size: 13px;
    min-width: 0;
}

.card-pay-submit,
.card-pay-later {
    width: 100%;
    border-radius: 12px;
    padding: 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.card-pay-submit {
    border: 0;
    background: #16a34a;
    color: #fff;
    margin-bottom: 8px;
}

.card-pay-later {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
}

.card-pay-note {
    font-size: 11px;
    color: #6b7280;
    line-height: 1.9;
    margin: 10px 0 0;
    text-align: center;
}

.order-payment-status.waiting {
    background: #fff7e6;
    color: #a86b00;
}

.card-receipt-btn {
    margin: 15px 0 0;
    border: 1px solid #16a34a;
    background: #f0fdf4;
    color: #15803d;
    padding: 8px 14px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.card-receipt-btn:hover {
    background: #16a34a;
    color: #fff;
}

.order-payment-info {
    flex-basis: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin-top: 10px;
    font-size: 11.5px;
    color: #4b5563;
}

.order-payment-rejected {
    color: #b91c1c;
    background: #fef2f2;
    border-radius: 8px;
    padding: 3px 8px;
}


/* =====================================================
   پنل مدیریت: پرداخت‌های منتظر بررسی و ثبت سفارش تلفنی
===================================================== */

.admin-page-title {
    flex-wrap: wrap;
    gap: 12px;
}

.phone-order-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary, #16a34a);
    color: #fff !important;
    border-radius: 11px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(22, 163, 74, 0.25);
}

.phone-order-link:hover {
    background: var(--primary-dark, #15803d);
}

body.no-perm-orders .phone-order-link {
    display: none;
}

.pending-payments {
    border: 1px solid #fcd34d;
    background: #fffdf5;
    margin-bottom: 20px;
}

.pending-payments-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pending-payments-head h3 {
    margin: 0;
}

.pending-payments-head span {
    font-size: 12px;
    color: #a16207;
    font-weight: 700;
}

.pending-payments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.pending-payment-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
}

.pending-payment-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    font-size: 12px;
    color: #4b5563;
}

.pending-payment-main strong {
    font-size: 13px;
    color: #172018;
}

.pending-payment-main .invoice-btn {
    align-self: flex-start;
    margin-top: 6px;
}

.receipt-thumb {
    width: 120px;
    height: 120px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f8fafc;
    padding: 0;
    overflow: hidden;
    cursor: zoom-in;
    font-family: inherit;
    font-size: 11px;
    color: #6b7280;
}

.receipt-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pending-payment-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.payment-note-input {
    flex: 1;
    min-width: 180px;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 12.5px;
}

@media (max-width: 560px) {

    .pending-payment-item {
        grid-template-columns: 1fr;
    }

    .receipt-thumb {
        width: 100%;
        height: 180px;
    }
}

.admin-payment-method {
    display: inline-block;
    font-size: 11px;
    background: #f1f5f9;
    color: #334155;
    border-radius: 7px;
    padding: 4px 9px;
    margin-right: 6px;
}

.card-pay-fields input {
    width: 100%;
    box-sizing: border-box;
}


/* =====================================================
   کارت محصول (طراحی جدید با قیمت مصرف و سود مشتری)
===================================================== */

.product-card-page {
    display: flex;
    flex-direction: column;
    border: 1px solid #e8ece8;
    border-radius: 20px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 18, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.product-card-page:hover {
    transform: translateY(-4px);
    border-color: #bbf7d0;
    box-shadow: 0 18px 40px rgba(15, 23, 18, 0.09);
}

.product-card-page .pc-media {
    position: relative;
    margin: 8px 8px 0;
    border-radius: 15px;
    overflow: hidden;
    background:
        radial-gradient(circle at 70% 25%, rgba(255, 255, 255, 0.9), transparent 55%),
        linear-gradient(160deg, #f1f8f2, #e7f3ea);
}

.product-card-page .product-image-page {
    height: 180px;
    background: transparent;
    font-size: 72px;
}

.product-card-page .product-image-page img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    mix-blend-mode: multiply;
    transition: transform 0.3s ease;
}

.product-card-page:hover .product-image-page img {
    transform: scale(1.04);
}

.product-card-page .cart-qty-badge {
    display: none !important;
}

.pc-badges {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    pointer-events: none;
}

.pc-badge {
    font-size: 10.5px;
    font-weight: 800;
    border-radius: 8px;
    padding: 3px 8px;
    line-height: 1.7;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.pc-badge.is-out {
    background: #475569;
    color: #fff;
}

.pc-badge.is-deal {
    background: #f97316;
    color: #fff;
}

.pc-badge.is-profit {
    background: #fff;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.product-card-page .fav-btn.on-card {
    top: 18px;
    left: 18px;
}

.product-card-page .product-info-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 12px 14px 14px;
}

.pc-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-height: 20px;
}

.product-card-page .product-brand-page {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary, #16a34a);
    background: #f0fdf4;
    border-radius: 6px;
    padding: 1px 7px;
}

.product-card-page .product-brand-page:empty {
    display: none;
}

.pc-code {
    font-size: 10px;
    color: #94a3b8;
    direction: rtl;
    white-space: nowrap;
}

.product-card-page .product-name-page {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.75;
    margin: 6px 0 0;
    min-height: 3.5em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-page .product-carton-page {
    font-size: 11.5px;
    color: #64748b;
    margin: 2px 0 8px;
}

.pc-profit {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    overflow: hidden;
    text-align: center;
}

.pc-profit > div {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 6px 2px;
    min-width: 0;
}

.pc-profit > div + div {
    border-right: 1px dashed #cbd5e1;
}

.pc-profit span {
    font-size: 9.5px;
    color: #64748b;
    white-space: nowrap;
}

.pc-profit b {
    font-size: 12px;
    color: #172018;
}

.pc-profit .pc-profit-gain {
    background: #f0fdf4;
}

.pc-profit .pc-profit-gain b {
    color: #15803d;
}

.pc-profit-note {
    font-size: 11px;
    color: #166534;
    margin: 6px 0 0;
    line-height: 1.8;
}

.pc-unit {
    font-size: 11px;
    color: #64748b;
    margin: 0;
}

.product-card-page .bulk-discount-badge,
.product-card-page .low-stock-badge {
    align-self: flex-start;
    margin-top: 6px;
}

.product-card-page .product-footer-page {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center !important;
    justify-content: space-between;
    gap: 8px;
    flex-direction: row !important;
}

.product-card-page .product-price-page span {
    font-size: 10px;
    color: #94a3b8;
}

.product-card-page .product-price-page strong {
    font-size: 16px;
    font-weight: 900;
    color: #172018;
    white-space: nowrap;
}

.product-card-page .product-price-page strong small {
    font-size: 10.5px;
    font-weight: 600;
    color: #64748b;
}

.pc-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    background: #f0fdf4;
    border-radius: 12px;
    padding: 3px;
    flex-shrink: 0;
}

.pc-stepper .add-cart-page,
.pc-stepper .remove-cart-page {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 20px;
    border: 0;
}

.pc-stepper .remove-cart-page {
    background: #fff;
    color: #15803d;
}

.pc-qty {
    min-width: 28px;
    text-align: center;
    font-weight: 800;
    font-size: 14px;
    color: #15803d;
}

.pc-stepper:not(.has-qty) {
    background: transparent;
    padding: 0;
}

.pc-stepper:not(.has-qty) .remove-cart-page,
.pc-stepper:not(.has-qty) .pc-qty {
    display: none;
}

.pc-stepper:not(.has-qty) .add-cart-page:not(:disabled) {
    width: auto;
    height: 38px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 6px 14px rgba(22, 163, 74, 0.25);
}

.pc-stepper:not(.has-qty) .add-cart-page:not(:disabled)::after {
    content: "افزودن";
}

@media (max-width: 768px) {

    .product-card-page .product-image-page {
        height: 135px;
        font-size: 56px;
    }

    .product-card-page .product-info-page {
        padding: 10px;
    }

    .product-card-page .product-name-page {
        font-size: 12.5px;
    }

    .product-card-page .product-footer-page {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .pc-stepper {
        justify-content: space-between;
    }

    .pc-stepper:not(.has-qty) .add-cart-page:not(:disabled) {
        width: 100%;
        justify-content: center;
    }

    .pc-profit b {
        font-size: 11px;
    }

    .pc-code {
        display: none;
    }
}

.detail-profit {
    margin-top: 18px;
    border: 1px solid #bbf7d0;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.detail-profit-head {
    background: linear-gradient(90deg, #16a34a, #15803d);
    color: #fff;
    font-weight: 800;
    font-size: 13.5px;
    padding: 10px 14px;
}

.detail-profit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-profit-grid > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 14px;
    border-top: 1px solid #f0fdf4;
}

.detail-profit-grid > div:nth-child(even) {
    border-right: 1px solid #f0fdf4;
}

.detail-profit-grid span {
    font-size: 11px;
    color: #64748b;
}

.detail-profit-grid b {
    font-size: 14px;
    color: #172018;
}

.detail-profit-grid .is-gain {
    background: #f0fdf4;
}

.detail-profit-grid .is-gain b {
    color: #15803d;
}

@media (max-width: 768px) {

    .pc-profit span {
        white-space: normal;
        font-size: 9px;
        line-height: 1.5;
    }

    .pc-profit > div {
        padding: 5px 1px;
        justify-content: space-between;
    }

    .pc-profit-note {
        font-size: 10.5px;
    }
}

.home-profit-pill {
    display: inline-block;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #15803d;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 2px 8px;
}


/* «تخفیفات ویژه» (به‌زودی) در منوی بالا */
.nav-soon {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
    color: #9ca3af;
    cursor: default;
    user-select: none;
}

.nav-soon span {
    font-size: 14px;
    font-weight: 500;
}

.nav-soon small {
    font-size: 9.5px;
    color: #b6bcc6;
    margin-top: 1px;
}


/* =====================================================
   سؤالات متداول
===================================================== */

.faq-group + .faq-group {
    margin-top: 26px;
}

.faq-group h2 {
    margin-bottom: 12px;
}

.faq-item {
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 14px;
    background: #fff;
    margin-bottom: 10px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.faq-item[open] {
    border-color: #86efac;
    box-shadow: 0 8px 20px rgba(22, 163, 74, 0.08);
}

.faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 16px;
    font-weight: 700;
    font-size: 14px;
    color: var(--dark, #172018);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    line-height: 1.9;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "+";
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #f0fdf4;
    color: var(--primary, #16a34a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: transform 0.2s;
}

.faq-item[open] summary::after {
    content: "−";
    background: var(--primary, #16a34a);
    color: #fff;
}

.faq-answer {
    padding: 0 16px 16px;
    font-size: 13.5px;
    line-height: 2.2;
    color: #4b5563;
}

.faq-answer a {
    color: var(--primary, #16a34a);
    font-weight: 700;
}

.statement-link {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.pricelist-link {
    margin-right: auto;
    margin-left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--primary, #16a34a);
    color: var(--primary, #16a34a) !important;
    background: #fff;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
}

.pricelist-link:hover {
    background: #f0fdf4;
}

@media (max-width: 500px) {

    .pricelist-link {
        margin: 0;
    }
}


/* =====================================================
   به‌روزرسانی از محک
===================================================== */

.admin-add-product-btn.mahak-btn {
    background: #0f766e;
}

.admin-add-product-btn.mahak-btn:hover {
    background: #115e59;
}

.mahak-box {
    max-width: 760px;
}

.mahak-box h3 {
    font-size: 14px;
    margin: 16px 0 8px;
}

.mahak-text {
    font-size: 13px;
    color: #374151;
    line-height: 2.1;
    margin: 0 0 10px;
}

.mahak-text.small,
.mahak-last {
    font-size: 11.5px;
    color: #6b7280;
}

.mahak-last {
    background: #f8fafc;
    border-radius: 10px;
    padding: 8px 12px;
    line-height: 1.9;
}

.mahak-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 12px 0;
}

.mahak-stats > div {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mahak-stats b {
    font-size: 18px;
}

.mahak-stats span {
    font-size: 11px;
    color: #6b7280;
}

.mahak-stats .is-update b { color: #b45309; }
.mahak-stats .is-new b { color: #0f766e; }

.mahak-table-wrap {
    max-height: 260px;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.mahak-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.mahak-table th,
.mahak-table td {
    padding: 7px 8px;
    border-bottom: 1px solid #f1f5f9;
    text-align: center;
    white-space: nowrap;
}

.mahak-table th {
    position: sticky;
    top: 0;
    background: #f8fafc;
}

.mahak-table td.text-start {
    text-align: right;
    white-space: normal;
}

.mahak-table small {
    display: block;
    color: #94a3b8;
}

.mahak-change s {
    color: #9ca3af;
}

.mahak-change b {
    color: #b45309;
}

.mahak-same {
    color: #cbd5e1;
}

.mahak-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 14px 0;
    font-size: 12.5px;
}

.mahak-options label {
    display: flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 560px) {

    .mahak-stats,
    .mahak-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mahak-options {
        grid-template-columns: 1fr;
    }
}


/* =====================================================
   ثبت سفارش تلفنی
===================================================== */

.phone-order-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: start;
}

.phone-order-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.phone-order-main .admin-panel-card,
.phone-order-summary {
    margin: 0;
}

.phone-order-page h3 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary, #16a34a);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.po-search input,
.po-grid input,
.po-grid select,
.po-grid textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 13px;
    background: #fff;
}

.po-results {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 8px 0;
}

.po-result {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: right;
    width: 100%;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 10px;
    padding: 8px 10px;
    font-family: inherit;
    cursor: pointer;
}

.po-result:hover:not(:disabled) {
    border-color: #86efac;
    background: #f0fdf4;
}

.po-result:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.po-result > span:nth-child(2) {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.po-result b {
    font-size: 13px;
    color: #172018;
}

.po-result small {
    font-size: 11px;
    color: #6b7280;
}

.po-price {
    font-size: 12px;
    font-weight: 700;
    color: #15803d;
    white-space: nowrap;
}

.po-avatar,
.po-thumb {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: #f1f5f9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    overflow: hidden;
}

.po-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.po-new-customer {
    margin-top: 8px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    padding: 8px 12px;
}

.po-new-customer summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary, #16a34a);
}

.po-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.po-grid label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
}

.po-grid label.wide {
    grid-column: 1 / -1;
}

.po-grid select + textarea {
    margin-top: 6px;
}

.po-hint {
    font-size: 11.5px;
    color: #6b7280;
    line-height: 1.9;
    margin: 6px 0 0;
}

.po-selected {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 10px 12px;
}

.po-selected div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.po-selected small {
    font-size: 11.5px;
    color: #4b5563;
}

.po-change,
.po-remove {
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 8px;
    padding: 6px 10px;
    font-family: inherit;
    font-size: 11.5px;
    cursor: pointer;
}

.po-remove {
    color: #b91c1c;
    border-color: #fecaca;
}

.po-items td {
    vertical-align: middle;
}

.po-item-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.po-item-name > span:last-child {
    display: flex;
    flex-direction: column;
}

.po-item-name small,
.po-line-discount {
    display: block;
    font-size: 10.5px;
    color: #6b7280;
}

.po-line-discount {
    color: #c2410c;
}

.po-qty {
    width: 72px;
    text-align: center;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px;
    font-family: inherit;
}

.po-empty td {
    color: #9ca3af;
    text-align: center;
}

.po-pay-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.po-pay-options label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
}

.po-pay-options label:has(input:checked) {
    border-color: var(--primary, #16a34a);
    background: #f0fdf4;
}

.po-pay-options label:has(input:disabled) {
    opacity: 0.5;
}

.po-pay-options span {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.po-pay-options b {
    font-size: 13px;
}

.po-pay-options small {
    font-size: 11px;
    color: #6b7280;
}

.phone-order-summary {
    position: sticky;
    top: 16px;
}

.po-row,
.po-total {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid #f1f5f9;
}

.po-row.discount b {
    color: #c2410c;
}

.po-total {
    border-bottom: 0;
    font-size: 15px;
}

.po-total b {
    color: #15803d;
}

.po-skip {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #374151;
    margin: 8px 0 12px;
}

.po-submit {
    width: 100%;
    padding: 13px !important;
    font-size: 14px !important;
}

@media (max-width: 900px) {

    .phone-order-layout {
        grid-template-columns: 1fr;
    }

    .phone-order-summary {
        position: static;
    }
}

@media (max-width: 560px) {

    .po-grid,
    .po-pay-options {
        grid-template-columns: 1fr;
    }
}
