/* استایل‌های انتخاب محصول */
.product-selector-container {
    margin: 10px 0;
}

.product-selector-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.product-selector-btn:hover {
    background: #005a87;
}

.product-selector-btn .selected-product {
    font-weight: bold;
}

/* مودال انتخاب محصول */
.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-modal-content {
    background: white;
    border-radius: 10px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    direction: rtl;
}

.product-modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-modal-header h3 {
    margin: 0;
    color: #333;
}

.close {
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

.product-modal-body {
    padding: 20px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.product-item {
    border: 2px solid #eee;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.product-item:hover {
    border-color: #0073aa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.product-image {
    margin-bottom: 10px;
}

.product-image img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

.product-info h4 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 14px;
}

.product-info p {
    margin: 0;
    color: #666;
    font-size: 12px;
}

/* استایل‌های تکرار فرم */
.form-repeat-container {
    margin: 20px 0;
    text-align: center;
}

.form-repeat-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.form-repeat-btn:hover {
    background: #218838;
}

.form-repeat-btn i {
    margin-left: 5px;
}

/* پیام‌های سیستم */
.irannotrika-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

.irannotrika-message.success {
    background: #28a745;
}

.irannotrika-message.error {
    background: #dc3545;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* استایل‌های ریسپانسیو */
@media (max-width: 768px) {
    .product-modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .product-modal-header {
        padding: 15px;
    }
    
    .product-modal-body {
        padding: 15px;
    }
    
    .irannotrika-message {
        right: 10px;
        left: 10px;
        text-align: center;
    }
}

/* استایل‌های اضافی برای سازگاری با گرویتی فرم */
.gform_wrapper .product-selector-container {
    margin: 10px 0;
}

.gform_wrapper .form-repeat-container {
    margin: 20px 0;
}

/* بهبود نمایش در حالت RTL */
[dir="rtl"] .product-modal-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .form-repeat-btn i {
    margin-left: 0;
    margin-right: 5px;
}
