
    .modal {
        display: none;
        position: fixed;
        z-index: 9999;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.9);
        cursor: zoom-out;
    }

    .modal-container {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100%;
        width: 100%;
    }

    .modal-content {
        max-width: 90%;
        max-height: 90%;
        object-fit: contain;
        animation: zoomIn 0.2s ease;
    }

    @keyframes zoomIn {
        from { transform: scale(0.8); opacity: 0; }
        to { transform: scale(1); opacity: 1; }
    }

    .close-modal {
        position: absolute;
        top: 20px;
        right: 35px;
        color: white;
        font-size: 45px;
        font-weight: bold;
        cursor: pointer;
        z-index: 10000;
        transition: 0.3s;
    }

    .close-modal:hover {
        color: #ff6b6b;
        transform: scale(1.1);
    }


    /* استایل دکمه‌های چپ و راست در مودال */
    .modal-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        color: white;
        font-size: 45px;
        font-weight: bold;
        padding: 10px 20px;
        cursor: pointer;
        transition: 0.3s;
        user-select: none;
        border-radius: 8px;
        z-index: 10001;
    }

    .modal-nav:hover {
        color: var(--secondary-color);
        background-color: rgba(0, 0, 0, 0.5);
    }

    .prev { left: 30px; }
    .next { right: 30px; }

    /* شمارنده تصاویر پایین مودال */
    .modal-counter {
        position: absolute;
        bottom: 25px;
        left: 50%;
        transform: translateX(-50%);
        color: rgba(255, 255, 255, 0.7);
        font-size: 0.95rem;
        font-family: 'Vazirmatn', sans-serif;
    }
    
    
    
            /* ===== استایل گالری ===== */
        .gallery-section {
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
        }

        .main-image {
            width: 100%;
            max-height: 500px;
            object-fit: cover;
            border-radius: 12px;
            cursor: pointer;
            transition: transform 0.3s;
            box-shadow: 0 4px 15px rgba(0,0,0,0.1);
            -webkit-tap-highlight-color: transparent;
        }
        .main-image:hover {
            transform: scale(1.02);
        }

        .thumbnails {
            display: flex;
            gap: 10px;
            margin-top: 15px;
            flex-wrap: wrap;
            justify-content: center;
        }
        .thumb {
            width: 80px;
            height: 80px;
            object-fit: cover;
            border-radius: 8px;
            cursor: pointer;
            border: 3px solid transparent;
            transition: all 0.3s;
            -webkit-tap-highlight-color: transparent;
        }
        .thumb:hover {
            transform: scale(1.05);
        }
        .thumb.active {
            border-color: #007bff;
            box-shadow: 0 0 10px rgba(0,123,255,0.5);
        }

        /* ===== استایل لایت‌باکس ===== */
        .lightbox {
            display: none;
            position: fixed;
            z-index: 9999;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.92);
            justify-content: center;
            align-items: center;
            flex-direction: column;
        }

        .image-container {
            width: 80%;
            height: 75%;
            display: flex;
            justify-content: center;
            align-items: center;
            overflow: hidden;
            position: relative;
            touch-action: none;
        }

        #lightboxImg {
            max-width: 95%;
            max-height: 95%;
            object-fit: contain;
            transition: transform 0.25s ease;
            transform: scale(1);
            cursor: grab;
            border-radius: 8px;
            box-shadow: 0 0 30px rgba(0,0,0,0.5);
            touch-action: none;
            -webkit-user-select: none;
            user-select: none;
        }

        /* دکمه ضربدر */
        .close {
            position: absolute;
            top: 25px;
            right: 40px;
            color: #fff;
            font-size: 45px;
            font-weight: bold;
            cursor: pointer;
            z-index: 10;
            transition: 0.3s;
            text-shadow: 0 0 10px rgba(0,0,0,0.8);
            padding: 10px;
            min-width: 50px;
            min-height: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .close:hover {
            color: #ff4444;
            transform: rotate(90deg);
        }

        /* دکمه‌های قبلی و بعدی */
        .prev, .next {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            background: rgba(255,255,255,0.15);
            backdrop-filter: blur(5px);
            color: white;
            font-size: 35px;
            padding: 18px 22px;
            border: 2px solid rgba(255,255,255,0.2);
            cursor: pointer;
            z-index: 10;
            border-radius: 50%;
            transition: 0.3s;
            min-width: 60px;
            min-height: 60px;
            display: flex;
            align-items: center;
            justify-content: center;
            -webkit-tap-highlight-color: transparent;
        }
        .prev { left: 25px; }
        .next { right: 25px; }
        .prev:hover, .next:hover {
            background: rgba(255,255,255,0.3);
            border-color: white;
        }

        /* شمارنده */
        .counter {
            position: absolute;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%);
            color: #fff;
            font-size: 16px;
            background: rgba(0,0,0,0.7);
            padding: 8px 20px;
            border-radius: 30px;
            backdrop-filter: blur(5px);
            border: 1px solid rgba(255,255,255,0.2);
            z-index: 10;
            font-weight: bold;
            letter-spacing: 1px;
        }

        /* دکمه‌های زوم */
        .zoom-controls {
            position: absolute;
            bottom: 90px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 12px;
            z-index: 10;
        }
        .zoom-controls button {
            background: rgba(255,255,255,0.1);
            backdrop-filter: blur(5px);
            color: white;
            border: 1px solid rgba(255,255,255,0.3);
            padding: 10px 20px;
            font-size: 22px;
            border-radius: 12px;
            cursor: pointer;
            transition: 0.3s;
            min-width: 50px;
            min-height: 50px;
            -webkit-tap-highlight-color: transparent;
        }
        .zoom-controls button:hover {
            background: rgba(255,255,255,0.3);
            transform: scale(1.1);
        }
        .zoom-controls button:active {
            transform: scale(0.95);
        }

        /* ===== ریسپانسیو برای موبایل ===== */
        @media (max-width: 768px) {
            .image-container {
                width: 95%;
                height: 60%;
            }
            .prev, .next {
                font-size: 25px;
                padding: 12px 16px;
                min-width: 50px;
                min-height: 50px;
            }
            .prev { left: 10px; }
            .next { right: 10px; }
            .close {
                top: 15px;
                right: 20px;
                font-size: 35px;
            }
            .thumb {
                width: 60px;
                height: 60px;
            }
            .zoom-controls {
                bottom: 70px;
                gap: 8px;
            }
            .zoom-controls button {
                padding: 8px 14px;
                font-size: 18px;
                min-width: 40px;
                min-height: 40px;
            }
        }

        @media (max-width: 480px) {
            .thumb {
                width: 50px;
                height: 50px;
            }
            .prev, .next {
                font-size: 20px;
                padding: 8px 12px;
                min-width: 40px;
                min-height: 40px;
            }
            .zoom-controls button {
                font-size: 16px;
                padding: 6px 12px;
                min-width: 35px;
                min-height: 35px;
            }
        }
        /* ============================================ */
/* ریسپانسیو برای موبایل و تبلت */
/* ============================================ */

/* ===== تبلت و موبایل بزرگ ===== */
@media (max-width: 992px) {
    .container {
        padding: 0 15px;
    }
    
    .gallery-section {
        padding: 15px;
    }
    
    .main-image {
        max-height: 400px;
    }
    
    .thumb {
        width: 70px;
        height: 70px;
    }
}

/* ===== موبایل (تا 768px) ===== */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    /* گالری */
    .gallery-section {
        padding: 10px;
    }
    
    .main-image {
        max-height: 300px;
        border-radius: 8px;
    }
    
    .thumbnails {
        gap: 8px;
        margin-top: 10px;
    }
    
    .thumb {
        width: 60px;
        height: 60px;
        border-radius: 6px;
        border-width: 2px;
    }
    
    /* اطلاعات محصول */
    .info-section {
        padding: 15px 10px;
    }
    
    .product-title {
        font-size: 1.5rem !important;
        line-height: 1.3;
    }
    
    .price-value {
        font-size: 1.3rem !important;
    }
    
    .description {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    /* تب‌ها */
    .tabs-header {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 80px;
        padding: 10px 8px !important;
        font-size: 0.85rem !important;
        text-align: center;
        white-space: nowrap;
    }
    
    .tab-content {
        padding: 15px 10px !important;
    }
    
    .tab-content h3 {
        font-size: 1.1rem;
    }
    
    .tab-content p {
        font-size: 0.95rem;
        line-height: 1.7;
    }
    
    /* جدول مشخصات */
    .specs-table {
        font-size: 0.9rem;
    }
    
    .specs-table td {
        padding: 8px 10px !important;
        word-break: break-word;
    }
    
    .specs-table td:first-child {
        min-width: 80px;
        font-weight: bold;
    }
    
    /* فرم نظرات */
    .comments-section {
        flex-direction: column !important;
        gap: 20px;
    }
    
    .comments-form-wrapper,
    .comments-list-wrapper {
        width: 100% !important;
        padding: 0 !important;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-control {
        font-size: 0.95rem !important;
        padding: 10px 12px !important;
    }
    
    .captcha {
        max-width: 100%;
        height: auto;
        margin: 10px 0;
    }
    
    /* دکمه ارسال */
    .btn {
        padding: 12px !important;
        font-size: 1rem !important;
    }
    
    /* لایت‌باکس موبایل */
    .image-container {
        width: 95% !important;
        height: 55% !important;
    }
    
    .prev, .next {
        font-size: 20px !important;
        padding: 10px 14px !important;
        min-width: 40px !important;
        min-height: 40px !important;
    }
    
    .prev { left: 8px !important; }
    .next { right: 8px !important; }
    
    .close {
        top: 12px !important;
        right: 15px !important;
        font-size: 30px !important;
        padding: 8px !important;
        min-width: 40px !important;
        min-height: 40px !important;
    }
    
    .counter {
        font-size: 14px !important;
        padding: 5px 15px !important;
        bottom: 20px !important;
    }
    
    .zoom-controls {
        bottom: 60px !important;
        gap: 6px !important;
    }
    
    .zoom-controls button {
        padding: 6px 12px !important;
        font-size: 16px !important;
        min-width: 35px !important;
        min-height: 35px !important;
    }
}

/* ===== موبایل خیلی کوچک (تا 480px) ===== */
@media (max-width: 480px) {
    .container {
        padding: 0 8px;
    }
    
    .main-image {
        max-height: 220px;
        border-radius: 6px;
    }
    
    .thumb {
        width: 50px;
        height: 50px;
        border-radius: 4px;
    }
    
    .thumbnails {
        gap: 5px;
        margin-top: 8px;
    }
    
    .product-title {
        font-size: 1.2rem !important;
    }
    
    .price-value {
        font-size: 1.1rem !important;
    }
    
    .description {
        font-size: 0.9rem;
    }
    
    .tab-btn {
        font-size: 0.75rem !important;
        padding: 8px 5px !important;
        min-width: 60px;
    }
    
    .tab-content {
        padding: 12px 8px !important;
    }
    
    .tab-content h3 {
        font-size: 1rem;
    }
    
    .tab-content p {
        font-size: 0.9rem;
    }
    
    .specs-table {
        font-size: 0.8rem;
    }
    
    .specs-table td {
        padding: 6px 8px !important;
    }
    
    .form-control {
        font-size: 0.9rem !important;
        padding: 8px 10px !important;
    }
    
    .comments-form-wrapper h3,
    .comments-list-wrapper h3 {
        font-size: 1rem !important;
    }
    
    /* لایت‌باکس موبایل خیلی کوچک */
    .image-container {
        height: 50% !important;
    }
    
    .prev, .next {
        font-size: 16px !important;
        padding: 8px 10px !important;
        min-width: 32px !important;
        min-height: 32px !important;
    }
    
    .close {
        font-size: 25px !important;
        top: 10px !important;
        right: 12px !important;
        min-width: 32px !important;
        min-height: 32px !important;
    }
    
    .counter {
        font-size: 12px !important;
        padding: 4px 12px !important;
        bottom: 15px !important;
    }
    
    .zoom-controls {
        bottom: 50px !important;
        gap: 4px !important;
    }
    
    .zoom-controls button {
        font-size: 14px !important;
        padding: 5px 10px !important;
        min-width: 30px !important;
        min-height: 30px !important;
    }
}

/* ===== تبلت (حالت افقی) ===== */
@media (min-width: 769px) and (max-width: 992px) {
    .container {
        max-width: 720px;
    }
    
    .main-image {
        max-height: 350px;
    }
    
    .thumb {
        width: 75px;
        height: 75px;
    }
}

/* ===== رفع مشکل اسکرول در موبایل ===== */
@media (max-width: 768px) {
    body.lightbox-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }
    
    .lightbox {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
    }
}

/* ===== بهینه‌سازی لمسی برای موبایل ===== */
@media (pointer: coarse) {
    .thumb,
    .tab-btn,
    .btn,
    .close,
    .prev,
    .next,
    .zoom-controls button {
        min-height: 44px; /* حداقل اندازه برای لمس راحت */
        min-width: 44px;
    }
    
    .thumb {
        min-height: 50px;
        min-width: 50px;
    }
    
    .tab-btn {
        padding: 12px 10px !important;
    }
}