/* ==========================================================================
   CART STYLES (SLIDE-OUT DRAWER)
   ========================================================================== */

/* Cart Overlay Backdrop */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Cart Drawer */
.cart-drawer {
    position: fixed;
    top: 0;
    right: -500px;
    width: 100%;
    max-width: 450px;
    height: 100vh;
    background-color: var(--bg-color);
    z-index: 2001;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.cart-drawer.active {
    right: 0;
}

/* Header */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    border-bottom: 1px solid #e0dfd9;
}

.cart-header h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 0;
    color: var(--primary);
}

.close-cart {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #777;
    transition: color 0.3s;
}

.close-cart:hover {
    color: var(--primary);
}

/* Cart Items Body */
.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.empty-cart-msg {
    text-align: center;
    color: #888;
    margin-top: 2rem;
    font-size: 1.1rem;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e0dfd9;
}

.cart-item-img {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    object-fit: cover;
    background-color: #eee;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h4 {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1rem;
    margin-bottom: 0.2rem;
    color: var(--text-dark);
}

.cart-item-info .price {
    color: var(--primary);
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: #fff;
    display: inline-flex;
    border: 1px solid #ddd;
    border-radius: 3px;
    overflow: hidden;
}

.qty-btn {
    background: none;
    border: none;
    padding: 0.2rem 0.6rem;
    cursor: pointer;
    font-size: 1.1rem;
    color: #555;
    transition: background 0.2s;
}

.qty-btn:hover {
    background: #f5f5f5;
    color: var(--primary);
}

.cart-item-remove {
    background: none;
    border: none;
    color: #a00;
    cursor: pointer;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-left: auto;
}

/* Footer / Totals */
.cart-footer {
    padding: 2rem;
    background: #fff;
    border-top: 1px solid #e0dfd9;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    color: #666;
    font-size: 0.95rem;
}

.summary-total {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    border-top: 1px solid #eee;
    padding-top: 1rem;
    margin-top: 0.5rem;
}

.checkout-btn {
    width: 100%;
    margin-top: 1.5rem;
    padding: 1.2rem;
}

/* Nav Cart Icon Styles */
.cart-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    color: inherit;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background-color: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}