/**
 * تصميم أيقونة السلة السريعة ونافذة التسجيل
 */

/* أيقونة السلة على بطاقة المنتج */
.product-card {
    position: relative;
}

.quick-add-to-cart-btn {
    position: absolute;
    bottom: 15px;
    left: 15px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff7a00 0%, #ff5722 100%);
    border: none;
    color: white;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 122, 0, 0.4);
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 1;
    transform: scale(1);
}

.quick-add-to-cart-btn:hover {
    background: linear-gradient(135deg, #ff5722 0%, #ff7a00 100%);
    box-shadow: 0 6px 20px rgba(255, 122, 0, 0.6);
    transform: scale(1.1);
}

.quick-add-to-cart-btn:active {
    transform: scale(0.95);
}

.quick-add-to-cart-btn i {
    transition: transform 0.3s ease;
}

.quick-add-to-cart-btn:hover i {
    transform: rotate(15deg);
}

/* للصفحات ذات العرض القائمة */
.product-list-item .quick-add-to-cart-btn {
    bottom: 50%;
    transform: translateY(50%) scale(1);
    opacity: 1;
}

/* نافذة التسجيل السريع المنبثقة */
.quick-register-modal .modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.quick-register-modal .modal-header {
    background: linear-gradient(135deg, #ff7a00 0%, #ff5722 100%);
    color: white;
    border-radius: 20px 20px 0 0;
    border: none;
    padding: 1.5rem;
}

.quick-register-modal .modal-title {
    font-weight: 700;
    font-size: 1.3rem;
}

.quick-register-modal .btn-close {
    filter: brightness(0) invert(1);
}

.quick-register-modal .modal-body {
    padding: 2rem;
}

.quick-register-modal .form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.quick-register-modal .form-control {
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.quick-register-modal .form-control:focus {
    border-color: #ff7a00;
    box-shadow: 0 0 0 0.2rem rgba(255, 122, 0, 0.25);
}

.quick-register-modal .input-group-text {
    background-color: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-left: none;
    border-radius: 0 10px 10px 0;
}

.quick-register-modal .btn-primary {
    background: linear-gradient(135deg, #ff7a00 0%, #ff5722 100%);
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.quick-register-modal .btn-primary:hover {
    background: linear-gradient(135deg, #ff5722 0%, #ff7a00 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 122, 0, 0.4);
}

.quick-register-modal .alert {
    border-radius: 10px;
    border: none;
}

/* إشعارات Toast المخصصة */
.custom-toast {
    position: fixed;
    top: 20px;
    left: 20px;
    min-width: 300px;
    max-width: 400px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    padding: 1rem 1.5rem;
    z-index: 9999;
    display: flex;
    align-items: center;
}

.custom-toast-content {
    display: flex;
    align-items: center;
    width: 100%;
}

.custom-toast-success {
    border-right: 4px solid #28a745;
}

.custom-toast-danger {
    border-right: 4px solid #dc3545;
}

.custom-toast-info {
    border-right: 4px solid #17a2b8;
}

.custom-toast i,
.custom-toast .spinner-border {
    font-size: 1.2rem;
    margin-left: 0.5rem;
}

.custom-toast-success i {
    color: #28a745;
}

.custom-toast-danger i {
    color: #dc3545;
}

.custom-toast-info i {
    color: #17a2b8;
}

/* إشعار المنتج المضاف للسلة */
.cart-notification {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    z-index: 9998;
    max-width: 400px;
}

.cart-notification-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-notification-image {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.cart-notification-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-notification-details {
    flex: 1;
}

.cart-notification-details h6 {
    color: #28a745;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.cart-notification-details p {
    font-size: 0.95rem;
    color: #333;
}

.cart-notification-actions .btn {
    white-space: nowrap;
}

/* عداد السلة */
.cart-count-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.cart-count-animate {
    animation: cartCountPulse 0.3s ease;
}

@keyframes cartCountPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
}

/* تحسينات للأجهزة المحمولة */
@media (max-width: 768px) {
    .quick-add-to-cart-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        bottom: 10px;
        left: 10px;
    }
    
    .cart-notification {
        bottom: 10px;
        left: 10px;
        right: 10px;
        max-width: calc(100% - 20px);
    }
    
    .custom-toast {
        top: 10px;
        left: 10px;
        right: 10px;
        min-width: auto;
        max-width: calc(100% - 20px);
    }
    
    .cart-notification-content {
        flex-direction: column;
        text-align: center;
    }
    
    .cart-notification-image {
        width: 60px;
        height: 60px;
    }
}

/* تأثيرات الحركة */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.animate__animated {
    animation-duration: 0.5s;
}

.animate__fadeInUp {
    animation-name: fadeInUp;
}

.animate__fadeOutDown {
    animation-name: fadeOutDown;
}

.animate__fadeInRight {
    animation-name: fadeInRight;
}

.animate__fadeOutRight {
    animation-name: fadeOutRight;
}

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

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

/* تحسين مظهر البطاقة عند التمرير */
.product-card {
    transition: all 0.3s ease;
}

.product-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* للصفحات التي تحتوي على صورة placeholder */
.placeholder-image {
    position: relative;
}

.placeholder-image .quick-add-to-cart-btn {
    opacity: 1;
}

/* حاوية الزرّين (اتصال + واتساب) */
.call-price-buttons {
    position: absolute;
    bottom: 15px;
    left: 15px;
    display: flex;
    gap: 10px;
    z-index: 10;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.product-card:hover .call-price-buttons {
    opacity: 1;
    transform: scale(1);
}

/* زر الاتصال المباشر (أزرق) */
.quick-call-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    color: white;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
    transition: all 0.3s ease;
    text-decoration: none;
}

.quick-call-btn:hover {
    background: linear-gradient(135deg, #0056b3 0%, #007bff 100%);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.6);
    transform: scale(1.1);
    color: white;
}

.quick-call-btn:active {
    transform: scale(0.95);
}

.quick-call-btn i {
    transition: transform 0.3s ease;
}

.quick-call-btn:hover i {
    transform: rotate(15deg) scale(1.1);
}

/* زر واتساب (أخضر) */
.quick-whatsapp-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border: none;
    color: white;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    text-decoration: none;
}

.quick-whatsapp-btn:hover {
    background: linear-gradient(135deg, #128C7E 0%, #25D366 100%);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
    transform: scale(1.1);
    color: white;
}

.quick-whatsapp-btn:active {
    transform: scale(0.95);
}

.quick-whatsapp-btn i {
    transition: transform 0.3s ease;
}

.quick-whatsapp-btn:hover i {
    transform: rotate(15deg) scale(1.1);
}

/* زر معطل (بدون رقم هاتف) */
.quick-call-btn.disabled,
.quick-call-btn:disabled {
    background: linear-gradient(135deg, #999 0%, #666 100%);
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

.quick-call-btn.disabled:hover,
.quick-call-btn:disabled:hover {
    transform: scale(1);
    box-shadow: none;
}

/* للصفحات ذات العرض القائمة */
.product-list-item .call-price-buttons {
    bottom: 50%;
    transform: translateY(50%);
}

/* تحسينات للأجهزة المحمولة */
@media (max-width: 768px) {
    .call-price-buttons {
        bottom: 10px;
        left: 10px;
        gap: 8px;
    }
    
    .quick-call-btn,
    .quick-whatsapp-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}
