/* ===== Modal تفاصيل المنتج ===== */
.product-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.product-modal.active {
    display: flex;
}

.product-modal-content {
    background: var(--card-color);
    border-radius: 20px;
    /* تقليل الـ padding من 25px إلى 18px */
    padding: 18px;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    position: relative;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.product-modal-close {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 0, 0, 0.1);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #e74c3c;
    transition: all 0.3s ease;
}

.product-modal-close:hover {
    background: rgba(255, 0, 0, 0.2);
    transform: rotate(90deg);
}

.product-modal-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 15px;
    /* تقليل المسافة من 20px إلى 12px */
    margin-bottom: 12px;
}

.product-modal-title {
    font-size: 1.8rem;
    font-weight: 700;
    /* تقليل المسافة من 15px إلى 10px */
    margin-bottom: 10px;
    color: var(--text-primary);
    text-align: center;
}

.product-modal-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    /* تقليل المسافة من 15px إلى 10px */
    margin-bottom: 10px;
    text-align: center;
}

.product-modal-description {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    /* تقليل المسافة من 20px إلى 12px */
    margin-bottom: 12px;
    font-weight: 500;
    /* زيادة وزن الخط للوضوح */
}

.product-modal-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* تقليل المسافة من 20px إلى 12px */
    margin-bottom: 12px;
    /* تقليل الـ padding من 15px إلى 10px */
    padding: 10px;
    background: rgba(0, 0, 0, 0.08);
    /* خلفية أغمق قليلاً للتباين */
    border-radius: 12px;
}

.product-modal-info-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.product-modal-info-value {
    font-weight: 700;
    color: var(--text-primary);
}

.product-modal-actions {
    display: flex;
    /* زيادة الفراغ بين الأزرار إلى 25px للراحة القصوى */
    gap: 25px;
    /* تقليل المسافة العلوية من 20px إلى 15px */
    margin-top: 15px;
}

.product-modal-actions .btn {
    flex: 1;
}

/* تحسين responsive للموبايل */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        /* 3 منتجات في صف على التابلت */
        gap: 10px;
    }

    .product-card {
        padding: 8px;
    }

    .product-image {
        height: 120px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        /* 3 منتجات في صف على الموبايل */
        gap: 8px;
    }

    .product-card {
        padding: 6px;
    }

    .product-name {
        font-size: 0.75rem;
    }

    .product-price {
        font-size: 0.85rem;
    }

    .product-image {
        height: 100px;
    }
}