/* ============================================
   Cart Drawer — Peppy Taps
   ============================================ */

/* --- Drawer Container --- */
.cart-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    pointer-events: none;
    visibility: hidden;
}

.cart-drawer.active {
    pointer-events: all;
    visibility: visible;
}

/* --- Overlay --- */
.cart-drawer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
}

.cart-drawer.active .cart-drawer-overlay {
    background: rgba(0, 0, 0, 0.5);
}

/* --- Panel --- */
.cart-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 420px;
    height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
}

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

/* --- Header --- */
.cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.cart-drawer-header h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0;
}

.cart-drawer-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #333;
    transition: opacity 0.2s;
}

.cart-drawer-close:hover {
    opacity: 0.6;
}

/* --- Items --- */
.cart-drawer-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

/* --- Empty State --- */
.cart-drawer-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.cart-drawer-empty svg {
    margin-bottom: 16px;
    opacity: 0.3;
}

.cart-drawer-empty p {
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    margin: 0 0 4px;
}

.cart-drawer-empty span {
    font-size: 0.85rem;
    color: #aaa;
}

/* --- Cart Item --- */
.cart-drawer-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.cart-drawer-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cart-item-placeholder {
    color: #ccc;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
}

.cart-item-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0 0 2px;
    color: #111;
}

.cart-item-variant {
    font-size: 0.8rem;
    color: #888;
    margin: 0 0 6px;
}

.cart-item-price {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111;
    margin: 0 0 8px;
}

/* --- Quantity Controls --- */
.cart-item-qty {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.cart-qty-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 10px;
    font-size: 0.85rem;
    color: #333;
    transition: background 0.2s;
}

.cart-qty-btn:hover {
    background: #f0f0f0;
}

.cart-item-qty span {
    padding: 4px 8px;
    font-size: 0.85rem;
    font-weight: 500;
    min-width: 24px;
    text-align: center;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
}

/* --- Remove Button --- */
.cart-item-remove {
    position: absolute;
    top: 16px;
    right: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #bbb;
    transition: color 0.2s;
}

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

/* --- Footer --- */
.cart-drawer-footer {
    padding: 20px 24px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
    background: #fafafa;
}

.cart-drawer-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.cart-drawer-subtotal span:first-child {
    font-size: 0.95rem;
    color: #555;
}

.cart-drawer-subtotal span:last-child {
    font-size: 1.2rem;
    font-weight: 600;
    color: #111;
}

.cart-drawer-note {
    font-size: 0.75rem;
    color: #999;
    margin: 0 0 16px;
}

.cart-checkout-btn {
    width: 100%;
    margin-bottom: 8px;
}

.cart-continue-btn {
    width: 100%;
}

/* --- Nav Cart Badge --- */
.nav-cart {
    position: relative;
    cursor: pointer;
}

.cart-count {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--color-accent, #c4a265);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .cart-drawer-panel {
        max-width: 100%;
    }
}
