/* ========================
   تحسينات صفحة السلة
========================= */

/* صفحة السلة */
.cart-page {
    padding-top: 20px;
    padding-bottom: 100px;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.page-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 700;
}

.page-description {
    color: #666;
    font-size: 1.2rem;
}

/* سلة فارغة */
.empty-cart {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
    border: 2px dashed #eee;
}

.empty-cart-icon {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 25px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.empty-cart h3 {
    font-size: 1.8rem;
    color: #666;
    margin-bottom: 15px;
    font-weight: 600;
}

.empty-cart p {
    color: #999;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 12px;
    font-family: 'Cairo', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(102, 101, 100, 0.2);
}

/* عناصر السلة */
.cart-items {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.cart-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 0.5fr;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-weight: 600;
}

.cart-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 0.5fr;
    padding: 25px 20px;
    border-bottom: 1px solid #eee;
    align-items: center;
    transition: all 0.3s ease;
}

.cart-item:hover {
    background-color: #f9f9f9;
}

.item-product {
    display: flex;
    align-items: center;
    gap: 20px;
}

.item-image {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 12px;
    border: 2px solid #eee;
    padding: 10px;
    background: white;
    transition: all 0.3s ease;
}

.cart-item:hover .item-image {
    transform: scale(1.05);
    border-color: var(--primary-color);
}

.item-info {
    flex: 1;
}

.item-name {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    line-height: 1.4;
}

.item-price {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.item-quantity {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.quantity-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.quantity-value {
    font-weight: 700;
    font-size: 1.2rem;
    color: #333;
    min-width: 40px;
    text-align: center;
}

.item-total {
    font-weight: 700;
    color: #000;
    font-size: 1.3rem;
}

.item-remove .remove-item {
    background: transparent;
    border: none;
    color: #ff6b6b;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-remove .remove-item:hover {
    background: #ff6b6b;
    color: white;
    transform: rotate(90deg);
}

/* قسم الكوبون */
.coupon-section {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    margin-top: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border: 2px solid #f0f0f0;
}

.coupon-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.coupon-section h3 i {
    color: var(--primary-color);
}

.coupon-input {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.coupon-input input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #ddd;
    border-radius: 12px;
    font-family: 'Cairo', sans-serif;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.coupon-input input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 101, 100, 0.1);
}

.coupon-input input:disabled {
    background: #f8f9fa;
    color: #666;
    cursor: not-allowed;
}

.apply-coupon {
    padding: 15px 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.apply-coupon:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 101, 100, 0.2);
}

.apply-coupon:disabled {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    cursor: not-allowed;
}

.coupon-success {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-radius: 12px;
    border: 2px solid #28a745;
    margin-top: 15px;
}

.success-message {
    color: #155724;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.success-message i {
    color: #28a745;
}

.remove-coupon {
    padding: 8px 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.remove-coupon:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.coupon-info {
    padding: 15px;
    background: #fff3cd;
    border-radius: 12px;
    border: 2px solid #ffc107;
    color: #856404;
    margin-top: 15px;
}

.coupon-info strong {
    color: #333;
}

.coupon-hint {
    font-size: 0.9rem;
    color: #666;
    margin-top: 8px;
    font-style: italic;
}

/* ملخص الطلب */
.cart-summary {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    margin-top: 30px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
}

.cart-summary h3 {
    color: #333;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-color);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-summary h3 i {
    color: var(--primary-color);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    font-size: 1.1rem;
}

.summary-row.discount {
    color: #28a745;
}

.summary-row.total {
    font-size: 1.4rem;
    font-weight: 700;
    color: #000;
    border-top: 3px solid #000;
    border-bottom: none;
    margin-top: 15px;
    padding-top: 20px;
}

.summary-value {
    font-weight: 700;
    color: #000;
}

.summary-row.discount .summary-value {
    color: #28a745;
}

.summary-row.total .summary-value {
    color: var(--primary-color);
}

.checkout-btn {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, 
        #25D366 0%, 
        #1DA851 25%, 
        #128C7E 75%, 
        #0C6B5F 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 1.3rem;
    font-weight: 800;
    cursor: pointer;
    margin-top: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    box-shadow: 
        0 10px 20px rgba(37, 211, 102, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* تأثير اللمعان المتحرك */
.checkout-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.7s ease;
}

/* نقطة تأثير النقر */
.checkout-btn::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

/* أيقونة الواتساب */
.checkout-btn i {
    font-size: 1.8rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
    animation: pulse 2s infinite;
}

/* تأثيرات الـ Hover */
.checkout-btn:hover {
    background: linear-gradient(135deg, 
        #128C7E 0%, 
        #1DA851 40%, 
        #25D366 80%, 
        #2BFF88 100%);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(37, 211, 102, 0.4),
        0 0 30px rgba(37, 211, 102, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.checkout-btn:hover::before {
    left: 100%;
}

.checkout-btn:hover i {
    transform: scale(1.2) rotate(10deg);
    animation: none;
}

/* تأثير النقر */
.checkout-btn:active {
    transform: translateY(-2px) scale(0.98);
    transition: all 0.1s ease;
}

.checkout-btn:active::after {
    width: 300px;
    height: 300px;
}

/* تأثير النقر (بعد النقر) */
.checkout-btn.clicked {
    animation: successPulse 0.6s ease;
    background: linear-gradient(135deg, #0C6B5F, #1DA851);
}

/* إضافة أيقونة شيك بعد النقر */
.checkout-btn.clicked i {
    animation: checkmark 0.5s ease;
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes checkmark {
    0% { transform: scale(0); }
    70% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* التأثيرات على الأجهزة المحمولة */
@media (max-width: 768px) {
    .checkout-btn {
        padding: 18px;
        font-size: 1.1rem;
        border-radius: 18px;
    }
    
    .checkout-btn i {
        font-size: 1.6rem;
    }
}

/* إضافة تأثير إضاءة عند التركيز */
.checkout-btn:focus {
    outline: none;
    box-shadow: 
        0 0 0 3px rgba(37, 211, 102, 0.3),
        0 20px 40px rgba(37, 211, 102, 0.4);
}
.checkout-note {
    text-align: center;
    color: #666;
    font-size: 0.95rem;
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    line-height: 1.6;
}

.checkout-note p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.checkout-note p:last-child {
    margin-bottom: 0;
}

.checkout-note i {
    color: var(--primary-color);
    min-width: 20px;
}

/* المنتجات المقترحة */
.suggested-products {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 3px solid #eee;
}

.suggested-products .section-title {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: #333;
    text-align: center;
    font-weight: 700;
}

.no-suggested-products {
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 12px;
}

.error {
    text-align: center;
    color: #dc3545;
    padding: 20px;
    background: #f8d7da;
    border-radius: 12px;
    border: 2px solid #f5c6cb;
}

/* تحسينات بطاقات المنتجات المقترحة */
#suggestedProducts .product-card {
    position: relative;
}

.product-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 1;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.product-footer .add-to-cart {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.product-footer .add-to-cart:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: rotate(90deg) scale(1.1);
}

/* زر الواتساب العائم */
.whatsapp-float {
    position: fixed;
    bottom: 90px;
    left: 20px;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.8rem;
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4);
    z-index: 998;
    animation: float 3s ease-in-out infinite;
    text-decoration: none;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    background: #128C7E;
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 15px 35px rgba(37, 211, 102, 0.6);
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-15px) rotate(5deg); }
}

/* تحسين التجاوب للجوال */
@media (max-width: 992px) {
    .cart-header, 
    .cart-item {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .cart-header {
        display: none;
    }
    
    .cart-item {
        position: relative;
        padding: 20px;
        border: 1px solid #eee;
        border-radius: 15px;
        margin-bottom: 15px;
    }
    
    .item-remove {
        position: absolute;
        top: 15px;
        left: 15px;
    }
    
    .item-price::before {
        content: "السعر: ";
        color: #666;
        margin-left: 5px;
        font-weight: normal;
    }
    
    .item-total::before {
        content: "الإجمالي: ";
        color: #666;
        margin-left: 5px;
        font-weight: normal;
    }
}

@media (max-width: 768px) {
    .page-header {
        padding: 20px 15px;
        margin-bottom: 30px;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .page-description {
        font-size: 1.1rem;
    }
    
    .coupon-input {
        flex-direction: column;
    }
    
    .apply-coupon {
        width: 100%;
    }
    
    .coupon-success {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .cart-summary {
        padding: 20px;
    }
    
    .summary-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .summary-value {
        align-self: flex-end;
    }
    
    .whatsapp-float {
        bottom: 80px;
        left: 15px;
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .empty-cart {
        padding: 60px 20px;
    }
    
    .empty-cart-icon {
        font-size: 3rem;
    }
    
    .empty-cart h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .item-product {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .item-image {
        width: 80px;
        height: 80px;
    }
    
    .item-quantity {
        justify-content: center;
    }
    
    .quantity-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .checkout-btn {
        padding: 15px;
        font-size: 1.1rem;
    }
    
    .checkout-note {
        font-size: 0.85rem;
        padding: 15px;
    }
}
