/* ============================================
   Auto Pilgrim — Cart & Checkout Styles
   ============================================ */

/* Cart Sidebar */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.cart-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 90vw;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    z-index: 2001;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
}

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

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.cart-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
}

.cart-close {
    background: var(--accent-subtle);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-base);
}

.cart-close:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

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

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.cart-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: cartItemIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    position: relative;
    overflow: hidden;
}

.cart-item.removing {
    animation: cartItemOut 0.3s ease forwards;
}

@keyframes cartItemIn {
    from { opacity: 0; transform: translateX(20px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes cartItemOut {
    to { opacity: 0; transform: translateX(40px) scale(0.9); height: 0; padding: 0; margin: 0; }
}

.cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.cart-item-info { flex: 1; }

.cart-item-game {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-primary);
    margin-bottom: 4px;
}

.cart-item-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.cart-item-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-remove:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.cart-item-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cart-item-meta {
    display: flex;
    gap: 8px;
    align-items: center;
}

.cart-item-tier {
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--accent-subtle);
    color: var(--accent-primary);
    border: 1px solid rgba(201, 168, 76, 0.15);
}

.cart-item-price {
    font-size: 1.1rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

/* Cart Footer */
.cart-footer {
    padding: 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 1.1rem;
    font-weight: 700;
}

.cart-total span:last-child {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    color: var(--accent-primary);
}

.cart-note {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 12px;
}

/* ============================================
   Checkout Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 { font-size: 1.2rem; font-weight: 700; }

.modal-close {
    background: var(--accent-subtle);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-base);
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.modal-body { padding: 24px; }

/* Checkout Summary */
.checkout-summary { margin-bottom: 24px; }

.checkout-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

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

.checkout-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.checkout-item-name { font-weight: 600; }
.checkout-item-meta { font-size: 0.78rem; color: var(--text-muted); }
.checkout-item-price { font-weight: 700; font-family: var(--font-mono); }

.checkout-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-top: 8px;
    border-top: 2px solid var(--border-color);
    font-size: 1.1rem;
    font-weight: 700;
}

.checkout-total span:last-child {
    font-family: var(--font-mono);
    color: var(--accent-primary);
    font-size: 1.3rem;
}

/* NOWPayments */
.nowpayments-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.np-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.np-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--accent-subtle);
    border: 1px solid rgba(201, 168, 76, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.np-header h4 { font-size: 1rem; font-weight: 700; margin-bottom: 2px; }
.np-subtitle { font-size: 0.78rem; color: var(--text-muted); }

.np-email-wrap { margin-bottom: 16px; }

.np-email-wrap label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.np-required { color: #ef4444; }

.np-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.np-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.1);
}

.np-input::placeholder { color: var(--text-muted); font-size: 0.82rem; }

.np-pay-btn { margin-bottom: 12px; padding: 14px 24px; font-size: 0.95rem; }

.np-pay-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.np-status { min-height: 0; transition: all 0.3s ease; }

.np-error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 0.85rem;
    color: #ef4444;
    margin-bottom: 12px;
}

.np-error small { color: var(--text-muted); }

.np-success {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 0.85rem;
    color: #10b981;
    margin-bottom: 12px;
}

.np-loading {
    text-align: center;
    padding: 12px;
    font-size: 0.85rem;
    color: var(--accent-primary);
    margin-bottom: 12px;
}

.np-crypto-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 4px;
}

.np-crypto-icons span {
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

/* ============================================
   Responsive Cart
   ============================================ */
@media (max-width: 480px) {
    .cart-sidebar { width: 100vw; }
    .toast-container { left: 16px; right: 16px; bottom: 16px; }
    .toast { max-width: 100%; }
}
