/* ================= فروشگاه فایل ================= */
.shop-hero {
    background: linear-gradient(135deg, #f4f8ec 0%, #eef3ff 55%, #fff 100%);
    padding: 3rem 0 2.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, .05);
}

.shop-hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.shop-hero h1 {
    color: var(--sn-dark);
    font-weight: 800;
    font-size: clamp(1.6rem, 2.6vw, 2.4rem);
    margin: .6rem 0 .5rem;
}

.shop-hero p {
    color: var(--sn-text);
    max-width: 560px;
    margin: 0;
    line-height: 2;
}

.shop-hero-badge {
    display: inline-flex;
    align-items: center;
    background: #fff;
    color: var(--sn-primary-dark);
    border: 1px solid var(--sn-primary-light);
    border-radius: 100px;
    padding: .35rem .9rem;
    font-size: .8rem;
    font-weight: 700;
}

.shop-search {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: #fff;
    border-radius: 14px;
    padding: .4rem .4rem .4rem 1rem;
    box-shadow: 0 10px 30px rgba(30, 40, 20, .08);
    min-width: min(100%, 400px);
}

.shop-search > i { color: var(--sn-muted); margin-inline-start: .5rem; }

.shop-search input {
    border: 0;
    outline: 0;
    flex: 1;
    min-width: 0;
    background: transparent;
    padding: .55rem;
    color: var(--sn-dark);
}

.shop-section { padding-top: 2.5rem; }

.shop-categories {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 2rem;
}

.shop-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 1rem;
    border-radius: 100px;
    background: var(--sn-light);
    color: var(--sn-text);
    font-size: .88rem;
    font-weight: 600;
    transition: all .2s ease;
    border: 1px solid transparent;
}

.shop-chip span {
    background: #fff;
    border-radius: 100px;
    padding: 0 .45rem;
    font-size: .75rem;
    color: var(--sn-muted);
}

.shop-chip:hover { color: var(--sn-primary-dark); background: #eaf2dc; }

.shop-chip.active {
    background: var(--sn-primary);
    color: #fff;
    box-shadow: 0 6px 16px rgba(142, 188, 64, .35);
}

.shop-chip.active span { color: var(--sn-primary-dark); }

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.4rem;
}

.shop-card {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .2s ease, box-shadow .2s ease;
}

.shop-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 38px rgba(30, 40, 20, .1);
}

.shop-card-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 160px;
    background: linear-gradient(135deg, #f6f9f0, #eef1f7);
    color: var(--sn-primary-dark);
}

.shop-card-cover img { width: 100%; height: 100%; object-fit: cover; }

.shop-card-icon { font-size: 3rem; line-height: 1; }

.shop-card-icon.lg { font-size: 5rem; }

.shop-card-body {
    padding: 1rem 1.1rem 1.15rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: .45rem;
}

.shop-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    font-size: .75rem;
    color: var(--sn-muted);
}

.shop-kind {
    background: #eef4e2;
    color: var(--sn-primary-dark);
    border-radius: 100px;
    padding: .15rem .6rem;
    font-weight: 700;
}

.shop-cat {
    background: var(--sn-light);
    border-radius: 100px;
    padding: .15rem .6rem;
    color: var(--sn-text);
}

.shop-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.6;
}

.shop-card-title a { color: var(--sn-dark); }
.shop-card-title a:hover { color: var(--sn-primary-dark); }

.shop-card-summary {
    color: var(--sn-text);
    font-size: .85rem;
    line-height: 1.9;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3.2em;
}

.shop-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    padding-top: .6rem;
    border-top: 1px dashed #eee;
}

.shop-price {
    font-weight: 800;
    color: var(--sn-dark);
    direction: rtl;
}

.shop-price small { font-weight: 500; color: var(--sn-muted); font-size: .72em; }

.shop-empty {
    text-align: center;
    padding: 4rem 1rem;
    background: #fafafa;
    border: 1px dashed #e3e3e3;
    border-radius: 20px;
}

.shop-empty > i { font-size: 3.4rem; color: #c9d3bd; }

.shop-empty h3 { color: var(--sn-dark); font-size: 1.2rem; margin: 1rem 0 .5rem; }
.shop-empty p { color: var(--sn-text); margin-bottom: 1.2rem; }

/* ---------- صفحه محصول ---------- */
.shop-detail-section { padding-top: 1.6rem; }

.shop-breadcrumb {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .82rem;
    color: var(--sn-muted);
    margin-bottom: 1.4rem;
}

.shop-breadcrumb a { color: var(--sn-primary-dark); }

.shop-detail {
    display: grid;
    grid-template-columns: minmax(220px, 340px) 1fr;
    gap: 2.2rem;
    align-items: start;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 22px;
    padding: 1.5rem;
}

.shop-detail-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    border-radius: 16px;
    background: linear-gradient(135deg, #f6f9f0, #eef1f7);
    color: var(--sn-primary-dark);
    overflow: hidden;
}

.shop-detail-cover img { width: 100%; height: 100%; object-fit: cover; }

.shop-detail-info h1 {
    font-size: clamp(1.4rem, 2.4vw, 2rem);
    color: var(--sn-dark);
    font-weight: 800;
    margin: .6rem 0;
}

.shop-detail-summary { color: var(--sn-text); line-height: 2; }

.shop-detail-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--sn-primary-dark);
    margin: 1rem 0;
}

.shop-detail-points {
    list-style: none;
    padding: 0;
    margin: 0 0 1.4rem;
    display: grid;
    gap: .55rem;
    font-size: .9rem;
    color: var(--sn-text);
}

.shop-detail-points i { color: var(--sn-primary); margin-inline-end: .35rem; }

.shop-buy-form { display: flex; flex-wrap: wrap; gap: .6rem; }

.shop-note {
    font-size: .8rem;
    color: var(--sn-muted);
    margin-top: .9rem;
}

.shop-detail-extra {
    display: grid;
    grid-template-columns: 1fr minmax(260px, 380px);
    gap: 1.4rem;
    margin-top: 1.4rem;
}

.shop-detail-desc,
.shop-detail-files {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 18px;
    padding: 1.4rem;
}

.shop-detail-desc h2,
.shop-detail-files h2,
.shop-panel h2 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--sn-dark);
    margin-bottom: 1rem;
}

.shop-rich-text { color: var(--sn-text); line-height: 2.1; }

.shop-detail-files ul { list-style: none; margin: 0 0 .8rem; padding: 0; }

.shop-detail-files li {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem 0;
    border-bottom: 1px dashed #eee;
    font-size: .88rem;
}

.shop-detail-files li:last-child { border-bottom: 0; }
.shop-detail-files .name { flex: 1; color: var(--sn-dark); font-weight: 600; word-break: break-all; }
.shop-detail-files .size { color: var(--sn-muted); font-size: .8rem; }

/* ---------- سبد خرید ---------- */
.shop-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.6rem;
}

.shop-page-head h1 { font-size: 1.6rem; font-weight: 800; color: var(--sn-dark); margin: 0; }
.shop-page-head p { color: var(--sn-muted); margin: .35rem 0 0; font-size: .9rem; }

.shop-cart-layout {
    display: grid;
    grid-template-columns: 1fr minmax(280px, 340px);
    gap: 1.5rem;
    align-items: start;
}

.shop-cart-list { display: grid; gap: .8rem; }

.shop-cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 16px;
    padding: .9rem 1rem;
}

.shop-cart-thumb {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f6f9f0, #eef1f7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sn-primary-dark);
    font-size: 1.6rem;
    overflow: hidden;
}

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

.shop-cart-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .25rem; }
.shop-cart-name { color: var(--sn-dark); font-weight: 700; }
.shop-cart-kind { color: var(--sn-muted); font-size: .78rem; }
.shop-cart-price { font-weight: 800; color: var(--sn-dark); white-space: nowrap; text-align: center; }
.shop-cart-price small { display: block; font-weight: 500; font-size: .72rem; color: var(--sn-muted); }

/* ---------- تغییر تعداد اقلام (۱ تا ۹۹) ---------- */
.shop-qty {
    display: inline-flex;
    align-items: center;
    gap: .1rem;
    flex: 0 0 auto;
    padding: .15rem;
    border: 1px solid #e3e7dc;
    border-radius: 12px;
    background: #fafbf6;
}

.shop-qty form { display: flex; margin: 0; }

.shop-qty-btn {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9px;
    background: #fff;
    color: var(--sn-dark);
    font-size: .78rem;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.shop-qty-btn:hover:not(:disabled) { background: var(--sn-primary); color: #fff; }
.shop-qty-btn:disabled { opacity: .35; cursor: not-allowed; }
.shop-qty-btn:focus-visible { outline: 2px solid var(--sn-primary); outline-offset: 1px; }

.shop-qty-value {
    min-width: 28px;
    text-align: center;
    font-weight: 800;
    font-size: .9rem;
    color: var(--sn-dark);
}

.shop-cart-summary {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 18px;
    padding: 1.3rem;
    position: sticky;
    top: 90px;
}

.shop-cart-summary h2 { font-size: 1.05rem; font-weight: 800; color: var(--sn-dark); margin-bottom: 1rem; }

.shop-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .55rem 0;
    font-size: .9rem;
    color: var(--sn-text);
    border-bottom: 1px dashed #eee;
}

.shop-summary-row.total { border-bottom: 0; font-size: 1rem; color: var(--sn-dark); padding-bottom: 1rem; }
.shop-summary-row.total strong { color: var(--sn-primary-dark); font-size: 1.15rem; }

.shop-login-hint {
    margin-top: 1rem;
    background: #fbf7e7;
    border: 1px solid #f0e4b8;
    border-radius: 14px;
    padding: .9rem;
    font-size: .82rem;
    color: #7a6420;
}

.shop-login-hint i { font-size: 1.2rem; }
.shop-login-hint p { margin: .4rem 0 .7rem; line-height: 1.8; }

/* ---------- پرداخت ---------- */
.shop-checkout-layout {
    display: grid;
    grid-template-columns: 1fr minmax(280px, 340px);
    gap: 1.5rem;
    align-items: start;
}

.shop-checkout-main { display: grid; gap: 1.2rem; }

.shop-panel {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 18px;
    padding: 1.3rem;
}

.shop-checkout-item {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .6rem 0;
    border-bottom: 1px dashed #eee;
    font-size: .9rem;
}

.shop-checkout-item:last-child { border-bottom: 0; }
.shop-checkout-item .name { flex: 1; color: var(--sn-dark); font-weight: 600; }
.shop-checkout-item .kind { color: var(--sn-muted); font-size: .78rem; }
.shop-checkout-item .qty { color: var(--sn-muted); font-size: .8rem; white-space: nowrap; }
.shop-checkout-item .price { font-weight: 700; color: var(--sn-dark); }

.shop-gateways { display: grid; gap: .6rem; }

.shop-gateway {
    display: flex;
    align-items: center;
    gap: .8rem;
    border: 1px solid #e6e6e6;
    border-radius: 14px;
    padding: .8rem 1rem;
    cursor: pointer;
    transition: all .15s ease;
}

.shop-gateway:hover { border-color: var(--sn-primary); background: #fafcf6; }
.shop-gateway input { accent-color: var(--sn-primary); }

.shop-gateway-body { flex: 1; display: flex; flex-direction: column; }
.shop-gateway-body strong { color: var(--sn-dark); font-size: .95rem; }
.shop-gateway-body small { color: var(--sn-muted); font-size: .76rem; margin-top: .1rem; }
.shop-gateway > i { color: var(--sn-primary-dark); font-size: 1.3rem; }

.shop-checkout-summary { padding-top: 1.4rem; }

/* ---------- سفارش‌ها ---------- */
.shop-account-section { padding-top: 2.2rem; }

.shop-orders { display: grid; gap: .7rem; }

.shop-order-row {
    display: grid;
    grid-template-columns: 200px 1fr 130px 120px auto;
    align-items: center;
    gap: 1rem;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 14px;
    padding: .9rem 1.1rem;
    color: var(--sn-text);
    transition: all .15s ease;
}

.shop-order-row:hover { border-color: var(--sn-primary); box-shadow: 0 8px 22px rgba(30, 40, 20, .07); }

.shop-order-number { display: block; color: var(--sn-dark); font-weight: 700; font-size: .92rem; }
a.shop-order-number { text-decoration: none; }
a.shop-order-number:hover { color: var(--sn-primary-dark); }

/* دکمه‌های انتهای ردیف: مشاهده و حذف سفارش */
.shop-order-side { display: flex; align-items: center; gap: .35rem; justify-content: flex-end; }
.shop-order-side form { margin: 0; }

.shop-order-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: var(--sn-muted);
    transition: background .15s ease, color .15s ease;
}

.shop-order-open:hover { background: rgba(142, 188, 64, .12); color: var(--sn-primary-dark); }

.shop-order-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #f2d7d7;
    border-radius: 10px;
    background: #fdf3f3;
    color: #c0392b;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.shop-order-delete:hover { background: #fbe3e3; border-color: #e6b3b3; color: #a5281b; }
.shop-order-date { font-size: .76rem; color: var(--sn-muted); }
.shop-order-files { font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-order-amount { font-weight: 800; color: var(--sn-dark); text-align: center; }

.shop-status {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 100px;
    padding: .25rem .7rem;
    font-size: .76rem;
    font-weight: 700;
    white-space: nowrap;
}

.shop-status.paid { background: #e8f6ec; color: #2f7d4c; }
.shop-status.pending { background: #fdf5e3; color: #9a7420; }
.shop-status.cancelled { background: #fdeaea; color: #b03a3a; }
.shop-status.refunded { background: #eef0fb; color: #4553a5; }

.shop-order-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.shop-order-head h1 { font-size: 1.4rem; font-weight: 800; color: var(--sn-dark); margin: 0; }
.shop-order-head p { color: var(--sn-muted); font-size: .82rem; margin: .35rem 0 0; }

.shop-paid-banner {
    display: flex;
    align-items: center;
    gap: .9rem;
    background: #f1faf3;
    border-color: #d8efdf;
    margin-bottom: 1.2rem;
}

.shop-paid-banner > i { font-size: 1.8rem; color: #2f9e57; }

.shop-pay-retry { margin-bottom: 1.2rem; border-color: #f0e4b8; background: #fffdf6; }
.shop-pay-retry-form { display: flex; gap: .6rem; flex-wrap: wrap; }
.shop-pay-retry-form .form-select { max-width: 280px; }

.shop-order-lines { display: grid; gap: 1rem; }

.shop-order-line { border-bottom: 1px dashed #eee; padding-bottom: 1rem; }
.shop-order-line:last-child { border-bottom: 0; padding-bottom: 0; }

.shop-order-line-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .6rem;
}

.shop-order-line-head strong { color: var(--sn-dark); }
.shop-order-line-head span { color: var(--sn-muted); font-size: .85rem; }

.shop-download-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }

.shop-download-list li {
    display: flex;
    align-items: center;
    gap: .6rem;
    background: #fafafa;
    border-radius: 12px;
    padding: .6rem .8rem;
    font-size: .85rem;
    flex-wrap: wrap;
}

.shop-download-list li > i { color: var(--sn-primary-dark); }
.shop-download-list .name { flex: 1; min-width: 150px; color: var(--sn-dark); font-weight: 600; word-break: break-all; }
.shop-download-list .size,
.shop-download-list .usage { color: var(--sn-muted); font-size: .76rem; }

.shop-order-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.4rem; }

/* ---------- کتابخانه دانلود ---------- */
.shop-library { display: grid; gap: .8rem; }

.shop-library-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 16px;
    padding: .9rem 1.1rem;
    flex-wrap: wrap;
}

.shop-library-icon {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f6f9f0, #eef1f7);
    color: var(--sn-primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.shop-library-info { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: .15rem; }
.shop-library-info strong { color: var(--sn-dark); word-break: break-all; }
.shop-library-info .product { color: var(--sn-text); font-size: .84rem; }
.shop-library-info .meta { color: var(--sn-muted); font-size: .76rem; }

/* ---------- دارک مود ---------- */
body.dark_mode .shop-hero {
    background: linear-gradient(135deg, #1d241a 0%, #1a1f2b 55%, #161616 100%);
    border-bottom-color: #2a2a2a;
}

body.dark_mode .shop-hero h1,
body.dark_mode .shop-card-title a,
body.dark_mode .shop-cart-name,
body.dark_mode .shop-cart-price,
body.dark_mode .shop-checkout-item .name,
body.dark_mode .shop-checkout-item .price,
body.dark_mode .shop-qty-value,
body.dark_mode .shop-order-number,
body.dark_mode .shop-order-amount,
body.dark_mode .shop-detail h1,
body.dark_mode .shop-page-head h1,
body.dark_mode .shop-panel h2,
body.dark_mode .shop-cart-summary h2,
body.dark_mode .shop-detail-files .name,
body.dark_mode .shop-library-info strong,
body.dark_mode .shop-order-line-head strong,
body.dark_mode .shop-order-head h1,
body.dark_mode .shop-download-list .name { color: #e9e9e9; }

body.dark_mode .shop-card,
body.dark_mode .shop-detail,
body.dark_mode .shop-cart-item,
body.dark_mode .shop-cart-summary,
body.dark_mode .shop-panel,
body.dark_mode .shop-order-row,
body.dark_mode .shop-library-item,
body.dark_mode .shop-detail-desc,
body.dark_mode .shop-detail-files {
    background: #1f1f1f;
    border-color: #2d2d2d;
}

body.dark_mode .shop-search,
body.dark_mode .shop-hero-badge { background: #232323; border-color: #333; }
body.dark_mode .shop-search input { color: #eee; }
body.dark_mode .shop-chip { background: #262626; color: #cfcfcf; }
body.dark_mode .shop-chip span { background: #333; }
body.dark_mode .shop-empty { background: #1c1c1c; border-color: #333; }
body.dark_mode .shop-download-list li { background: #262626; }
body.dark_mode .shop-gateway { border-color: #333; }
body.dark_mode .shop-gateway:hover { background: #232823; }
body.dark_mode .shop-gateway-body strong { color: #eee; }
body.dark_mode .shop-login-hint { background: #2a271c; border-color: #4a4128; color: #e0d2a4; }
body.dark_mode .shop-pay-retry { background: #242219; border-color: #4a4128; }
body.dark_mode .shop-paid-banner { background: #1b2a20; border-color: #24412e; }
body.dark_mode .shop-summary-row,
body.dark_mode .shop-summary-row.total,
body.dark_mode .shop-cart-summary h2,
body.dark_mode .shop-price { color: #e2e2e2; }
body.dark_mode .shop-price small { color: #9e9e9e; }

/* دکمه حذف سفارش در حالت شب */
body.dark_mode .shop-order-delete { background: #2a1e1e; border-color: #4a2f2f; color: #e08a80; }
body.dark_mode .shop-order-delete:hover { background: #342323; border-color: #6b3d3d; color: #ef9d93; }
body.dark_mode .shop-order-open:hover { background: rgba(142, 188, 64, .16); }
body.dark_mode .shop-detail-summary,
body.dark_mode .shop-detail-points,
body.dark_mode .shop-rich-text { color: #bdbdbd; }

/* انتخاب تعداد در حالت شب */
body.dark_mode .shop-qty { background: #232323; border-color: #333; }
body.dark_mode .shop-qty-btn { background: #2b2b2b; color: #e8e8e8; }
body.dark_mode .shop-qty-btn:hover:not(:disabled) { background: var(--sn-primary); color: #fff; }
body.dark_mode .shop-checkout-item,
body.dark_mode .shop-summary-row,
body.dark_mode .shop-order-line,
body.dark_mode .shop-detail-files li { border-bottom-color: #2d2d2d; }
body.dark_mode .shop-checkout-item .qty { color: #bdbdbd; }
body.dark_mode .shop-cart-price small { color: #9e9e9e; }

/* ---------- موبایل ---------- */
@media (max-width: 991px) {
    .shop-detail,
    .shop-cart-layout,
    .shop-checkout-layout,
    .shop-detail-extra { grid-template-columns: 1fr; }

    .shop-cart-summary { position: static; }

    .shop-order-row { grid-template-columns: 1fr auto; gap: .5rem; }
    .shop-order-files,
    .shop-order-open { display: none; }
    .shop-order-amount { text-align: start; }
}

@media (max-width: 575px) {
    /* اقلام سبد در موبایل: تصویر و عنوان در خط اول، تعداد و قیمت در خط بعد */
    .shop-cart-item { flex-wrap: wrap; row-gap: .6rem; }
    .shop-cart-info { flex: 1 1 60%; }
    .shop-cart-price { flex: 1 1 auto; text-align: start; }
    .shop-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }
    .shop-card-cover { height: 120px; }
    .shop-card-body { padding: .8rem; }
    .shop-card-footer { flex-direction: column; align-items: stretch; }
    .shop-card-footer .btn { width: 100%; }
    .shop-hero { padding: 2rem 0 1.8rem; }
    .shop-detail { padding: 1rem; }
}

/* =====================================================================
   تخفیف، قیمت رایگان و پرداخت اقساطی در فروشگاه
   ===================================================================== */

/* برچسب تخفیف روی کاور کارت */
.shop-card-cover { position: relative; }

.shop-card-off {
    position: absolute;
    top: .7rem;
    inset-inline-start: .7rem;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .2rem .6rem;
    background: #e0263c;
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    border-radius: 100px;
    box-shadow: 0 6px 14px rgba(224, 38, 60, .32);
    letter-spacing: .2px;
}

.shop-card-off.is-free { background: #16a34a; box-shadow: 0 6px 14px rgba(22, 163, 74, .3); }

/* برچسب خطی تخفیف در نوار متادیتای کارت */
.shop-off-inline {
    background: rgba(224, 38, 60, .1);
    color: #c81e33;
    border: 1px solid rgba(224, 38, 60, .22);
    border-radius: 100px;
    padding: .1rem .5rem;
    font-weight: 800;
    font-size: .7rem;
}

/* برچسب پرداخت اقساطی در نوار متادیتای کارت محصول */
.shop-installment-chip {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    background: rgba(13, 138, 125, .1);
    color: #0d7a6e;
    border: 1px solid rgba(13, 138, 125, .25);
    border-radius: 100px;
    padding: .1rem .5rem;
    font-weight: 800;
    font-size: .7rem;
}

body.dark_mode .shop-installment-chip {
    background: rgba(79, 209, 192, .16);
    border-color: rgba(79, 209, 192, .35);
    color: #4fd1c0;
}

/* قیمت‌ها در کارت */
.shop-price-group { display: inline-flex; flex-direction: column; gap: .1rem; line-height: 1.5; }

.shop-price-old {
    display: inline-block;
    width: fit-content;
    color: #9aa4ad;
    font-weight: 600;
    font-size: .86rem;
    line-height: 1.9;
    text-decoration: line-through;
    text-decoration-color: rgba(224, 38, 60, .55);
    text-decoration-thickness: 1px;
}

.shop-price.is-free,
.shop-price-free { color: #16a34a; font-weight: 800; }

/* بلوک قیمت صفحه محصول */
.shop-detail-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--sn-primary-dark);
    margin: 1rem 0;
}

.shop-detail-price .shop-price-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem .6rem;
}

.shop-detail-price.has-discount .shop-price-now { font-size: 2.05rem; color: #0d8a7d; }
.shop-detail-price .shop-price-now { font-size: 2rem; line-height: 1.35; }
.shop-detail-price.is-free .shop-price-now { font-size: 2rem; }

.shop-detail-price .shop-price-old { font-size: 1rem; }

.shop-detail-price .shop-price-unit { font-size: .95rem; font-weight: 600; color: #6b7a84; }

.shop-detail-price .shop-price-off {
    display: inline-flex;
    align-items: center;
    padding: .1rem .55rem;
    background: #e0263c;
    color: #fff;
    border-radius: 100px;
    font-size: .72rem;
    font-weight: 800;
}

.shop-price-note {
    display: block;
    margin-top: .35rem;
    font-size: .8rem;
    font-weight: 600;
    color: #5f7178;
}

.shop-detail-price.is-free .shop-price-free { font-size: 2rem; display: inline-flex; align-items: center; }

/* نوار پرداخت اقساطی */
.shop-installment {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55rem .85rem;
    margin: .35rem 0 1.15rem;
    padding: .65rem .85rem;
    background: linear-gradient(120deg, #f7fbfc, #f3f8ee);
    border: 1px solid #e0ebdf;
    border-radius: 14px;
}

.shop-installment-title {
    font-size: .82rem;
    font-weight: 700;
    color: #33505c;
}

.shop-installment-providers { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

.shop-installment-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    min-width: 54px;
    padding: .2rem .55rem;
    background: #fff;
    border: 1px solid #e4eae8;
    border-radius: 10px;
}

.shop-installment-item img { max-height: 26px; max-width: 96px; object-fit: contain; display: block; }

.shop-installment-name { font-size: .8rem; font-weight: 800; color: #14514a; }

.shop-note-installment { margin-top: .15rem; }

/* حالت شب */
body.dark_mode .shop-price-old { color: #8b8b8b; text-decoration-color: rgba(224, 38, 60, .7); }
body.dark_mode .shop-detail-price .shop-price-unit,
body.dark_mode .shop-price-note { color: #9e9e9e; }
body.dark_mode .shop-detail-price.has-discount .shop-price-now { color: #4fd1c0; }
body.dark_mode .shop-price.is-free,
body.dark_mode .shop-price-free { color: #4ade80; }
body.dark_mode .shop-installment {
    background: #202824;
    border-color: #2f3a34;
}
body.dark_mode .shop-installment-title { color: #cfd8d4; }
body.dark_mode .shop-installment-item { background: #fff; border-color: #3a4340; }
body.dark_mode .shop-off-inline { background: rgba(224, 38, 60, .18); border-color: rgba(224, 38, 60, .35); color: #ff8a97; }

/* کارت تخفیف‌دار: تأکید لبه */
.shop-card.is-discounted { border-color: rgba(224, 38, 60, .25); }
.shop-card.is-free { border-color: rgba(22, 163, 74, .28); }

/* اعلان سفارش رایگان در صفحه پرداخت */
.shop-free-notice {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    padding: .9rem 1rem;
    background: rgba(22, 163, 74, .08);
    border: 1px solid rgba(22, 163, 74, .28);
    border-radius: 14px;
}

.shop-free-notice i { font-size: 1.4rem; color: #16a34a; line-height: 1; }
.shop-free-notice strong { display: block; font-size: .95rem; color: #146c36; }
.shop-free-notice small { display: block; margin-top: .2rem; color: #4b6152; font-size: .8rem; line-height: 1.8; }

body.dark_mode .shop-free-notice { background: rgba(22, 163, 74, .14); border-color: rgba(74, 222, 128, .3); }
body.dark_mode .shop-free-notice strong { color: #7ee2a1; }
body.dark_mode .shop-free-notice small { color: #b7c9bd; }

/* قیمت در فوتر کارت: در دو خط فشرده نشود و «تومان» جدا نیفتد */
.shop-card-footer .shop-price-group { white-space: nowrap; align-items: flex-start; }
.shop-card-footer .shop-price-group .shop-price { font-size: .92rem; line-height: 1.4; }
.shop-card-footer .shop-price-group .shop-price-old { font-size: .72rem; }
.shop-card-footer .shop-price { white-space: nowrap; }

/* برچسب قرمز تخفیف در کنار نوع فایل (صفحه محصول) */
.shop-discount-badge {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    background: #e0263c;
    color: #fff;
    border-radius: 100px;
    padding: .15rem .6rem;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(224, 38, 60, .28);
}

body.dark_mode .shop-discount-badge { background: #e0263c; color: #fff; }

/* ============================================================
   فاکتور رسمی فروشگاه
   ============================================================ */
.invoice-section { background: #f1f5f9; }
.invoice-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.25rem;
}
.invoice-card {
    background: #ffffff;
    color: #1f2933;
    border-radius: 18px;
    padding: 2rem 2.2rem;
    max-width: 1000px;
    margin: 0 auto;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .12);
}
.invoice-head {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    padding-bottom: 1.1rem;
    border-bottom: 2px solid #0f766e;
}
.invoice-brand { display: flex; flex-direction: column; gap: .2rem; }
.invoice-brand strong { font-size: 1.35rem; color: #0f766e; }
.invoice-brand span { font-size: .85rem; color: #64748b; }
.invoice-brand small { font-size: .75rem; color: #475569; max-width: 320px; line-height: 1.9; }
.invoice-title { text-align: left; }
.invoice-title h1 { font-size: 1.7rem; margin: 0 0 .5rem; color: #0f172a; }
.invoice-title dl { margin: 0; display: grid; gap: .2rem; font-size: .8rem; }
.invoice-title dl div { display: flex; gap: .4rem; justify-content: flex-end; }
.invoice-title dt { color: #64748b; margin: 0; }
.invoice-title dd { margin: 0; font-weight: 700; }

.invoice-parties {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin: 1.2rem 0;
}
.invoice-party {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: .9rem 1rem;
    background: #f8fafc;
}
.invoice-party h2 { font-size: .8rem; color: #0f766e; margin: 0 0 .45rem; }
.invoice-party p { margin: 0; font-size: .82rem; color: #475569; line-height: 1.9; }
.invoice-party p span:first-child { color: #64748b; }
.invoice-party-name { font-weight: 800; color: #0f172a !important; }

.invoice-table-wrap { overflow-x: auto; }
.invoice-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.invoice-table thead th {
    background: #0f766e;
    color: #fff;
    font-weight: 700;
    padding: .55rem .5rem;
    text-align: right;
    font-size: .78rem;
}
.invoice-table tbody td { padding: .55rem .5rem; border-bottom: 1px solid #e2e8f0; }
.invoice-table tbody tr:nth-child(even) td { background: #f8fafc; }
.invoice-table td.num { font-variant-numeric: tabular-nums; }
.invoice-table td.name { font-weight: 600; color: #0f172a; }

.invoice-totals {
    margin-top: 1rem;
    margin-right: auto;
    max-width: 330px;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.invoice-total-row { display: flex; justify-content: space-between; font-size: .85rem; color: #475569; }
.invoice-total-row.is-discount { color: #b91c1c; }
.invoice-total-row.is-grand {
    border-top: 1px solid #94a3b8;
    margin-top: .35rem;
    padding-top: .5rem;
    font-size: 1rem;
    color: #0f172a;
}
.invoice-total-row.is-grand strong { color: #0f766e; font-size: 1.1rem; }

.invoice-foot {
    margin-top: 1.6rem;
    padding-top: .8rem;
    border-top: 1px solid #e2e8f0;
    font-size: .75rem;
    color: #64748b;
}
.invoice-foot p { margin: 0 0 .4rem; }
.invoice-sign { font-weight: 600; color: #475569; }

@media print {
    header, footer, .sn-stick-message, .sn-back-top, .invoice-actions,
    .sn-admin-sidebar, .sn-mobile-nav { display: none !important; }
    .invoice-section { background: #fff !important; padding: 0 !important; }
    .invoice-section > .container { max-width: none !important; padding: 0 !important; }
    .invoice-card { box-shadow: none; border-radius: 0; padding: 0; max-width: none; }
    .invoice-table thead th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    @page { size: A4; margin: 14mm; }
}

/* ============================================================
   گالری تصاویر و تب‌های محصول
   ============================================================ */
.shop-gallery { flex-direction: column; align-items: stretch; justify-content: flex-start; padding: .5rem; gap: .5rem; }

/* تصویر اصلی: با کلیک، تمام‌صفحه می‌شود؛ نشانگر ماوس ذره‌بین است */
.shop-gallery-main {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    cursor: zoom-in;
    line-height: 0;
    overflow: hidden;
}

.shop-gallery-main img {
    display: block;
    width: 100%;
    height: 300px;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
    transition: transform .3s ease;
}

/* Bootstrap برای همهٔ دکمه‌ها pointer می‌گذارد؛ نشانگر باید ذره‌بین باشد */
button.shop-gallery-main:not(:disabled) { cursor: zoom-in; }
button.shop-gallery-main:not(:disabled) img { cursor: inherit; }

.shop-gallery-main:hover img { transform: scale(1.02); }

.shop-gallery-main:focus-visible {
    outline: 3px solid rgba(13, 138, 125, .55);
    outline-offset: 2px;
}

.shop-gallery-zoomhint {
    position: absolute;
    inset-inline-end: .6rem;
    bottom: .6rem;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .35rem .65rem;
    border-radius: 100px;
    background: rgba(15, 23, 32, .74);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
}

.shop-gallery-main:hover .shop-gallery-zoomhint,
.shop-gallery-main:focus-visible .shop-gallery-zoomhint {
    opacity: 1;
    transform: none;
}
.shop-gallery-thumbs {
    display: flex;
    gap: .4rem;
    overflow-x: auto;
    padding-bottom: .15rem;
    scrollbar-width: thin;
}
.shop-gallery-thumb {
    flex: 0 0 62px;
    width: 62px;
    height: 62px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.shop-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-gallery-thumb:hover { border-color: rgba(13, 138, 125, .45); }
.shop-gallery-thumb.is-active { border-color: #0d8a7d; box-shadow: 0 4px 12px rgba(13, 138, 125, .25); }

.shop-tabs {
    margin-top: 1.6rem;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 22px;
    padding: 1.2rem 1.4rem 1.5rem;
}
.shop-tab-nav {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
    border-bottom: 1px solid #eef1f3;
    margin-bottom: 1.1rem;
}
.shop-tab {
    appearance: none;
    border: 0;
    background: transparent;
    color: #6b7a84;
    font-weight: 700;
    font-size: .92rem;
    padding: .65rem 1rem;
    border-radius: 12px 12px 0 0;
    position: relative;
    cursor: pointer;
    transition: color .2s ease, background .2s ease;
}
.shop-tab:hover { color: #0d8a7d; background: rgba(13, 138, 125, .06); }
.shop-tab.is-active { color: #0d8a7d; background: rgba(13, 138, 125, .08); }
.shop-tab.is-active::after {
    content: "";
    position: absolute;
    inset-inline: .8rem;
    bottom: -1px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: #0d8a7d;
}
.shop-tab-panel { display: none; }
.shop-tab-panel.is-active { display: block; }
.shop-tab-panel .shop-rich-text { line-height: 2.1; color: var(--sn-text); }

.shop-spec-list { margin: 0; display: grid; gap: .55rem; }
.shop-spec-row {
    display: grid;
    grid-template-columns: minmax(120px, 220px) 1fr;
    gap: .75rem;
    padding: .55rem .8rem;
    border-radius: 10px;
    background: #f8fafb;
    border: 1px solid #eef1f3;
    font-size: .9rem;
}
.shop-spec-row dt { margin: 0; color: #64748b; font-weight: 600; }
.shop-spec-row dd { margin: 0; color: #1f2933; font-weight: 700; }

.shop-file-list { list-style: none; padding: 0; margin: 0 0 .8rem; display: grid; gap: .5rem; }
.shop-file-list li {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .65rem .8rem;
    border: 1px solid #eef1f3;
    border-radius: 12px;
    background: #f8fafb;
    font-size: .88rem;
}
.shop-file-list li .name { flex: 1; font-weight: 700; color: #1f2933; }
.shop-file-list li .size { color: #64748b; font-size: .8rem; }

body.dark_mode .shop-tabs,
body.dark_mode .shop-spec-row,
body.dark_mode .shop-file-list li { background: #202824; border-color: #2f3a34; color: #e6e6e6; }
body.dark_mode .shop-tab { color: #a7b3ad; }
body.dark_mode .shop-tab.is-active { color: #4fd1c0; background: rgba(79, 209, 192, .12); }
body.dark_mode .shop-tab.is-active::after { background: #4fd1c0; }
body.dark_mode .shop-spec-row dt { color: #9aa8a2; }
body.dark_mode .shop-spec-row dd { color: #e6e6e6; }
body.dark_mode .shop-file-list li .name { color: #e6e6e6; }

/* ---------- نمایش تمام‌صفحهٔ تصویر گالری ---------- */
body.shop-lightbox-open { overflow: hidden; }

.shop-lightbox {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3.4rem 4.2rem 2rem;
    background: rgba(8, 13, 18, .93);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    animation: shopLightboxIn .18s ease-out;
}

.shop-lightbox[hidden] { display: none; }

@keyframes shopLightboxIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.shop-lightbox-bar {
    position: absolute;
    inset-block-start: 0;
    inset-inline: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1rem;
    color: #e8eef2;
}

.shop-lightbox-count {
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .02em;
    color: #cfd8dd;
}

.shop-lightbox-stage {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
}

.shop-lightbox-stage img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(92vw, 1600px);
    max-height: 84vh;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .55);
}

.shop-lightbox-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.shop-lightbox-btn:hover,
.shop-lightbox-btn:focus-visible {
    background: rgba(255, 255, 255, .2);
    border-color: rgba(255, 255, 255, .45);
    outline: none;
    transform: scale(1.05);
}

.shop-lightbox-btn.is-close { width: 42px; height: 42px; font-size: 1.05rem; }

.shop-lightbox-btn.is-nav {
    position: absolute;
    inset-block-start: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    font-size: 1.7rem;
}

.shop-lightbox-btn.is-nav:hover,
.shop-lightbox-btn.is-nav:focus-visible { transform: translateY(-50%) scale(1.06); }

.shop-lightbox-btn.is-prev { inset-inline-start: 1rem; }
.shop-lightbox-btn.is-next { inset-inline-end: 1rem; }

@media (max-width: 767.98px) {
    .shop-lightbox { padding: 3.6rem 1rem 4.6rem; }
    .shop-lightbox-stage img { max-width: 92vw; max-height: 72vh; }
    .shop-lightbox-btn.is-nav {
        inset-block-start: auto;
        bottom: 1rem;
        transform: none;
        width: 46px;
        height: 46px;
        font-size: 1.4rem;
    }
    .shop-lightbox-btn.is-nav:hover,
    .shop-lightbox-btn.is-nav:focus-visible { transform: scale(1.06); }
    .shop-lightbox-btn.is-prev { inset-inline-start: calc(50% - 3.1rem); }
    .shop-lightbox-btn.is-next { inset-inline-end: calc(50% - 3.1rem); }
}

@media (max-width: 575.98px) {
    .shop-gallery-main img { height: 220px; }
    .shop-spec-row { grid-template-columns: 1fr; gap: .15rem; }
}
