/* ============================================
   PRECISIONCORE — Cart & Checkout Styles
   Cinematic dark-gold theme
   ============================================ */

/* ============================================
   Cart Sidebar
   ============================================ */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    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: 400px;
    max-width: 90vw;
    height: 100vh;
    background: rgba(6, 6, 6, 0.98);
    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.4);
    backdrop-filter: blur(20px);
}

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

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

.cart-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.cart-close {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    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.08);
    border-color: rgba(239, 68, 68, 0.2);
    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.85rem;
}

.cart-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    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.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-primary);
    margin-bottom: 3px;
}

.cart-item-name {
    font-size: 0.9rem;
    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.08);
}

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

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

.cart-item-tier,
.cart-item-duration {
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.cart-item-tier {
    background: rgba(212, 168, 83, 0.06);
    color: var(--accent-primary);
    border: 1px solid rgba(212, 168, 83, 0.1);
}

.cart-item-duration {
    background: rgba(192, 192, 210, 0.04);
    color: #9090a0;
    border: 1px solid rgba(192, 192, 210, 0.08);
}

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

/* Cart Footer */
.cart-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.6);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

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

.cart-note {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 10px;
    letter-spacing: 0.04em;
}

/* ============================================
   Checkout Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    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: rgba(8, 8, 6, 0.98);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    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: 0 24px 80px rgba(0, 0, 0, 0.6);
}

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

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

.modal-header h3 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.modal-close {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    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.08);
    border-color: rgba(239, 68, 68, 0.2);
    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: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.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.72rem;
    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: 14px 0;
    margin-top: 8px;
    border-top: 1px solid rgba(212, 168, 83, 0.15);
    font-size: 1rem;
    font-weight: 700;
}

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

/* NOWPayments Section */
.nowpayments-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
}

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

.np-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: rgba(212, 168, 83, 0.06);
    border: 1px solid rgba(212, 168, 83, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.np-header h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 2px;
    letter-spacing: 0.03em;
}

.np-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
}

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

.np-email-wrap label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.np-required {
    color: #ef4444;
}

.np-input {
    width: 100%;
    padding: 11px 14px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.85rem;
    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(212, 168, 83, 0.08);
}

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

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

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

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

.np-error {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.82rem;
    color: #ef4444;
    margin-bottom: 12px;
}

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

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

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

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

.np-crypto-icons span {
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.06em;
}

/* ============================================
   Quantity Controls
   ============================================ */
.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
}

.qty-btn {
    width: 26px;
    height: 26px;
    background: rgba(212, 168, 83, 0.04);
    border: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.qty-btn:hover {
    background: rgba(212, 168, 83, 0.12);
}

.qty-value {
    width: 30px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    line-height: 26px;
}

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

/* ============================================
   Responsive Cart
   ============================================ */
@media (max-width: 480px) {
    .cart-sidebar {
        width: 100vw;
    }

    .toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }

    .toast {
        max-width: 100%;
    }
}
