/* ============================================================
   PeusoPeupon LLC, Shared cart + checkout styles
   Relies on the CSS custom properties defined per page
   (--accent, --primary, --primary-light, --text-*, --radius...).
   ============================================================ */

/* ---- Nav cart button + badge ---- */
.cart-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(var(--srgb), 0.06);
    border: 1px solid rgba(var(--srgb), 0.12);
    color: var(--white);
    cursor: pointer;
    transition: all var(--transition);
}
.cart-toggle:hover {
    background: rgba(var(--srgb), 0.1);
    border-color: rgba(10, 132, 255, 0.4);
    transform: translateY(-1px);
}
.cart-toggle svg { width: 20px; height: 20px; }
.cart-count {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 100px;
    background: var(--accent);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary);
    transform: scale(0);
    transition: transform var(--transition);
}
.cart-count.visible { transform: scale(1); }
@media (max-width: 768px) {
    /* keep the cart button visible in the top bar on mobile, next to the burger */
    .nav-cart-mobile { margin-right: 8px; }
}

/* ---- Overlay ---- */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 8, 18, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
    z-index: 1500;
}
.cart-overlay.open { opacity: 1; visibility: visible; }

/* ---- Drawer ---- */
.cart-drawer {
    position: fixed;
    top: 0;
    right: -480px;
    width: 100%;
    max-width: 440px;
    height: 100%;
    background: var(--primary-light);
    border-left: 1px solid rgba(10, 132, 255, 0.12);
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1600;
}
.cart-drawer.open { right: 0; }

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    border-bottom: 1px solid rgba(var(--srgb), 0.06);
    flex-shrink: 0;
}
.cart-header h3 { font-size: 1.2rem; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.cart-header h3 svg { width: 22px; height: 22px; color: var(--accent); }
.cart-close {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: rgba(var(--srgb), 0.05);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
}
.cart-close:hover { background: rgba(var(--srgb), 0.1); color: var(--white); }
.cart-close svg { width: 18px; height: 18px; }

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 28px;
}

/* Empty state */
.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    color: var(--text-muted);
    gap: 16px;
    padding: 40px 0;
}
.cart-empty svg { width: 56px; height: 56px; color: rgba(148, 163, 184, 0.4); }
.cart-empty p { font-size: 0.95rem; }
.cart-empty .btn { margin-top: 8px; }

/* Item */
.cart-item {
    display: flex;
    gap: 14px;
    padding: 18px 0;
    border-bottom: 1px solid rgba(var(--srgb), 0.05);
}
.cart-item:last-child { border-bottom: none; }
.cart-item-icon {
    flex-shrink: 0;
    width: 44px; height: 44px;
    border-radius: 10px;
    background: rgba(10, 132, 255, 0.1);
    display: flex; align-items: center; justify-content: center;
}
.cart-item-icon svg { width: 22px; height: 22px; color: var(--accent); }
.cart-item-main { flex: 1; min-width: 0; }
.cart-item-name { font-size: 0.92rem; font-weight: 700; line-height: 1.35; margin-bottom: 4px; }
.cart-item-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 100px;
    margin-bottom: 8px;
}
.cart-item-tag.oneoff { background: rgba(34, 197, 94, 0.12); color: var(--beginner, #22c55e); }
.cart-item-tag.monthly { background: rgba(94, 158, 255, 0.12); color: var(--advanced, #5e9eff); }
.cart-item-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cart-item-price { font-size: 0.95rem; font-weight: 800; }
.cart-item-price small { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; }

.cart-qty { display: flex; align-items: center; gap: 8px; }
.cart-qty button {
    width: 26px; height: 26px;
    border-radius: 6px;
    background: rgba(var(--srgb), 0.06);
    border: 1px solid rgba(var(--srgb), 0.1);
    color: var(--white);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; line-height: 1;
    transition: all var(--transition);
}
.cart-qty button:hover { background: rgba(10, 132, 255, 0.2); border-color: var(--accent); }
.cart-qty span { min-width: 18px; text-align: center; font-size: 0.9rem; font-weight: 700; }
.cart-item-remove {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 0.78rem; padding: 4px;
    transition: color var(--transition);
}
.cart-item-remove:hover { color: #ef4444; }

/* Footer / totals */
.cart-footer {
    flex-shrink: 0;
    padding: 22px 28px 26px;
    border-top: 1px solid rgba(var(--srgb), 0.06);
    background: rgba(0, 0, 0, 0.15);
}
.cart-totals { margin-bottom: 18px; display: flex; flex-direction: column; gap: 8px; }
.cart-total-row { display: flex; justify-content: space-between; font-size: 0.9rem; color: var(--text-secondary); }
.cart-total-row.grand { font-size: 1.05rem; font-weight: 800; color: var(--white); padding-top: 8px; border-top: 1px solid rgba(var(--srgb),0.06); }
.cart-total-row .muted { color: var(--text-muted); font-size: 0.8rem; }
.cart-footer .btn { width: 100%; justify-content: center; }
.cart-footer-note { font-size: 0.72rem; color: var(--text-muted); text-align: center; margin-top: 12px; line-height: 1.5; }

/* ---- Checkout modal ---- */
.checkout-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(3, 8, 18, 0.75);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    opacity: 0; visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
    z-index: 1700;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.checkout-modal-overlay.open { opacity: 1; visibility: visible; }
.checkout-modal {
    width: 100%; max-width: 520px;
    max-height: 90vh; overflow-y: auto;
    background: var(--primary-light);
    border: 1px solid rgba(10, 132, 255, 0.15);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transform: translateY(20px) scale(0.98);
    transition: transform var(--transition);
}
.checkout-modal-overlay.open .checkout-modal { transform: translateY(0) scale(1); }
.checkout-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 24px 28px; border-bottom: 1px solid rgba(var(--srgb),0.06);
}
.checkout-head h3 { font-size: 1.2rem; font-weight: 800; }
.checkout-body { padding: 24px 28px 28px; }

.checkout-summary {
    background: rgba(var(--srgb),0.02);
    border: 1px solid rgba(var(--srgb),0.05);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 22px;
}
.checkout-summary-row {
    display: flex; justify-content: space-between; gap: 12px;
    font-size: 0.88rem; padding: 6px 0; color: var(--text-secondary);
}
.checkout-summary-row .name { flex: 1; min-width: 0; }
.checkout-summary-row.total {
    margin-top: 8px; padding-top: 12px;
    border-top: 1px solid rgba(var(--srgb),0.07);
    font-weight: 800; color: var(--white); font-size: 1rem;
}

.checkout-section-label {
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--text-muted);
    margin: 22px 0 12px;
}
.pay-fields { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.pay-fields .form-group { display: flex; flex-direction: column; gap: 6px; }
.pay-fields label { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
.pay-fields input {
    padding: 12px 14px;
    background: rgba(var(--srgb),0.04);
    border: 1px solid rgba(var(--srgb),0.08);
    border-radius: 8px; color: var(--white); font-size: 0.92rem;
    font-family: inherit; outline: none; transition: all var(--transition);
}
.pay-fields input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

#paypal-button-container { min-height: 48px; margin-bottom: 8px; }

.pay-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 22px 0 18px; color: var(--text-muted); font-size: 0.78rem;
}
.pay-divider::before, .pay-divider::after {
    content: ''; flex: 1; height: 1px; background: rgba(var(--srgb),0.08);
}

.payoneer-box {
    border: 1px solid rgba(var(--srgb),0.08);
    border-radius: var(--radius);
    padding: 16px 18px;
    background: rgba(var(--srgb),0.02);
}
.payoneer-box h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.payoneer-box p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 12px; }
.payoneer-box .btn-secondary { width: 100%; justify-content: center; font-size: 0.9rem; padding: 12px 20px; }

.pay-config-note {
    font-size: 0.78rem; color: #fbbf24;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 8px; padding: 12px 14px; margin-bottom: 18px; line-height: 1.55;
}

.checkout-success { text-align: center; padding: 20px 10px; }
.checkout-success-icon {
    width: 64px; height: 64px; margin: 0 auto 18px;
    background: rgba(34, 197, 94, 0.15); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.checkout-success-icon svg { width: 32px; height: 32px; color: #22c55e; }
.checkout-success h3 { font-size: 1.3rem; margin-bottom: 8px; }
.checkout-success p { color: var(--text-muted); font-size: 0.92rem; line-height: 1.6; }

/* Toast */
.cart-toast {
    position: fixed; bottom: 28px; left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--primary-medium, #1c1c24);
    border: 1px solid rgba(10, 132, 255, 0.3);
    color: var(--white);
    padding: 14px 22px; border-radius: 12px;
    font-size: 0.9rem; font-weight: 600;
    box-shadow: var(--shadow-lg);
    display: flex; align-items: center; gap: 10px;
    opacity: 0; transition: all var(--transition);
    z-index: 1800; pointer-events: none;
}
.cart-toast svg { width: 18px; height: 18px; color: #22c55e; }
.cart-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* Add-to-cart button helpers (reuse .btn styles from each page) */
.btn-add { gap: 8px; }
.btn-add svg { width: 18px; height: 18px; }
.btn-add.added { background: #22c55e; }

/* ============================================================
   Checkout — payment method tabs (Card default · PayPal · Bank)
   ============================================================ */
.pm-tabs { display: flex; gap: 8px; margin: 20px 0 16px; }
.pm-tab {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
    padding: 12px 6px; border-radius: 12px;
    border: 1px solid rgba(var(--srgb), 0.1); background: rgba(var(--srgb), 0.03);
    color: var(--text-secondary); font-family: inherit; font-size: 0.85rem; font-weight: 600;
    cursor: pointer; transition: all var(--transition);
}
.pm-tab svg { width: 18px; height: 18px; }
.pm-tab .pay-logo { height: 16px; width: auto; }
.pm-tab:hover { border-color: rgba(var(--srgb), 0.22); color: var(--text-primary); }
.pm-tab.active { border-color: var(--accent); background: var(--accent-glow); color: var(--text-primary); }
.pm-tab.active svg { color: var(--accent); }
@media (max-width: 420px) { .pm-tab span { display: none; } .pm-tab { padding: 12px 4px; } }

.pm-panel { padding-top: 2px; }
.pm-sub { font-size: 0.82rem; color: var(--text-muted); line-height: 1.55; margin-bottom: 14px; }
.pm-cta { width: 100%; justify-content: center; }
.pm-accepted { display: flex; align-items: center; gap: 7px; font-size: 0.72rem; color: var(--text-muted); margin-top: 12px; }
.pm-accepted svg { width: 14px; height: 14px; }
.pay-logo { height: 20px; width: auto; display: inline-block; vertical-align: middle; }
#pp-card-container, #pp-wallet-container { min-height: 46px; }
.checkout-secure { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; font-size: 0.74rem; color: var(--text-muted); }
.checkout-secure svg { width: 15px; height: 15px; color: #30d158; }

/* Clip off-canvas drawers (mobile nav, cart) so they never cause horizontal scroll */
html { overflow-x: hidden; }

.pm-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.pm-brand .pay-logo.payoneer { height: 20px; }

/* ============================================================
   Card Fields (PayPal Advanced) — inline card + billing address
   ============================================================ */
.cf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.cf-grid .cf-full { grid-column: 1 / -1; }
.cf-field label, .pay-fields.cf-addr label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.cf-host {
    min-height: 46px; padding: 0 12px; display: flex; align-items: center;
    border: 1px solid rgba(var(--srgb), 0.14); border-radius: 10px;
    background: rgba(var(--srgb), 0.04); transition: border-color var(--transition), box-shadow var(--transition);
}
.cf-host:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.cf-host > iframe { width: 100% !important; min-height: 24px; }
.pay-fields.cf-addr { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.pay-fields.cf-addr .cf-full { grid-column: 1 / -1; }
.pay-fields.cf-addr .form-group { gap: 6px; }
@media (max-width: 480px) { .cf-grid, .pay-fields.cf-addr { grid-template-columns: 1fr; } }
