/* ============================================================================
   PREMIUM CART PANEL - Cyber/Neon Theme
   INSTALLATION: Add to your main CSS file or include as separate stylesheet
   ============================================================================ */

:root {
    --cart-bg-dark: #0b0b10;
    --cart-bg-card: #0f1724;
    --cart-neon-cyan: #06b6d4;
    --cart-neon-glow: rgba(6, 182, 212, 0.3);
    --cart-text-primary: #ffffff;
    --cart-text-secondary: #9aa7b4;
    --cart-border: rgba(255, 255, 255, 0.1);
    --cart-hover: rgba(6, 182, 212, 0.1);
}

/* Modal Overlay */
.cart-modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 9999;
    display: none;
    pointer-events: none;
}

.cart-modal.active {
    display: block;
    pointer-events: auto;
}

.cart-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cart-modal.active .cart-overlay {
    opacity: 1;
}

/* Cart Panel */
.cart-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 440px;
    max-width: 100vw;
    background: linear-gradient(180deg, var(--cart-bg-card) 0%, var(--cart-bg-dark) 100%);
    border-left: 2px solid var(--cart-neon-cyan);
    box-shadow:
        -10px 0 40px rgba(0, 0, 0, 0.5),
        -2px 0 20px var(--cart-neon-glow);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-modal.active .cart-panel {
    transform: translateX(0);
}

/* Header */
.cart-header {
    padding: 24px 28px;
    border-bottom: 1px solid var(--cart-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.05) 0%, transparent 100%);
}

.cart-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-icon {
    font-size: 24px;
    filter: drop-shadow(0 0 8px var(--cart-neon-cyan));
}

.cart-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--cart-neon-cyan);
    text-shadow: 0 0 20px var(--cart-neon-glow);
}

.cart-close {
    background: transparent;
    border: 1px solid var(--cart-border);
    color: var(--cart-text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.cart-close:hover {
    background: var(--cart-hover);
    border-color: var(--cart-neon-cyan);
    color: var(--cart-neon-cyan);
    box-shadow: 0 0 12px var(--cart-neon-glow);
}

/* Items Container */
.cart-items-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px 28px;
    scrollbar-width: thin;
    scrollbar-color: var(--cart-neon-cyan) var(--cart-bg-dark);
}

.cart-items-container::-webkit-scrollbar {
    width: 6px;
}

.cart-items-container::-webkit-scrollbar-track {
    background: var(--cart-bg-dark);
}

.cart-items-container::-webkit-scrollbar-thumb {
    background: var(--cart-neon-cyan);
    border-radius: 3px;
}

/* Empty State */
.cart-items-container:empty::before {
    content: 'Your cart is empty';
    display: block;
    text-align: center;
    padding: 60px 20px;
    color: var(--cart-text-secondary);
    font-size: 16px;
}

/* Cart Item Card */
.cart-item-card,
.cart-item-row {
    background: var(--cart-bg-card);
    border: 1px solid var(--cart-border);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.cart-item-card::before,
.cart-item-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--cart-neon-cyan), transparent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.cart-item-card:hover::before,
.cart-item-row:hover::before {
    opacity: 1;
}

.cart-item-card:hover,
.cart-item-row:hover {
    border-color: var(--cart-neon-cyan);
    box-shadow: 0 4px 16px var(--cart-neon-glow);
    transform: translateX(4px);
}

/* Item Info */
.item-info {
    flex: 1;
    min-width: 0;
}

.item-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--cart-text-primary);
    margin: 0 0 6px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-price {
    font-size: 14px;
    color: var(--cart-neon-cyan);
    font-weight: 600;
    margin: 0;
}

/* Quantity Controls */
.qty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn,
.qty-controls button:not(.remove-btn) {
    background: var(--cart-bg-dark);
    border: 1px solid var(--cart-border);
    color: var(--cart-text-primary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover,
.qty-controls button:not(.remove-btn):hover {
    background: var(--cart-neon-cyan);
    border-color: var(--cart-neon-cyan);
    color: var(--cart-bg-dark);
    box-shadow: 0 0 12px var(--cart-neon-glow);
}

.qty-value,
.qty-controls span {
    font-size: 14px;
    font-weight: 600;
    color: var(--cart-text-primary);
    min-width: 24px;
    text-align: center;
}

.remove-btn,
.qty-controls button:last-child {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
    font-weight: 400;
    transition: all 0.2s ease;
    margin-left: 4px;
}

.remove-btn:hover,
.qty-controls button:last-child:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

/* Footer */
.cart-footer {
    padding: 24px 28px;
    border-top: 1px solid var(--cart-border);
    background: linear-gradient(180deg, transparent 0%, rgba(6, 182, 212, 0.03) 100%);
}

/* Summary */
.cart-summary {
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.summary-label {
    font-size: 14px;
    color: var(--cart-text-secondary);
    font-weight: 500;
}

.summary-value,
#cartTotal {
    font-size: 16px;
    color: var(--cart-text-primary);
    font-weight: 600;
}

.summary-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cart-border), transparent);
    margin: 8px 0;
}

.total-row {
    padding: 16px 0 0 0;
}

.total-row .summary-label {
    font-size: 16px;
    font-weight: 700;
    color: var(--cart-text-primary);
}

.summary-total {
    font-size: 24px;
    font-weight: 700;
    color: var(--cart-neon-cyan);
    text-shadow: 0 0 20px var(--cart-neon-glow);
}

/* Checkout Button */
.checkout-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--cart-neon-cyan) 0%, #0891b2 100%);
    border: none;
    border-radius: 10px;
    color: var(--cart-bg-dark);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--cart-neon-glow);
}

.checkout-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.2) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.checkout-btn:hover::before {
    opacity: 1;
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px var(--cart-neon-glow);
}

.checkout-btn:active {
    transform: translateY(0);
}

.btn-text {
    position: relative;
    z-index: 1;
}

.btn-arrow {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.checkout-btn:hover .btn-arrow {
    transform: translateX(4px);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast-msg {
    background: linear-gradient(135deg, var(--cart-neon-cyan) 0%, #0891b2 100%);
    color: var(--cart-bg-dark);
    padding: 14px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 20px var(--cart-neon-glow);
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

.toast-msg.visible {
    transform: translateX(0);
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 640px) {
    .cart-panel {
        width: 100vw;
        border-left: none;
        border-top: 2px solid var(--cart-neon-cyan);
    }

    .cart-header,
    .cart-items-container,
    .cart-footer {
        padding-left: 20px;
        padding-right: 20px;
    }

    .cart-header h2 {
        font-size: 18px;
    }

    .summary-total {
        font-size: 20px;
    }
}

/* Animation Enhancement */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}