/* Side-Sliding Cart Drawer */

:root {
    --drawer-width: 400px;
    --drawer-transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@media (max-width: 480px) {
    :root {
        --drawer-width: 100%;
    }
}

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

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

/* Drawer Container */
.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--drawer-width);
    height: 100%;
    background: #000;
    border-left: 1px solid #333;
    z-index: 2001;
    transform: translateX(100%);
    transition: var(--drawer-transition);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

.cart-drawer.active {
    transform: translateX(0);
}

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

.cart-drawer-header h2 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    margin: 0;
    font-size: 1.5rem;
}

.cart-drawer-close {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

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

/* Content Area */
.cart-drawer-items {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-drawer-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #222;
}

.cart-drawer-item-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    background: #111;
}

.cart-drawer-item-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cart-drawer-item-name {
    font-weight: 600;
    color: #D4AF37;
    margin-bottom: 0.25rem;
    font-size: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cart-drawer-item-variant {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.5rem;
}

.cart-drawer-item-price {
    color: #ffff;
    font-weight: 700;
}

.cart-drawer-item-remove {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
}

.cart-drawer-item-remove:hover {
    color: #ff4444;
}

/* Quantity Control in Drawer */
.cart-drawer-qty {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.qty-pill {
    background: #222;
    border-radius: 99px;
    padding: 2px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.qty-pill button {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-weight: bold;
    padding: 0 4px;
}

.qty-pill button:hover {
    color: var(--color-primary);
}

/* Footer & Checkout */
.cart-drawer-footer {
    padding: 1.5rem;
    border-top: 1px solid #333;
    background: #0a0a0a;
}

.cart-drawer-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.cart-drawer-total span:first-child {
    color: #fff;
}

.cart-drawer-total span:last-child {
    color: #fff;
}

.cart-drawer-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-checkout {
    width: 100%;
    padding: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-view-cart {
    width: 100%;
    padding: 0.75rem;
    background: transparent;
    border: 1px solid #444;
    color: #aaa;
    text-decoration: none;
    text-align: center;
    border-radius: var(--radius-btn);
    transition: all 0.2s;
    font-size: 0.9rem;
}

.btn-view-cart:hover {
    background: #111;
    border-color: #666;
    color: #fff;
}

/* Empty State */
.cart-empty-state {
    text-align: center;
    padding-top: 3rem;
    color: #888;
}

.cart-empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.3;
}