/**
 * Yogneer Cart System Styles
 */

/* ===== CART ICON IN NAVBAR ===== */
.cart-nav-item {
    position: relative;
    margin-left: 15px;
}

.cart-nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(145deg, #146b8a, #0e526b);
    color: white !important;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(13, 96, 121, 0.18);
}

.cart-nav-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(13, 96, 121, 0.25);
    color: white !important;
}

.cart-nav-link::before {
    display: none !important;
}

.cart-nav-link i {
    font-size: 1.1rem;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(255, 71, 87, 0.4);
    animation: badge-pulse 0.3s ease;
}

@keyframes badge-pulse {
    0% { transform: scale(0.5); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ===== CART MODAL ===== */
.cart-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-modal {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 450px;
    height: 100%;
    background: white;
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
}

.cart-modal.active {
    transform: translateX(0);
}

.cart-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    background: linear-gradient(135deg, #004aad 0%, #0077cc 100%);
    color: white;
}

.cart-modal-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-modal-header h2 i {
    font-size: 1.2rem;
}

.close-cart-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-cart-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.cart-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Empty Cart Message */
.empty-cart-message {
    text-align: center;
    padding: 60px 20px;
}

.empty-cart-message i {
    font-size: 4rem;
    color: #d1d5db;
    margin-bottom: 20px;
}

.empty-cart-message h3 {
    font-size: 1.4rem;
    color: #374151;
    margin-bottom: 10px;
}

.empty-cart-message p {
    color: #6b7280;
    margin-bottom: 25px;
}

.empty-cart-message .shop-now-btn {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #004aad 0%, #0077cc 100%);
    color: white;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.empty-cart-message .shop-now-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 74, 173, 0.3);
}

/* Cart Items */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.cart-item:hover {
    border-color: #0077cc;
    box-shadow: 0 4px 12px rgba(0, 74, 173, 0.1);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: white;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 8px;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.qty-btn:hover {
    background: #004aad;
    border-color: #004aad;
    color: white;
}

.qty-btn i {
    font-size: 0.7rem;
}

.qty-value {
    font-weight: 600;
    color: #1f2937;
    min-width: 25px;
    text-align: center;
}

.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
}

.cart-item-total {
    font-size: 1rem;
    font-weight: 700;
    color: #004aad;
}

.remove-btn {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.remove-btn:hover {
    background: #fef2f2;
}

.remove-btn i {
    font-size: 0.75rem;
}

/* Cart Modal Footer */
.cart-modal-footer {
    padding: 20px 25px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.cart-total-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.cart-total-label {
    font-size: 1rem;
    color: #6b7280;
}

.cart-total-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #004aad;
}

.order-now-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #25D366 0%, #20b858 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.order-now-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.4);
}

.order-now-btn i {
    font-size: 1.2rem;
}

/* ===== TOAST NOTIFICATIONS ===== */
.cart-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: white;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10001;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.cart-toast i {
    font-size: 1.3rem;
}

.toast-success i {
    color: #10b981;
}

.toast-error i {
    color: #ef4444;
}

.toast-info i {
    color: #3b82f6;
}

/* ===== ADD TO CART BUTTON ===== */
.add-to-cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #004aad 0%, #0077cc 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 74, 173, 0.2);
    margin-top: 15px;
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 74, 173, 0.3);
}

.add-to-cart-btn:active {
    transform: translateY(0);
}

.add-to-cart-btn i {
    font-size: 0.85rem;
}

/* ===== WHATSAPP FLOATING BUTTON ===== */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25D366 0%, #20b858 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.8rem;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    z-index: 999;
    transition: all 0.3s ease;
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.5);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .cart-modal {
        max-width: 100%;
    }
    
    .cart-item {
        padding: 12px;
    }
    
    .cart-item-image {
        width: 65px;
        height: 65px;
    }
    
    .cart-item-name {
        font-size: 0.85rem;
    }
    
    .whatsapp-float {
        width: 55px;
        height: 55px;
        font-size: 1.5rem;
        bottom: 20px;
        right: 20px;
    }
    
    .cart-toast {
        bottom: 20px;
        left: 20px;
        right: 20px;
        transform: translateX(0) translateY(100px);
    }
    
    .cart-toast.show {
        transform: translateX(0) translateY(0);
    }
}

/* Extra responsive fixes for cart */
@media (max-width: 400px) {
    .cart-modal-header {
        padding: 15px 20px;
    }
    
    .cart-modal-header h2 {
        font-size: 1.2rem;
    }
    
    .cart-modal-body {
        padding: 15px;
    }
    
    .cart-modal-footer {
        padding: 15px;
    }
    
    .cart-item {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .cart-item-image {
        width: 55px;
        height: 55px;
    }
    
    .cart-item-details {
        flex: 1;
        min-width: calc(100% - 70px);
    }
    
    .cart-item-actions {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-top: 5px;
        padding-left: 70px;
    }
    
    .order-now-btn {
        padding: 14px;
        font-size: 1rem;
    }
    
    .cart-total-amount {
        font-size: 1.3rem;
    }
    
    .empty-cart-message {
        padding: 40px 15px;
    }
    
    .empty-cart-message i {
        font-size: 3rem;
    }
    
    .empty-cart-message h3 {
        font-size: 1.2rem;
    }
    
    .cart-nav-item {
        margin-left: 10px;
    }
    
    .cart-nav-link {
        width: 38px;
        height: 38px;
    }
    
    .cart-nav-link i {
        font-size: 1rem;
    }
    
    .cart-badge {
        min-width: 18px;
        height: 18px;
        font-size: 0.65rem;
    }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .cart-modal {
        max-height: 100vh;
        overflow-y: auto;
    }
    
    .cart-modal-body {
        max-height: 50vh;
        overflow-y: auto;
    }
}

/* Tablet responsive */
@media (min-width: 481px) and (max-width: 768px) {
    .cart-modal {
        max-width: 400px;
    }
    
    .cart-item-image {
        width: 70px;
        height: 70px;
    }
    
    .whatsapp-float {
        width: 58px;
        height: 58px;
        font-size: 1.6rem;
    }
}
