/* Cart Drawer CSS */
.cart-drawer {
    position: fixed;
    top: 0;
    right: -450px;
    /* Hidden by default */
    width: 400px;
    height: 100%;
    background: #fff;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    transition: right 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
}

@media (max-width: 576px) {
    .cart-drawer {
        width: 100%;
        right: -100%;
    }
}

.cart-drawer.open {
    right: 0;
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Header */
.cart-header {
    padding: 20px 25px;
    border-bottom: 1px solid #f0e6da;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fdfaf5;
}

.cart-header h2 {
    font-size: 1.5rem;
    margin: 0;
    color: #916b43;
    font-weight: 600;
}

.close-cart {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #916b43;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.close-cart:hover {
    transform: rotate(90deg);
}

/* Items List */
.cart-items-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px 25px;
}

.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f9f4ee;
    animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cart-item-img {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #f0e6da;
}

.cart-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.cart-item-price {
    color: #916b43;
    font-weight: 700;
    margin-bottom: 10px;
    display: block;
}

.cart-item-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quantity-selector {
    display: flex;
    align-items: center;
    background: #fdfaf5;
    border: 1px solid #f0e6da;
    border-radius: 50px;
    padding: 2px 10px;
}

.qty-btn {
    background: none;
    border: none;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #916b43;
    font-size: 1.2rem;
}

.qty-value {
    margin: 0 12px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.remove-item {
    color: #ff4d4d;
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.remove-item:hover {
    color: #cc0000;
    text-decoration: underline;
}

/* Footer & Totals */
.cart-footer {
    padding: 25px;
    background: #fdfaf5;
    border-top: 1px solid #f0e6da;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.cart-total-row.grand-total {
    font-weight: 700;
    font-size: 1.3rem;
    color: #333;
}

.checkout-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #c9a050, #916b43);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(145, 107, 67, 0.2);
}

.checkout-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(145, 107, 67, 0.3);
}

/* Empty Cart State */
.empty-cart-msg {
    text-align: center;
    padding: 50px 0;
    color: #b5b5b5;
}

.empty-cart-msg i {
    font-size: 4rem;
    margin-bottom: 15px;
    display: block;
    color: #f0e6da;
}

/* Navbar Badge Animation */
@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-8px);
    }

    60% {
        transform: translateY(-4px);
    }
}

.cart-count.bump {
    animation: bounce 0.6s ease;
}

/* Add to Cart Button on Cards */
.add-to-cart-btn {
    width: 100%;
    margin-top: 15px;
    padding: 10px;
    background: #fdfaf5;
    border: 1px solid #e6dfd5;
    color: #916b43;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-to-cart-btn:hover {
    background: #916b43;
    color: #fff;
    border-color: #916b43;
    box-shadow: 0 5px 15px rgba(145, 107, 67, 0.2);
}

.add-to-cart-btn i {
    font-size: 1.1rem;
}