﻿/* ============================================
   Cart Drawer & UI — 1333 Covenant Shop
   ============================================ */

/* Overlay backdrop */
.cart-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 2, 25, 0.55);
    z-index: 19999;
}
.cart-overlay.open { display: block; }

/* Drawer panel */
.cart-drawer {
    position: fixed;
    top: 0; right: 0;
    width: 380px; max-width: 100vw;
    height: 100%;
    background: linear-gradient(180deg, #f5f0ff 0%, #ede4ff 100%);
    border-left: 2px solid #9B6CD8;
    box-shadow: -6px 0 30px rgba(107,40,200,0.2);
    z-index: 20000;
    display: flex;
    flex-direction: column;
    transform: translateX(105%);
    transition: transform 0.3s ease;
}
.cart-drawer.open { transform: translateX(0); }

/* Header */
.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(180deg, #e8d4ff 0%, #d8bef8 60%, #e8d4ff 100%);
    border-bottom: 2px solid #9B6CD8;
    flex-shrink: 0;
}
.cart-title {
    font-family: 'MS UI Gothic', Arial, sans-serif;
    font-size: 13px; font-weight: bold;
    color: #322036; text-transform: uppercase; letter-spacing: 1px;
}
.cart-close-btn {
    background: none; border: none;
    font-size: 1.6rem; color: #322036;
    cursor: pointer; line-height: 1; padding: 0 4px;
    transition: color 0.2s;
}
.cart-close-btn:hover { color: #1a0438; }

/* Scrollable items area */
.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: #322036;
    font-family: 'MS UI Gothic', Arial, sans-serif;
    font-size: 12px;
    line-height: 1.7;
}
.cart-empty .empty-icon { font-size: 2.5rem; display: block; margin-bottom: 10px; }

/* Individual cart item */
.cart-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: rgba(255,255,255,0.7);
    border: 1px solid #C4A8E8;
    padding: 10px;
}
.cart-item-img {
    width: 64px; height: 64px;
    object-fit: cover;
    border: 1px solid #C4A8E8;
    flex-shrink: 0;
}
.cart-item-details { flex: 1; min-width: 0; }
.cart-item-name {
    font-family: 'MS UI Gothic', Arial, sans-serif;
    font-size: 10px; font-weight: bold;
    color: #322036; text-transform: uppercase;
    margin-bottom: 3px; line-height: 1.3;
}
.cart-item-size {
    font-family: 'MS UI Gothic', Arial, sans-serif;
    font-size: 10px; color: #322036; margin-bottom: 5px;
}
.cart-item-price {
    font-family: 'VT323', monospace;
    font-size: 20px; color: #84c4c4;
    text-shadow: 0 0 6px rgba(200,100,255,0.3);
}
.cart-item-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.qty-row {
    display: flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #C4A8E8;
    background: #fff;
    padding: 2px 6px;
}
.qty-btn {
    background: none; border: none;
    font-size: 1rem; color: #322036;
    cursor: pointer; padding: 0 3px; font-weight: bold;
    line-height: 1;
}
.qty-btn:hover { color: #1a0438; }
.qty-display {
    font-family: 'VT323', monospace;
    font-size: 18px; color: #322036;
    min-width: 20px; text-align: center;
}
.cart-remove-btn {
    background: none; border: none;
    font-size: 11px; color: #9B6CD8;
    cursor: pointer; text-transform: uppercase;
    letter-spacing: 0.5px; padding: 0;
    font-family: 'MS UI Gothic', Arial, sans-serif;
}
.cart-remove-btn:hover { color: #c00; }

/* Footer */
.cart-footer {
    padding: 14px 16px;
    border-top: 2px solid #9B6CD8;
    background: rgba(255,255,255,0.5);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cart-total {
    font-family: 'VT323', monospace;
    font-size: 26px; color: #322036;
    text-align: right;
}
.cart-promo-note {
    font-family: 'MS UI Gothic', Arial, sans-serif;
    font-size: 10px; color: #322036;
    text-align: center; line-height: 1.4;
}
.cart-checkout-btns {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cart-btn {
    width: 100%; padding: 11px;
    border: 1px solid #9B6CD8;
    font-family: 'MS UI Gothic', Arial, sans-serif;
    font-size: 11px; font-weight: bold;
    text-transform: uppercase; letter-spacing: 1px;
    cursor: pointer; transition: all 0.2s;
}
.cart-btn.card {
    background: linear-gradient(180deg, rgba(160,200,255,0.9) 5%, rgba(60,110,220,0.9) 39%, rgba(100,140,240,0.88) 92%);
    color: #fff; border-color: #6699ee;
    text-shadow: 1px 1px 2px rgba(0,0,40,0.4);
}
.cart-btn.card:hover { box-shadow: 0 4px 15px rgba(80,130,255,0.4); }
.cart-btn.crypto {
    background: linear-gradient(180deg, rgba(210,195,215,0.96) 5%, rgba(150,121,156,0.92) 39%, rgba(170,140,175,0.90) 92%);
    color: #fff; border-color: #322036;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}
.cart-btn.crypto:hover { box-shadow: 0 4px 15px rgba(150,121,156,0.4); }
.cart-btn:disabled {
    opacity: 0.5; cursor: not-allowed;
}
.crypto-note {
    background: rgba(155,108,216,0.1);
    border: 1px solid #C4A8E8;
    padding: 10px;
    font-family: 'MS UI Gothic', Arial, sans-serif;
    font-size: 10px; color: #5a3090;
    line-height: 1.5; text-align: center;
}

/* Cart icon in topnav */
.cart-icon-btn {
    background: none; border: none;
    cursor: pointer; font-size: 16px;
    position: relative; padding: 6px 10px;
    color: #322036; transition: color 0.15s;
    display: flex; align-items: center; gap: 4px;
    font-family: 'MS UI Gothic', Arial, sans-serif;
    border-radius: 3px;
}
.cart-icon-btn:hover { background: rgba(180,140,255,0.2); color: #1a0438; }
.cart-badge {
    background: #84c4c4;
    color: #fff;
    font-size: 9px;
    font-family: 'MS UI Gothic', Arial, sans-serif;
    font-weight: bold;
    min-width: 16px; height: 16px;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}
.cart-badge.visible { display: flex; }

/* Size selector injected on product cards */
.size-select {
    width: 100%; margin-bottom: 6px;
    background: #f5f0ff; color: #322036;
    border: 1px solid #9B6CD8;
    padding: 5px 6px;
    font-family: 'MS UI Gothic', Arial, sans-serif;
    font-size: 10px; cursor: pointer;
}

/* Add to Cart button on product cards */
.add-to-cart-btn {
    width: 100%; padding: 8px 10px;
    background: linear-gradient(180deg, #d8c8dc 5%, #96799c 39%, #b099b5 92%);
    border: 1px solid #96799c;
    color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.25);
    font-family: 'MS UI Gothic', Arial, sans-serif;
    font-size: 9px; font-weight: bold;
    text-transform: uppercase; letter-spacing: 1px;
    cursor: pointer; transition: all 0.2s;
    margin-bottom: 6px;
}
.add-to-cart-btn:hover { box-shadow: 0 3px 10px rgba(150,121,156,0.4); }

/* Order success toast */
.order-toast {
    position: fixed;
    bottom: 30px; left: 50%; transform: translateX(-50%);
    background: linear-gradient(135deg, #96799c, #96799c);
    color: #fff; padding: 14px 28px;
    border: 2px solid #C4A8E8;
    font-family: 'MS UI Gothic', Arial, sans-serif;
    font-size: 12px; font-weight: bold;
    text-align: center; z-index: 30000;
    box-shadow: 0 6px 24px rgba(107,40,200,0.4);
    animation: toast-in 0.4s ease;
    white-space: nowrap;
}
@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Mobile */
@media (max-width: 480px) {
    .cart-drawer { width: 100vw; }
    .cart-item-img { width: 52px; height: 52px; }
}
