/* payment.css — Checkout UI */

:root {
    --bg-primary: #0b0b0e;
    --bg-secondary: #17171c;
    --bg-tertiary: #202027;
    --bg-elevated: #26262f;
    --brand-red: #E50914;
    --brand-red-hover: #ff1f2c;
    --text-primary: #ffffff;
    --text-secondary: #9a9aa5;
    --text-muted: #6e6e7a;
    --border-color: #2c2c35;
    --border-strong: #3a3a46;
    --success-green: #2ecc71;
    --warning-orange: #f39c12;
    --card-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-primary);
    background-image:
        radial-gradient(900px 500px at 15% -10%, rgba(229, 9, 20, 0.18), transparent 60%),
        radial-gradient(800px 500px at 95% 0%, rgba(0, 136, 204, 0.14), transparent 60%),
        radial-gradient(700px 600px at 50% 110%, rgba(229, 9, 20, 0.08), transparent 65%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* ============ Container ============ */
.checkout-container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 32px 20px 72px;
}

/* ============ Header ============ */
.checkout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 0 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.checkout-header .logo img {
    height: 38px;
    vertical-align: middle;
    display: block;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.checkout-header .back-btn {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.2s ease;
}

.checkout-header .back-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.07);
}

/* ============ Language Selector ============ */
.lang-selector-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.lang-selector-wrapper:hover {
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.07);
}

.lang-selector-wrapper > i { font-size: 13px; }

.lang-selector-wrapper select {
    background: transparent;
    border: none;
    color: var(--text-primary);
    /* Must stay >= 16px: iOS Safari auto-zooms the whole page when you focus a
       form control with a smaller font, and never zooms back out. That was the
       main "broken on mobile" symptom. Scaled back down visually below. */
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    font-family: inherit;
    padding-right: 2px;
    appearance: none;
    -webkit-appearance: none;
    max-width: 128px;
    text-overflow: ellipsis;
}

.lang-selector-wrapper select option {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.lang-selector-wrapper::after {
    content: "\f078";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 9px;
    color: var(--text-muted);
    pointer-events: none;
}

/* ============ Page Intro ============ */
.checkout-intro {
    text-align: center;
    margin-bottom: 34px;
}

.checkout-intro .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #ffb3b7;
    background: rgba(229, 9, 20, 0.12);
    border: 1px solid rgba(229, 9, 20, 0.35);
    padding: 7px 16px;
    border-radius: 999px;
    margin-bottom: 16px;
}

.checkout-intro h1 {
    margin: 0 0 10px;
    font-size: clamp(28px, 4.5vw, 42px);
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.15;
    background: linear-gradient(180deg, #ffffff 0%, #b9b9c6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.checkout-intro p {
    margin: 0 auto;
    max-width: 620px;
    font-size: 15px;
    color: var(--text-secondary);
}

/* ============ Layout Grid ============ */
.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 28px;
    align-items: start;
}

.checkout-col-left {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

@media (max-width: 960px) {
    .checkout-grid {
        display: flex;
        flex-direction: column;
        gap: 20px;
        /* The desktop rule sets align-items:start. In a column flex container
           that shrinks each card to its content width and pins it left, which
           is why the Order Summary looked off-centre on iPhone. */
        align-items: stretch;
    }

    .checkout-col-left,
    .checkout-card {
        width: 100%;
        max-width: 100%;
    }
    /* Unwrap the left column so its two cards become siblings of the
       payment panel and can be reordered independently. */
    .checkout-col-left { display: contents; }

    .summary-card { order: 1; }
    .crypto-card  { order: 2; }  /* wallet address before the instructions */
    .steps-card   { order: 3; }
}

/* ============ Card ============ */
.checkout-card {
    position: relative;
    background: linear-gradient(180deg, rgba(30, 30, 38, 0.92) 0%, rgba(20, 20, 26, 0.92) 100%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--card-shadow);
}

.checkout-card.sticky-card {
    position: sticky;
    top: 24px;
}

@media (max-width: 960px) {
    .checkout-card.sticky-card { position: static; }
}

.checkout-card h2 {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.checkout-card h2 i {
    color: var(--brand-red);
    font-size: 15px;
}

.card-divider {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 26px 0;
}

/* ============ Order Summary ============ */
.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    font-size: 14px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

.summary-item:last-of-type { border-bottom: none; }

.summary-item .label {
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.summary-item .value {
    font-weight: 700;
    text-align: right;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
    padding: 18px 20px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.14) 0%, rgba(229, 9, 20, 0.04) 100%);
    border: 1px solid rgba(229, 9, 20, 0.3);
    font-size: 16px;
    font-weight: 700;
}

.summary-total .value {
    color: #ff5a63;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.02em;
}

/* ============ Trust badges ============ */
.trust-badges {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 18px;
}

.trust-badge {
    text-align: center;
    padding: 14px 8px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.trust-badge i {
    display: block;
    font-size: 16px;
    color: var(--success-green);
    margin-bottom: 6px;
}

.trust-badge span {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.3;
    display: block;
}

/* ============ Steps ============ */
.steps-list {
    margin: 0;
    padding: 0;
    list-style: none;
    position: relative;
}

.step-item {
    display: flex;
    gap: 16px;
    padding-bottom: 22px;
    position: relative;
}

.step-item:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 32px;
    bottom: 6px;
    width: 2px;
    background: linear-gradient(180deg, rgba(229, 9, 20, 0.45), rgba(229, 9, 20, 0.05));
}

.step-item:last-child { padding-bottom: 0; }

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--brand-red) 0%, #8f0611 100%);
    color: #fff;
    border-radius: 50%;
    font-weight: 800;
    font-size: 13px;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(229, 9, 20, 0.4);
    z-index: 1;
}

.step-text h4 {
    margin: 5px 0 4px;
    font-size: 14px;
    font-weight: 700;
}

.step-text p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ============ Crypto Tabs ============ */
.crypto-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 22px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
}

.crypto-tabs::-webkit-scrollbar { height: 4px; }
.crypto-tabs::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 2px;
}

.crypto-tab-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-secondary);
    padding: 11px 18px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.crypto-tab-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.07);
    transform: translateY(-1px);
}

.crypto-tab-btn.active {
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.22) 0%, rgba(229, 9, 20, 0.08) 100%);
    border-color: var(--brand-red);
    color: var(--text-primary);
    box-shadow: 0 4px 16px rgba(229, 9, 20, 0.25);
}

.crypto-tab-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ============ Panels ============ */
.crypto-panel { display: none; }

.crypto-panel.active {
    display: block;
    animation: fadeUp 0.28s ease both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============ Alert ============ */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    line-height: 1.5;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.14) 0%, rgba(243, 156, 18, 0.04) 100%);
    border: 1px solid rgba(243, 156, 18, 0.3);
    color: #ffd79a;
}

.alert i {
    font-size: 15px;
    margin-top: 2px;
    flex-shrink: 0;
}

/* ============ Payment fields ============ */
.payment-field { margin-bottom: 18px; }

.payment-field .field-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.09em;
    margin-bottom: 8px;
    font-weight: 700;
}

.field-value-wrapper {
    display: flex;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.field-value-wrapper:hover { border-color: var(--border-strong); }

.field-value {
    flex: 1;
    padding: 14px 16px;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
    user-select: all;
    display: flex;
    align-items: center;
    min-width: 0;
}

.field-value.amount-value {
    font-size: 19px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.copy-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-inline-start: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 104px;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.11);
    color: var(--text-primary);
}

.copy-btn.copied {
    color: var(--success-green);
    background: rgba(46, 204, 113, 0.14);
}

/* ============ QR ============ */
.qr-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 24px 0;
    padding: 22px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
    text-align: center;
}

.qr-code-wrapper {
    width: 168px;
    height: 168px;
    background: #fff;
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-code-wrapper img {
    max-width: 100%;
    height: auto;
    display: block;
}

.qr-text {
    font-size: 12px;
    color: var(--text-secondary);
    max-width: 300px;
}

/* ============ Rate ticker ============ */
.rate-status {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 9px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pulse-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success-green);
    display: inline-block;
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%   { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7); }
    70%  { transform: scale(1);   box-shadow: 0 0 0 7px rgba(46, 204, 113, 0); }
    100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

/* ============ Telegram CTA ============ */
.confirm-payment-section {
    margin-top: 30px;
    padding-top: 26px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.telegram-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, #0088cc 0%, #00b3ff 100%);
    color: #fff;
    text-decoration: none;
    padding: 17px 28px;
    font-size: 15px;
    font-weight: 800;
    border-radius: 999px;
    box-shadow: 0 8px 26px rgba(0, 136, 204, 0.42);
    transition: all 0.25s ease;
    width: 100%;
    animation: ctaGlow 3s ease-in-out infinite;
}

@keyframes ctaGlow {
    0%, 100% { box-shadow: 0 8px 26px rgba(0, 136, 204, 0.38); }
    50%      { box-shadow: 0 8px 34px rgba(0, 136, 204, 0.62); }
}

.telegram-cta-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #009ae6 0%, #17c1ff 100%);
}

.telegram-cta-btn i { font-size: 20px; }

.telegram-cta-note {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 16px;
    line-height: 1.6;
}

/* "I don't own crypto" escape hatch — recovers buyers who want the
   product but don't know how to pay and would otherwise just leave. */
.help-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 18px;
    padding: 12px 20px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    text-decoration: none;
    transition: all 0.2s ease;
}

.help-link:hover {
    color: var(--text-primary);
    border-color: var(--success-green);
    background: rgba(46, 204, 113, 0.07);
}

.help-link i {
    color: var(--success-green);
    font-size: 15px;
    flex-shrink: 0;
}

/* ============ Footer note ============ */
.checkout-footer {
    margin-top: 40px;
    padding-top: 22px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.7;
}

.checkout-footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.checkout-footer a:hover { color: var(--text-primary); }

/* ============ Sticky mobile pay bar ============
   On a phone the confirm button sits far below the fold, under the QR code.
   This keeps the amount and the action in reach at all times. */
.mobile-pay-bar {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(12, 12, 16, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.5);
}

.mobile-pay-bar .mpb-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.mobile-pay-bar .mpb-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.mobile-pay-bar .mpb-amount {
    font-size: 17px;
    font-weight: 900;
    color: #ff5a63;
    letter-spacing: -0.02em;
}

.mobile-pay-bar .mpb-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, #0088cc 0%, #00b3ff 100%);
    color: #fff;
    font-size: 13.5px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 136, 204, 0.4);
}

.mobile-pay-bar .mpb-btn i { font-size: 16px; }

@media (max-width: 640px) {
    .mobile-pay-bar { display: flex; }
}

html[dir="rtl"] .mobile-pay-bar { direction: rtl; }

/* ============ Toast ============ */
.copy-toast {
    position: fixed;
    bottom: 26px;
    left: 50%;
    transform: translate(-50%, 20px);
    background: var(--bg-elevated);
    border: 1px solid var(--success-green);
    color: var(--text-primary);
    padding: 12px 22px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 9px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.copy-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.copy-toast i { color: var(--success-green); }

/* ============ RTL ============ */
html[dir="rtl"] body { direction: rtl; }
html[dir="rtl"] .field-value,
html[dir="rtl"] .checkout-card h2 i { direction: ltr; }
html[dir="rtl"] .field-value { text-align: left; }
html[dir="rtl"] .step-item:not(:last-child)::before { left: auto; right: 15px; }
html[dir="rtl"] .summary-item .value { text-align: left; }
html[dir="rtl"] .back-btn i { transform: scaleX(-1); }

/* ============ Responsive ============ */
/* =========================================================
   TABLET  (≤ 860px)
   ========================================================= */
@media (max-width: 860px) {
    .checkout-container { padding: 20px 16px 56px; }
    .checkout-intro { margin-bottom: 24px; }

    /* backdrop-filter is expensive to composite on mobile GPUs and was
       causing visible scroll stutter. Solid background instead. */
    .checkout-card {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: #16161c;
    }
}

/* =========================================================
   PHONE  (≤ 640px)
   ========================================================= */
@media (max-width: 640px) {
    .checkout-container {
        padding: 16px 12px 96px; /* bottom room for the sticky CTA bar */
    }

    .checkout-card {
        padding: 18px 14px;
        border-radius: var(--radius-md);
    }

    /* ---- Header: keep everything on ONE row ----
       `.header-actions { width:100% }` was forcing a wrap, which pushed the
       controls onto a second line and left the logo stranded on its own. */
    .checkout-header {
        padding: 8px 0 12px;
        margin-bottom: 16px;
        gap: 8px;
        flex-wrap: nowrap;
    }
    .checkout-header .logo { flex-shrink: 0; }
    .checkout-header .logo img { height: 26px; }

    .header-actions {
        gap: 8px;
        width: auto;
        flex-wrap: nowrap;
        margin-inline-start: auto;
    }

    .lang-selector-wrapper {
        padding: 8px 11px;
        min-height: 42px;
        gap: 6px;
    }
    .lang-selector-wrapper select {
        font-size: 16px;           /* keep: prevents iOS zoom */
        max-width: 82px;
    }

    .checkout-header .back-btn {
        padding: 10px 13px;
        min-height: 42px;
        font-size: 12.5px;
        gap: 6px;
    }

    /* ---- Intro: was eating most of the first screen ---- */
    .checkout-intro { margin-bottom: 20px; }
    .checkout-intro .eyebrow { font-size: 9.5px; padding: 5px 12px; margin-bottom: 10px; }
    .checkout-intro h1 { font-size: 24px; margin-bottom: 6px; }
    .checkout-intro p { font-size: 13px; max-width: 340px; }

    /* ---- Summary: compact so the payment panel starts above the fold ---- */
    .checkout-card h2 { font-size: 15.5px; margin-bottom: 13px; padding-bottom: 11px; }

    .summary-item { font-size: 13px; padding: 8px 0; }
    .summary-item .value { font-size: 13px; }

    /* The sticky bar at the bottom already shows the total, so the card
       version no longer needs to shout. */
    .summary-total {
        padding: 13px 14px;
        margin-top: 12px;
        font-size: 13.5px;
    }
    .summary-total .value { font-size: 19px; }

    .trust-badges { grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 13px; }
    .trust-badge { padding: 9px 3px; }
    .trust-badge i { font-size: 13px; margin-bottom: 4px; }
    .trust-badge span { font-size: 9px; }

    /* ---- Coin tabs: grid instead of a hidden horizontal scroll ----
       Off-screen tabs in a scroller are routinely missed on phones. */
    .crypto-tabs {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        overflow: visible;
        padding-bottom: 0;
        margin-bottom: 18px;
    }
    .crypto-tab-btn {
        justify-content: center;
        padding: 12px 6px;
        font-size: 11.5px;
        gap: 6px;
        min-height: 46px;
        border-radius: var(--radius-md);
        white-space: normal;
        text-align: center;
        line-height: 1.2;
    }
    .crypto-tab-btn svg { width: 17px; height: 17px; }
    /* USDT label is long — let it span the full first row */
    .crypto-tab-btn[data-crypto="usdt"] { grid-column: 1 / -1; }

    /* ---- Alerts ---- */
    .alert { font-size: 12.5px; padding: 12px 13px; gap: 10px; }

    /* ---- Payment fields ---- */
    .payment-field { margin-bottom: 16px; }
    .payment-field .field-label { font-size: 10px; }

    /* Address + copy button stack vertically: side by side left the address
       squeezed into ~200px and wrapping across three lines. */
    .field-value-wrapper { flex-direction: column; }

    .field-value {
        font-size: 13px;
        padding: 13px 12px;
        width: 100%;
        line-height: 1.5;
    }
    .field-value.amount-value { font-size: 19px; padding-bottom: 10px; }

    .copy-btn {
        width: 100%;
        min-height: 46px;
        padding: 12px;
        border-left: none;
        border-top: 1px solid var(--border-color);
        font-size: 13px;
    }
    .copy-btn span { display: inline; }   /* label fits again now it's full width */

    .rate-status { font-size: 11.5px; }

    /* ---- QR ---- */
    .qr-section { margin: 20px 0; padding: 18px 12px; }
    .qr-code-wrapper { width: 150px; height: 150px; padding: 10px; }
    .qr-text { font-size: 11.5px; }

    /* ---- CTA ---- */
    .confirm-payment-section { margin-top: 24px; padding-top: 20px; }
    .telegram-cta-btn {
        font-size: 14px;
        padding: 16px 14px;
        gap: 9px;
        min-height: 54px;
        animation: none;             /* stop repainting a shadow on every frame */
    }
    .telegram-cta-btn i { font-size: 18px; }
    .telegram-cta-note { font-size: 12px; margin-top: 12px; }
    .help-link { font-size: 12px; padding: 12px 14px; min-height: 46px; }

    /* ---- Steps ---- */
    .step-item { gap: 13px; padding-bottom: 18px; }
    .step-number { width: 28px; height: 28px; font-size: 12px; }
    .step-item:not(:last-child)::before { left: 13px; }
    .step-text h4 { font-size: 13.5px; }
    .step-text p { font-size: 12.5px; }

    .checkout-footer { margin-top: 28px; font-size: 11.5px; }

    .copy-toast { bottom: 84px; font-size: 12.5px; padding: 11px 18px; }
}

/* =========================================================
   SMALL PHONE  (≤ 360px — iPhone SE, Galaxy A0x)
   ========================================================= */
/* Narrow phones: the "Back to Plans" label crowds the header, so keep the
   arrow only. Still a 42px target and still labelled for screen readers. */
@media (max-width: 430px) {
    .checkout-header .back-btn span { display: none; }
    .checkout-header .back-btn { padding: 10px 14px; }
    .lang-selector-wrapper select { max-width: 96px; }
}

@media (max-width: 360px) {
    .checkout-container { padding: 14px 10px 92px; }
    .checkout-card { padding: 16px 12px; }
    .checkout-intro h1 { font-size: 22px; }
    .checkout-intro p { font-size: 12.5px; }
    .field-value { font-size: 12px; }
    .crypto-tabs { grid-template-columns: repeat(2, 1fr); }
    .crypto-tab-btn[data-crypto="usdt"] { grid-column: 1 / -1; }
    .trust-badge span { font-size: 8.5px; }
    .qr-code-wrapper { width: 132px; height: 132px; }
    .summary-total .value { font-size: 17px; }
}

/* =========================================================
   Notched phones — keep content clear of the home indicator
   ========================================================= */
@supports (padding: max(0px)) {
    @media (max-width: 640px) {
        .checkout-container {
            padding-left: max(12px, env(safe-area-inset-left));
            padding-right: max(12px, env(safe-area-inset-right));
        }
        .mobile-pay-bar {
            padding-bottom: max(10px, env(safe-area-inset-bottom));
        }
    }
}

/* =========================================================
   Landscape phone — the sticky bar eats too much of a short screen
   ========================================================= */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 480px) {
    .mobile-pay-bar { display: none !important; }
    .checkout-container { padding-bottom: 40px; }
}

/* Sold-out / reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
