﻿/* ============================================================
   صفحه محصول — تک صفحه (ریسپانسیو و بهینه)
   Single Product Page — Responsive & Optimized
   ============================================================ */


/* ══════════════════════════════════════════════════════════
   ۱. متغیرهای سراسری (CSS Variables)
══════════════════════════════════════════════════════════ */
:root {
    /* رنگ‌های اصلی */
    --sp-navy:    #184362;
    --sp-orange:  #f2971e;
    --sp-blue:    #14a8e3;

    /* رنگ‌های متن */
    --sp-text:    #292d32;
    --sp-muted:   rgba(41, 45, 50, .7);

    /* رنگ‌های پس‌زمینه و حاشیه */
    --sp-platin:  #e7e9eb;
    --sp-light:   #f8f9fa;
    --sp-bg:      #ecf4f6;
    --sp-border:  #e7e9eb;

    /* شعاع گوشه‌ها */
    --sp-r-sm:    8px;
    --sp-r-md:    10px;
    --sp-r-lg:    15px;
    --sp-r-xl:    16px;
    --sp-r-2xl:   30px;

    /* سایه */
    --sp-sh2: 0 15px 25px rgba(190, 190, 190, .2);
}


/* ══════════════════════════════════════════════════════════
   ۲. ساختار کلی صفحه (Layout Wrapper)
══════════════════════════════════════════════════════════ */

/* کانتینر اصلی صفحه */
.sp-page {
    direction: rtl;
    padding: 24px 5% 64px;
    position: relative;
    background: #fff;
    max-width: 1440px;
    margin: 0 auto;
    
}

/* نوار گرادیانت پشت هدر — فعلاً مخفی است */
.sp-band {
    display: none;
    position: absolute;
    top: -200px;
    left: -39px;
    width: 1832px;
    height: 746px;
    transform: rotate(7.01deg);
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

/* لایه محتوای اصلی روی بند */
.sp-content {
    position: relative;
    z-index: 1;

}





/* ══════════════════════════════════════════════════════════
   ۳. بخش هیرو — تصویر محصول + اطلاعات (Hero Section)
══════════════════════════════════════════════════════════ */

/* ردیف اصلی هیرو */
.sp-hero {
    display: flex;
    flex-direction: row-reverse;
    gap: 32px;
    align-items: flex-start;
    padding-top: 24px;
}

/* ستون چپ: iframe + کارت‌های متا */
.sp-left-col {
    width: 65%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sp-left-col .sp-main-img {
    width: 100%;
}

.sp-left-col .sp-product-meta {
    margin: 0;
}

/* باکس تصویر / ویدیوی اصلی محصول */
.sp-main-img {
    width: 100%;
    flex-shrink: 0;
    border-radius: var(--sp-r-2xl);
    overflow: hidden;
    position: relative;
    background: #fff;
    min-height: 420px;
    box-shadow: var(--sp-sh2);
}

/* ارتفاع را جاوااسکریپت بر اساس محتوای واقعی نت تعیین می‌کند */
.sp-main-img iframe {
    width: 100%;
    border: none;
    display: block;
}





/* ══════════════════════════════════════════════════════════
   ۴. ستون اطلاعات محصول (Info Column)
══════════════════════════════════════════════════════════ */

.sp-info {
    width: 35%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    direction: rtl;
    text-align: right;
}

/* ردیف عنوان + دکمه اشتراک‌گذاری */
.sp-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.sp-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--sp-text);
    text-align: right;
    line-height: 1.4;
    flex: 1;
    margin: 0;
}

.sp-share-btn {
    background: var(--sp-light);
    border: none;
    border-radius: var(--sp-r-lg);
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.sp-share-btn img {
    width: 24px;
    height: 24px;
}

/* زیرعنوان انگلیسی */
.sp-subtitle {
    font-size: 14px;
    color: var(--sp-muted);
    text-align: right;
}

/* ستاره‌ها و تعداد رأی */
.sp-rating-row {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    width: 100%;
}

.sp-stars {
    display: flex;
    gap: 4px;
}

.sp-stars img {
    width: 20px;
    height: 20px;
}

.sp-vote-count {
    font-size: 14px;
    color: var(--sp-text);
}

/* دسته‌بندی محصول */
.sp-cat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    font-size: 14px;
    width: 100%;
}

.sp-cat-label {
    color: var(--sp-muted);
}

.sp-cat-value {
    font-weight: 500;
    color: var(--sp-text);
}

/* بلوک قیمت‌ها */
.sp-price-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    width: 100%;
    background: var(--sp-light);
    padding: 16px;
    border-radius: var(--sp-r-lg);
}

.sp-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
}

.sp-price-label {
    font-size: 14px;
    color: var(--sp-muted);
}

.sp-price-main {
    font-size: 20px;
    font-weight: 700;
    color: var(--sp-text);
}

.sp-price-sub {
    font-size: 14px;
    font-weight: 700;
    color: var(--sp-orange);
}

/* نوار هشدار اشتراک */
.sp-sub-bar {
    position: relative;
    min-height: 55px;
    border-radius: var(--sp-r-lg);
    display: flex;
    align-items: center;
}

.sp-sub-bar-bg {
    position: absolute;
    inset: 0;
    background: var(--sp-orange);
    border-radius: var(--sp-r-lg);
}

.sp-sub-bar-fg {
    position: absolute;
    top: 2px;
    right: 0;
    left: 0;
    bottom: 2px;
    background: var(--sp-light);
    border-radius: calc(var(--sp-r-lg) - 2px);
}

.sp-sub-bar-body {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    width: 100%;
    flex-wrap: wrap;
}

.sp-sub-bar-body img {
    width: 24px;
    height: 24px;
}

.sp-sub-bar-body .msg {
    font-size: 13px;
    font-weight: 700;
    color: #212529;
    text-align: right;
}

.sp-sub-bar-body .link {
    font-size: 14px;
    font-weight: 700;
    color: var(--sp-orange);
    white-space: nowrap;
}

.sp-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
}

.sp-option-card {
    background: var(--sp-light);
    border-radius: var(--sp-r-lg);
    padding: 12px;
    border: 1px solid var(--sp-platin);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sp-option-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--sp-navy);
    margin: 0;
    text-align: right;
}

.sp-option-card-body {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.sp-option-card-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sp-opt-btn {
    background: var(--sp-navy);
    color: #fff;
    border: none;
    border-radius: var(--sp-r-md);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
    transition: background 0.2s;
}

.sp-opt-btn:hover {
    background: var(--sp-orange);
}

.sp-opt-input {
    width: 70px;
    text-align: center;
    border: 1px solid var(--sp-platin);
    border-radius: var(--sp-r-md);
    padding: 8px;
    font-size: 13px;
    direction: ltr;
}




.sp-option {
    border: 1px solid var(--sp-platin);
    border-radius: var(--sp-r-lg);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    width: 100%;
    cursor: pointer;
}

.sp-option img {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.sp-option span {
    font-size: 12px;
    color: #6c757d;
    flex: 1;
    text-align: right;
}






/* دکمه‌های اکشن (خرید / علاقه‌مندی) */
.sp-action-row {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    margin-top: 8px;
}

.sp-btn-buy {
    flex: 1;
    background: var(--sp-navy);
    color: #fff;
    border: none;
    border-radius: var(--sp-r-lg);
    padding: 16px;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.sp-btn-buy:hover {
    background: var(--sp-orange);
}

.sp-btn-buy img {
    width: 24px;
    height: 24px;
}

.sp-btn-fav {
    background: var(--sp-light);
    border: 1px solid var(--sp-platin);
    border-radius: var(--sp-r-lg);
    padding: 16px;
    display: flex;
    cursor: pointer;
    transition: 0.2s;
}

.sp-btn-fav:hover {
    background: #feebeb;
    border-color: #ffcccc;
}

.sp-btn-fav img {
    width: 24px;
    height: 24px;
}


/* ══════════════════════════════════════════════════════════
   ۵. کارت‌های ویژگی محصول (Product Meta Cards)
══════════════════════════════════════════════════════════ */

.sp-product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 24px 0;
    direction: rtl;
}

/* استایل چیپ‌های دسته‌بندی به Single.cshtml منتقل شد */

.sp-meta-attr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    background: #f0f4ff;
    color: var(--sp-navy);
    border: 1px solid #d0d9ff;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    width: 100%;
}

.sp-meta-attr-btn:hover {
    background: #184362;
    color: #fff;
    border-color: #184362;
}

.sp-meta-attr-btn img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

/* هینت اطلاعات متا */
.sp-meta-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #e8f4fd;
    border-radius: var(--sp-r-md);
    padding: 10px 16px;
    font-size: 13px;
    color: #184362;
    margin-bottom: 8px;
    direction: rtl;
}


/* ══════════════════════════════════════════════════════════
   ۶. خط جداکننده (Divider)
══════════════════════════════════════════════════════════ */

.sp-divider {
    height: 1px;
    background: var(--sp-platin);
    margin: 32px 0;
}


/* ══════════════════════════════════════════════════════════
   ۷. محصولات مرتبط (Related Products)
══════════════════════════════════════════════════════════ */

/* هدر بخش محصولات مرتبط */
.sp-related-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-direction: row-reverse;
}

.sp-related-title {
    text-align: right;
}

.sp-related-title h3 {
    font-size: 20px;
    font-weight: 900;
    color: #1c1a1b;
    margin: 0 0 4px;
}

.sp-related-title h3 span {
    color: #ff794c;
}

.sp-related-title p {
    font-size: 14px;
    font-weight: 500;
    color: #1c1a1b;
    margin: 0;
}

.sp-related-title .sp-underline {
    height: 2px;
    background: var(--sp-orange);
    width: 100%;
    max-width: 143px;
    margin: 4px 0;
    margin-left: auto;
}

/* دکمه‌های فلش اسلایدر */
.sp-related-arrows {
    display: flex;
    gap: 12px;
    align-items: center;
}

.sp-arr-btn {
    background: #fff;
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-r-lg);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--sp-sh2);
    cursor: pointer;
    transition: background 0.2s;
}

.sp-arr-btn:hover {
    background: var(--sp-light);
}

.sp-arr-btn svg {
    width: 16px;
    height: 16px;
}

/* ردیف اسکرول محصولات */
.sp-products-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.sp-products-row {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-behavior: smooth;
    padding-bottom: 16px;
}

.sp-products-row::-webkit-scrollbar {
    display: none;
}

/* کارت هر محصول */
.sp-prod-card {
    width: 220px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
}

.sp-prod-img {
    width: 100%;
    aspect-ratio: 3/4;
    border-radius: var(--sp-r-xl);
    overflow: hidden;
    position: relative;
    background: #f5f5f5;
}

.sp-prod-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* بج‌های روی تصویر محصول */
.sp-prod-badges {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--sp-r-sm);
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.sp-prod-badges img {
    width: 16px;
    height: 16px;
}

.sp-prod-badges .more {
    font-size: 12px;
    font-weight: 600;
    color: var(--sp-navy);
}

/* بدنه متنی کارت محصول */
.sp-prod-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

.sp-prod-cat {
    font-size: 11px;
    font-weight: 500;
    color: var(--sp-blue);
}

.sp-prod-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--sp-text);
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.sp-prod-stars {
    display: flex;
    gap: 2px;
}

.sp-prod-stars img {
    width: 14px;
    height: 14px;
}

.sp-prod-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--sp-text);
    text-align: right;
}


/* ══════════════════════════════════════════════════════════
   ۸. تب‌های پایین صفحه (Bottom Tabs)
══════════════════════════════════════════════════════════ */

/* کانتینر اسکرول‌پذیر تب‌ها */
.sp-tabs-container {
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 2px solid var(--sp-platin);
    margin-bottom: 32px;
}

.sp-tabs-container::-webkit-scrollbar {
    display: none;
}

.sp-tabs {
    display: flex;
    gap: 16px;
    justify-content: flex-start;
    align-items: center;
    width: max-content;
    direction: rtl;
}

.sp-tab {
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    color: #595771;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.sp-tab.active {
    color: var(--sp-orange);
    border-bottom-color: var(--sp-orange);
}

/* محتوای هر تب */
.sp-tab-panel {
    min-height: 100px;
    direction: rtl;
    text-align: right;
}

.sp-tab-panel .sp-section-header {
    justify-content: flex-end;
}

/* ══════════════════════════════════════════════════════════
   ۹. ردیف‌های اطلاعات و مشخصات (Spec Rows)
══════════════════════════════════════════════════════════ */

.sp-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-direction: row-reverse;
}

.sp-section-title {
    font-size: 20px;
    font-weight: 700;
    color: #1c1a1b;
    text-align: right;
}

.sp-spec-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--sp-r-md);
    font-size: 14px;
}

.sp-spec-label {
    font-weight: 700;
    color: #1c1a1b;
    text-align: right;
}

.sp-spec-value {
    color: var(--sp-muted);
    text-align: left;
}

/* ردیف‌های فرد — پس‌زمینه روشن */
.sp-spec-row.alt {
    background: var(--sp-light);
}

/* دکمه «بیشتر ببین» */
.sp-see-more {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
    cursor: pointer;
}

.sp-see-more img {
    width: 20px;
    height: 20px;
}

.sp-see-more span {
    font-size: 14px;
    font-weight: 700;
    color: var(--sp-blue);
}

/* متن بررسی و معرفی محصول */
.sp-review-text {
    font-size: 15px;
    color: var(--sp-muted);
    line-height: 2;
    text-align: justify;
    margin-bottom: 16px;
}


/* ══════════════════════════════════════════════════════════
   ۱۰. کارت‌های نظرات کاربران (Comments)
══════════════════════════════════════════════════════════ */

.sp-comment-card {
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-r-lg);
    padding: 24px;
    display: flex;
    flex-direction: row;
    direction: rtl;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
    background: #fff;
}

/* نظر پاسخ (تورفتگی بیشتر) */
.sp-comment-card.reply {
    margin-right: 40px;
    background: var(--sp-light);
    border: none;
}

/* آواتار کاربر — همیشه سمت راست در RTL */
.sp-comment-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--sp-border);
    order: -1;
}

.sp-comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* بدنه متنی نظر */
.sp-comment-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    direction: rtl;
    text-align: right;
}

.sp-comment-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--sp-text);
    text-align: right;
}

.sp-comment-date {
    font-size: 12px;
    color: var(--sp-muted);
    text-align: right;
}

.sp-comment-text {
    font-size: 14px;
    color: var(--sp-text);
    text-align: right;
    line-height: 1.7;
}

/* ردیف اکشن‌های نظر (پاسخ / لایک) */
.sp-comment-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    width: 100%;
    margin-top: 8px;
}

.sp-comment-reply {
    background: var(--sp-platin);
    border-radius: var(--sp-r-sm);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    cursor: pointer;
    border: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--sp-text);
}

/* دکمه‌های رأی‌گیری */
.sp-votes {
    display: flex;
    gap: 12px;
    align-items: center;
}

.sp-vote-btn {
    background: var(--sp-platin);
    border-radius: var(--sp-r-sm);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    cursor: pointer;
    border: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--sp-text);
}


/* ══════════════════════════════════════════════════════════
   ۱۱. سوییچ تاگل (Toggle Switch)
══════════════════════════════════════════════════════════ */

.sp-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
    width: 100%;
}

.sp-toggle-label {
    font-size: 13px;
    color: #6c757d;
}

.sp-toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.sp-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.sp-toggle-slider {
    position: absolute;
    inset: 0;
    background: #e7e9eb;
    border-radius: 26px;
    cursor: pointer;
    transition: background 0.3s;
}

.sp-toggle-slider:before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
}

.sp-toggle-switch input:checked + .sp-toggle-slider {
    background: #184362;
}

.sp-toggle-switch input:checked + .sp-toggle-slider:before {
    transform: translateX(22px);
}


/* ══════════════════════════════════════════════════════════
   ۱۲. نوار ابزار شناور موبایل (Mobile Floating Toolbar)
══════════════════════════════════════════════════════════ */

/* کانتینر اصلی نوار — در دسکتاپ مخفی */
.sp-mobile-toolbar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-top: 2px solid var(--sp-orange);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    padding: 12px 16px;
    max-height: 50vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
    padding-bottom: 80px; /* ✅ فاصله از پایین تا دکمه‌ها پوشانده نشن */
}

/* حالت جمع‌شده نوار */
.sp-mobile-toolbar.collapsed {
    transform: translateY(100%);
}

/* دکمه باز/بسته کردن نوار — در دسکتاپ مخفی */
.sp-toolbar-toggle {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--sp-navy);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    display: none;
    cursor: pointer;
    transition: all 0.3s;
}

.sp-toolbar-toggle:active {
    transform: translateX(-50%) scale(0.95);
}

/* آیکون فلش دکمه تاگل */
.sp-toolbar-toggle .arrow {
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.3s;
}

.sp-toolbar-toggle.open .arrow {
    transform: rotate(180deg);
}

/* گرید آیتم‌های نوار */
.sp-toolbar-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.sp-toolbar-item {
    background: var(--sp-light);
    border-radius: var(--sp-r-lg);
    padding: 12px;
    border: 1px solid var(--sp-platin);
}

.sp-toolbar-item h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--sp-navy);
    margin: 0 0 8px 0;
    text-align: right;
}

/* دکمه‌های درون آیتم نوار */
.sp-toolbar-buttons {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.sp-toolbar-btn {
    background: var(--sp-navy);
    color: white;
    border: none;
    border-radius: var(--sp-r-md);
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
    min-width: 80px;
    transition: background 0.2s;
}

.sp-toolbar-btn:active {
    background: var(--sp-orange);
}

.sp-toolbar-btn.small {
    min-width: 50px;
    padding: 10px 12px;
}

/* اینپوت کوچک درون نوار */
.sp-toolbar-input {
    width: 70px;
    text-align: center;
    border: 1px solid var(--sp-platin);
    border-radius: var(--sp-r-md);
    padding: 8px;
    font-size: 13px;
    direction: ltr;
}

/* سوییچ تاگل درون نوار */
.sp-toolbar-toggle-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
}


/* ══════════════════════════════════════════════════════════
   ۱۳. مودال خرید / دانلود (Modal)
══════════════════════════════════════════════════════════ */

/* لایه تاریک پشت مودال */
.sp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sp-modal-overlay.show {
    display: flex;
    opacity: 1;
}

/* باکس مودال */
.sp-modal-box {
    background: #fff;
    width: 100%;
    max-width: 600px;
    border-radius: var(--sp-r-xl);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    direction: rtl;
}

.sp-modal-overlay.show .sp-modal-box {
    transform: translateY(0);
}

/* هدر مودال */
.sp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--sp-platin);
}

.sp-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--sp-navy);
    margin: 0;
}

.sp-modal-close {
    background: var(--sp-light);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    color: var(--sp-text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.sp-modal-close:hover {
    background: #feebeb;
    color: #e74c3c;
}

/* بدنه مودال */
.sp-modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* فوتر مودال */
.sp-modal-footer {
    padding: 0 24px 24px 24px;
}

/* دکمه بازگشت در مودال */
.sp-modal-back {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--sp-navy);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 24px;
    height: 24px;
}

/* کارت‌های رادیو (انتخاب نوع خرید) */
.sp-radio-card {
    display: block;
    border: 2px solid var(--sp-platin);
    border-radius: var(--sp-r-md);
    padding: 16px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: #fff;
}

.sp-radio-card:hover {
    border-color: #cbd5e1;
}

.sp-radio-card.active {
    border-color: var(--sp-navy);
    background: #f8fafc;
}

.sp-radio-flex {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.sp-radio-flex input[type="radio"] {
    display: none;
}

.sp-radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--sp-muted);
    border-radius: 50%;
    display: inline-block;
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
}

.sp-radio-flex input[type="radio"]:checked + .sp-radio-custom {
    border-color: var(--sp-navy);
}

.sp-radio-flex input[type="radio"]:checked + .sp-radio-custom::after {
    content: "";
    position: absolute;
    inset: 3px;
    background: var(--sp-navy);
    border-radius: 50%;
}

.sp-radio-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sp-radio-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--sp-text);
}

.sp-radio-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--sp-orange);
}

.sp-radio-desc {
    font-size: 13px;
    color: var(--sp-muted);
}

/* بج موفقیت */
.sp-badge-success {
    background: #ecfdf5;
    color: #059669;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #a7f3d0;
    margin-right: 4px;
}

/* دراپ‌داون انتخاب اشتراک */
.sp-sub-dropdown-wrap {
    display: none;
    padding-top: 8px;
    margin-top: -8px;
    animation: slideDown 0.3s ease;
}

.sp-sub-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--sp-text);
    display: block;
    margin-bottom: 8px;
}

.sp-sub-select {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--sp-r-md);
    border: 1px solid var(--sp-platin);
    background: var(--sp-light);
    font-family: inherit;
    font-size: 14px;
    color: var(--sp-text);
    cursor: pointer;
    outline: none;
}

.sp-sub-select:focus {
    border-color: var(--sp-navy);
}

/* باکس وسوسه‌کننده اشتراک */
.sp-persuasion-box {
    display: none;
    background: #fffbfa;
    border: 1px dashed var(--sp-orange);
    border-radius: var(--sp-r-md);
    padding: 16px;
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--sp-text);
    animation: fadeIn 0.4s ease;
}

.sp-persuasion-box span.text-red {
    color: #e74c3c;
    font-weight: 900;
    font-size: 16px;
}

.sp-persuasion-box span.text-green {
    color: #059669;
    font-weight: 900;
    font-size: 16px;
}

.sp-persuasion-box .math-formula {
    display: block;
    font-size: 12px;
    color: var(--sp-muted);
    margin-bottom: 8px;
    border-bottom: 1px solid #fce8e6;
    padding-bottom: 8px;
}

/* ══════════════════════════════════════════════════════════
   ۱۴. مرحله فاکتور در مودال (Invoice Step)
══════════════════════════════════════════════════════════ */

.sp-invoice-wrap {
    background: #f8f9fa;
    border: 1px solid var(--sp-platin);
    border-radius: var(--sp-r-md);
    padding: 20px;
}

.sp-inv-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--sp-text);
}

.sp-inv-row:last-child {
    margin-bottom: 0;
}

.sp-inv-total {
    font-size: 18px;
    font-weight: 900;
    color: var(--sp-navy);
    border-top: 1px dashed var(--sp-platin);
    padding-top: 16px;
    margin-top: 16px;
}

/* فیلد کد تخفیف */
.sp-discount-wrap {
    margin: 16px 0;
    padding: 16px 0;
    border-top: 1px dashed var(--sp-platin);
    border-bottom: 1px dashed var(--sp-platin);
}

.sp-discount-toggle {
    font-size: 13px;
    color: var(--sp-blue);
    cursor: pointer;
    font-weight: 700;
    display: inline-block;
    transition: color 0.2s;
}

.sp-discount-toggle:hover {
    color: var(--sp-orange);
}

.sp-discount-box {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    animation: fadeIn 0.3s ease;
}

.sp-discount-box input {
    flex: 1;
    border: 1px solid var(--sp-platin);
    border-radius: var(--sp-r-sm);
    padding: 10px 12px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    direction: ltr;
    text-align: left;
}

.sp-discount-box input:focus {
    border-color: var(--sp-navy);
}

.sp-discount-box button {
    background: var(--sp-navy);
    color: #fff;
    border: none;
    border-radius: var(--sp-r-sm);
    padding: 0 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.sp-discount-box button:hover {
    background: var(--sp-orange);
}


/* ══════════════════════════════════════════════════════════
   ۱۵. دکمه دانلود با افکت درخشش (Glowing Download Button)
══════════════════════════════════════════════════════════ */

.sp-btn-glow {
    background: #059669 !important;
    box-shadow: 0 0 15px rgba(5, 150, 105, 0.5);
    animation: pulse-green 2s infinite;
}

.sp-btn-glow:hover {
    background: #047857 !important;
}

/* اسپینر انتظار */
.sp-curtain-spinner {
    width: 45px;
    height: 45px;
    border: 4px solid var(--sp-platin);
    border-top: 4px solid var(--sp-orange);
    border-radius: 50%;
    animation: sp-spin 1s linear infinite;
}


/* ══════════════════════════════════════════════════════════
   ۱۶. کی‌فریم‌های انیمیشن (Keyframes)
══════════════════════════════════════════════════════════ */

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-green {
    0%   { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.7); }
    70%  { box-shadow: 0 0 0 15px rgba(5, 150, 105, 0); }
    100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}

@keyframes sp-spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* ══════════════════════════════════════════════════════════
   ۱۷. مدیا کوئری — تبلت (max-width: 992px)
══════════════════════════════════════════════════════════ */

@media (max-width: 992px) {

    /* هیرو: ستونی می‌شود */
    .sp-hero {
        flex-direction: column;
        padding-top: 0;
        gap: 24px;
    }

    /* ستون چپ و تصویر: تمام‌عرض */
    .sp-left-col,
    .sp-main-img {
        width: 100%;
    }

    /* ستون اطلاعات: تمام‌عرض */
    .sp-info {
        width: 100%;
    }

    /* اندازه عنوان کوچک‌تر */
    .sp-title {
        font-size: 24px;
    }

    /* آپشن‌های دسکتاپ مخفی — نوار موبایل جایگزین می‌شود */
    .sp-options-grid {
        display: none !important;
    }

    /* نمایش نوار ابزار و دکمه تاگل موبایل */
    .sp-mobile-toolbar,
    .sp-toolbar-toggle {
        display: block;
    }

    /* فاصله از پایین برای جلوگیری از پوشش محتوا توسط نوار */
    .sp-page {
        padding-bottom: 80px;
    }

    /* نظرات: فشرده‌تر */
    .sp-comment-card {
        padding: 16px;
        gap: 12px;
    }

    .sp-comment-card.reply {
        margin-right: 20px;
    }

    .sp-comment-avatar {
        width: 40px;
        height: 40px;
    }

    /* در موبایل اکشن‌های نظر برعکس می‌شود */
    .sp-comment-actions {
        flex-direction: row-reverse;
    }
}


/* ══════════════════════════════════════════════════════════
   ۱۸. مدیا کوئری — موبایل کوچک (max-width: 576px)
══════════════════════════════════════════════════════════ */

@media (max-width: 576px) {

    .sp-page {
        padding: 16px 4% 40px;
    }

    .sp-title {
        font-size: 20px;
    }

    /* نوار اشتراک: متن وسط‌چین */
    .sp-sub-bar-body {
        justify-content: center;
        text-align: center;
    }

    .sp-sub-bar-body .msg {
        font-size: 11px;
        text-align: center;
        line-height: 1.6;
        width: 100%;
    }

    /* دکمه خرید از راست */
    .sp-action-row {
        flex-direction: row-reverse;
    }

    .sp-btn-buy {
        font-size: 13px;
        padding: 14px;
    }

    /* هدر محصولات مرتبط: ستونی */
    .sp-related-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .sp-related-arrows {
        align-self: flex-end;
    }

    /* اسکرول افقی محصولات: لبه‌ها نمایان */
    .sp-products-wrapper {
        margin-right: -4vw;
        margin-left: -4vw;
        width: 100vw;
    }

    .sp-products-row {
        padding-right: 4vw;
        padding-left: 4vw;
    }

    .sp-prod-card {
        width: 160px;
    }

    .sp-prod-name {
        font-size: 12px;
    }


    #osmd-fullscreen-overlay {
        overflow: hidden;
    }



    /* ✅ نمایش فلش‌های داخلی input number */
    .sp-opt-input::-webkit-inner-spin-button,
    .sp-toolbar-input::-webkit-inner-spin-button {
        opacity: 1;
        width: 20px;
        height: 100%;
        cursor: pointer;
    }

    .sp-opt-input::-webkit-outer-spin-button,
    .sp-toolbar-input::-webkit-outer-spin-button {
        opacity: 1;
    }
    
    
    
}