/* Cart Overlay */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.cart-overlay.active {
    visibility: visible;
    opacity: 1;
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -450px;
    width: 100%;
    max-width: 450px;
    height: 100vh;
    background: #fff;
    z-index: 2001;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 30px rgba(0,0,0,0.1);
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.cart-sidebar.active {
    right: 0;
}

/* Cart Header */
.cart-header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.cart-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close-cart {
    background: none;
    border: none;
    font-size: 2.5rem;
    cursor: pointer;
    color: #888;
    transition: color 0.2s;
    line-height: 1;
}

.close-cart:hover {
    color: #000;
}

/* Cart Items Container */
.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.empty-cart-message {
    text-align: center;
    color: #888;
    margin-top: 2rem;
    font-size: 1.1rem;
}

/* Individual Cart Item */
.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.cart-item-img {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    object-fit: cover;
    background: #f5f8f2;
}

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

.cart-item-title {
    font-weight: 600;
    margin-bottom: 0.2rem;
    font-size: 1.05rem;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-btn {
    background: #eee;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.qty-btn:hover {
    background: #ddd;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #ff4757;
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: auto;
    font-weight: 500;
}

.cart-item-remove:hover {
    text-decoration: underline;
}

/* Cart Footer */
.cart-footer {
    padding: 2rem;
    border-top: 1px solid #eee;
    background: #fcfcfc;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.cart-total span:last-child {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.checkout-btn {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 16px;
    border-radius: 50px;
    font-size: 1.1rem;
    cursor: pointer;
}

.checkout-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.checkout-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Nav Cart Icon */
.nav-cart {
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 1rem;
    transition: color 0.3s;
}

.nav-cart:hover {
    color: var(--primary-color);
}

.nav-cart svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.cart-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.75rem;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
