/* نافذة الشراء السريع */
.quick-buy-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.quick-buy-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quick-buy-content {
    background: var(--bg-card, white);
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
    position: relative;
    border: 1px solid var(--border-color, #e2e8f0);
    transition: background-color 0.3s ease;
}

.quick-buy-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 20px 20px 0 0;
    position: relative;
}

.quick-buy-header h2 {
    margin: 0;
    font-size: 1.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.quick-buy-close {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.quick-buy-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.quick-buy-body {
    padding: 2rem;
}

/* ملخص المنتج */
.product-summary {
    background: var(--bg-tertiary, #f8f9fa);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border-right: 4px solid #667eea;
    transition: background-color 0.3s ease;
}

.product-summary-header {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.product-summary-image {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
}

.product-summary-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--text-primary, #2d3748);
}

.product-summary-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

.product-summary-price .old-price {
    font-size: 1rem;
    color: #999;
    text-decoration: line-through;
    margin-left: 0.5rem;
}

.product-summary-details {
    background: var(--bg-card, white);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    transition: background-color 0.3s ease;
}

.product-summary-details p {
    margin: 0.5rem 0;
    color: var(--text-primary, #4a5568);
    display: flex;
    justify-content: space-between;
}

.product-summary-details strong {
    color: var(--text-primary, #2d3748);
}

/* نموذج الطلب */
.quick-buy-form .form-group {
    margin-bottom: 1.5rem;
}

.quick-buy-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary, #2d3748);
    font-size: 0.95rem;
}

.quick-buy-form label .required {
    color: #e53e3e;
    margin-right: 0.25rem;
}

.quick-buy-form input,
.quick-buy-form textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    background: var(--bg-card, white);
    color: var(--text-primary, #2d3748);
}

.quick-buy-form input:focus,
.quick-buy-form textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.quick-buy-form textarea {
    resize: vertical;
    min-height: 80px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #667eea;
    background: var(--bg-card, white);
    color: #667eea;
    border-radius: 8px;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

.quantity-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.quantity-input {
    width: 80px;
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
}

/* زر الإرسال */
.quick-buy-submit {
    width: 100%;
    padding: 1.25rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2rem;
}

.quick-buy-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.quick-buy-submit:active {
    transform: translateY(0);
}

.quick-buy-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.quick-buy-submit .spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* رسائل النجاح والخطأ */
.quick-buy-alert {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quick-buy-alert.success {
    background: #d4edda;
    color: #155724;
    border-right: 4px solid #28a745;
}

.quick-buy-alert.error {
    background: #f8d7da;
    color: #721c24;
    border-right: 4px solid #dc3545;
}

.quick-buy-alert .icon {
    font-size: 1.5rem;
}

/* زر الشراء السريع في صفحة المنتج */
.btn-quick-buy {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-quick-buy:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-quick-buy:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .quick-buy-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .quick-buy-header {
        padding: 1.5rem;
    }
    
    .quick-buy-header h2 {
        font-size: 1.5rem;
    }
    
    .quick-buy-body {
        padding: 1.5rem;
    }
    
    .product-summary-image {
        width: 60px;
        height: 60px;
    }
    
    .product-summary-price {
        font-size: 1.25rem;
    }
}
