/* walkthroughs-shop — landing page. Scoped to .ws-shop.
   Theme: walkthroughs.games dark (background near-black + red/orange accent #ef4444) */

:root {
    --ws-bg-deep: #0e0f12;
    --ws-surface: #15171c;
    --ws-surface-2: #1c1f26;
    --ws-surface-3: #232831;
    --ws-border: rgba(255,255,255,.08);
    --ws-border-strong: rgba(255,255,255,.18);
    --ws-text: #f1f1f3;
    --ws-text-muted: rgba(255,255,255,.6);
    --ws-text-dim: rgba(255,255,255,.35);
    --ws-accent: #ef4444;
    --ws-accent-hover: #f87171;
    --ws-accent-soft: rgba(239,68,68,.12);
    --ws-success: #34d399;
}

.ws-shop {
    max-width: 1200px;
    margin: 2rem auto 3rem;
    padding: 0 1rem;
    color: var(--ws-text);
}
.ws-shop__hero-title,
.ws-shop__grid-title {
    font-size: clamp(1.75rem, 4.5vw, 3rem);
    font-weight: 800;
    margin: 0 0 1.25rem;
    letter-spacing: -.01em;
    text-transform: uppercase;
    color: #fff;
}
.ws-shop__hero-title-accent { color: var(--ws-accent); }
.ws-shop__grid-title-accent { color: var(--ws-accent); }

/* Hero shell */
.ws-shop__hero-card {
    padding: 1.5rem;
    border-radius: 16px;
    background: linear-gradient(180deg, var(--ws-surface) 0%, var(--ws-surface-2) 100%);
    border: 1px solid var(--ws-border);
    margin-bottom: 3rem;
    box-shadow: 0 4px 24px rgba(0,0,0,.4);
}

/* ===== Steam form — 2-column layout ===== */
.ws-steam-form__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 900px) {
    .ws-steam-form__grid {
        grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr);
    }
}

.ws-steam-form__left { display: flex; flex-direction: column; min-width: 0; }
.ws-steam-form__header {
    display: flex; align-items: flex-start; gap: 1rem;
    flex-direction: column;
    margin-bottom: 1.5rem;
}
@media (min-width: 600px) {
    .ws-steam-form__header { flex-direction: row; align-items: center; }
}
.ws-steam-form__logo {
    width: 96px; height: 96px; flex-shrink: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #1b2838 0%, #0f1620 100%);
    border: 1px solid rgba(255,255,255,.06);
    display: flex; align-items: center; justify-content: center;
}
.ws-steam-form__logo img { width: 70px; height: 70px; object-fit: contain; }
.ws-steam-form__logo-fallback {
    font-weight: 800; font-size: 1rem;
    color: #66c0f4; letter-spacing: .12em;
}

.ws-steam-form__heading { display: flex; flex-direction: column; gap: .4rem; }
.ws-steam-form__title { font-size: 1.5rem; font-weight: 700; margin: 0; color: #fff; line-height: 1.2; }
.ws-steam-form__tag {
    display: inline-flex; align-items: center; gap: .35rem;
    align-self: flex-start;
    padding: .3rem .65rem;
    background: var(--ws-accent-soft);
    border: 1px solid rgba(239,68,68,.3);
    border-radius: 999px;
    font-size: .75rem; font-weight: 600; color: var(--ws-accent);
    letter-spacing: .02em;
}
.ws-steam-form__subtitle { font-size: .9375rem; color: var(--ws-text-muted); margin: 0; }

.ws-steam-form__label {
    display: block;
    font-size: .8125rem;
    color: var(--ws-text-muted);
    margin: 1rem 0 .4rem;
    font-weight: 500;
}
.ws-steam-form__input {
    width: 100%;
    padding: .85rem 1rem;
    background: var(--ws-surface-3);
    border: 1px solid var(--ws-border);
    border-radius: 10px;
    color: #fff; font-size: .9375rem;
    box-sizing: border-box;
    transition: border-color .15s, background .15s;
}
.ws-steam-form__input:hover { border-color: var(--ws-border-strong); }
.ws-steam-form__input:focus {
    outline: none;
    border-color: var(--ws-accent);
    background: var(--ws-surface-2);
}
.ws-steam-form__input::placeholder { color: var(--ws-text-dim); }
.ws-steam-form__hint {
    font-size: .75rem;
    color: var(--ws-text-dim);
    margin: .4rem 0 0;
}

.ws-steam-form__amount-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: .75rem;
}
@media (min-width: 500px) {
    .ws-steam-form__amount-row { grid-template-columns: 1fr 1fr; }
}
.ws-steam-form__payout-box {
    padding: .85rem 1rem;
    background: var(--ws-surface-3);
    border: 1px solid var(--ws-border);
    border-radius: 10px;
    color: #fff; font-size: .9375rem; font-weight: 600;
    display: flex; align-items: center; gap: .5rem;
    min-height: 1.18rem;
}

.ws-steam-form__quick-picks {
    margin-top: 1rem;
    display: flex; flex-wrap: wrap; gap: .5rem;
}
.ws-steam-form__quick-btn {
    padding: .5rem .9rem;
    background: var(--ws-surface-3);
    border: 1px solid var(--ws-border);
    border-radius: 10px;
    color: var(--ws-text); font-size: .8125rem; font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
}
.ws-steam-form__quick-btn:hover {
    border-color: var(--ws-accent);
    color: #fff;
}
.ws-steam-form__quick-btn.is-active {
    background: var(--ws-accent-soft);
    border-color: var(--ws-accent);
    color: var(--ws-accent);
}

/* RIGHT COLUMN — payment summary */
.ws-steam-form__right {
    background: var(--ws-surface);
    border: 1px solid var(--ws-border);
    border-radius: 14px;
    padding: 1.5rem;
    display: flex; flex-direction: column;
    height: fit-content;
}
.ws-steam-form__summary-title {
    font-size: 1.125rem; font-weight: 700; margin: 0 0 1rem;
    color: #fff;
}
.ws-steam-form__info-box {
    display: flex; align-items: flex-start; gap: .65rem;
    background: var(--ws-accent-soft);
    border: 1px solid rgba(239,68,68,.2);
    border-radius: 10px;
    padding: .75rem .9rem;
    margin-bottom: 1.25rem;
}
.ws-steam-form__info-box > span {
    color: var(--ws-accent);
    font-size: 1rem; flex-shrink: 0; line-height: 1.2;
}
.ws-steam-form__info-box > p { margin: 0; font-size: .8125rem; color: var(--ws-text-muted); line-height: 1.4; }

.ws-steam-form__summary-list {
    list-style: none; padding: 0;
    margin: 0 0 1.25rem;
    display: flex; flex-direction: column; gap: .65rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--ws-border);
}
.ws-steam-form__summary-list li {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: .9375rem;
}
.ws-steam-form__summary-list li > span { color: var(--ws-text-muted); }
.ws-steam-form__summary-list li > strong { color: #fff; font-weight: 600; font-size: 1rem; }
.ws-steam-form__cashback { color: var(--ws-success) !important; }

.ws-steam-form__payment-section { margin-bottom: 1.25rem; }
.ws-steam-form__payment-label {
    font-size: .8125rem; font-weight: 500;
    color: var(--ws-text-muted);
    margin: 0 0 .5rem;
}
.ws-steam-form__payment-methods {
    display: flex; gap: .25rem; padding: .25rem;
    background: var(--ws-surface-3); border-radius: 10px;
    border: 1px solid var(--ws-border);
}
.ws-steam-form__pay-btn {
    flex: 1; height: 48px;
    background: transparent; border: 0; cursor: pointer;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, transform .15s;
    position: relative;
}
.ws-steam-form__pay-btn:hover:not(.is-active) { background: rgba(255,255,255,.04); }
.ws-steam-form__pay-btn.is-active {
    background: var(--ws-surface);
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

/* SBP / МИР — dark-text-on-transparent brand logos rendered on the form's
 * dark surface. We force them monochrome white via `brightness(0) invert(1)`
 * so the text reads — sacrifices SBP's multi-color star, but matches dark-mode
 * UI conventions (Tinkoff, Yandex Pay etc do this in their dark themes). */
.ws-steam-form__pay-logo {
    max-height: 28px;
    max-width: 80%;
    width: auto; height: auto;
    object-fit: contain;
    display: block;
    filter: brightness(0) invert(1);
    opacity: .82;
    transition: opacity .15s;
}
.ws-steam-form__pay-btn.is-active .ws-steam-form__pay-logo { opacity: 1; }

/* Submit */
.ws-steam-form__submit {
    width: 100%;
    height: 48px;
    border: 0;
    background: linear-gradient(135deg, var(--ws-accent) 0%, #dc2626 100%);
    color: #fff;
    border-radius: 10px;
    font-weight: 700; font-size: .9375rem;
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(239,68,68,.4), 0 8px 24px rgba(239,68,68,.18);
    transition: filter .15s, transform .15s, opacity .15s;
}
.ws-steam-form__submit:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.ws-steam-form__submit:disabled {
    opacity: .4; cursor: not-allowed;
    background: var(--ws-surface-3);
    box-shadow: none;
}

.ws-steam-form__terms {
    display: flex; align-items: flex-start; gap: .5rem;
    margin-top: 1rem;
    font-size: .75rem; color: var(--ws-text-muted);
    cursor: pointer;
    line-height: 1.4;
}
.ws-steam-form__terms input[type="checkbox"] {
    width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px;
    accent-color: var(--ws-accent); cursor: pointer;
}
.ws-steam-form__terms a { color: var(--ws-text); text-decoration: underline; text-underline-offset: 2px; }
.ws-steam-form__terms a:hover { color: var(--ws-accent); }

/* ===== Game grid ===== */
.ws-shop__grid-section { margin-top: 2rem; }
.ws-shop__grid {
    list-style: none; padding: 0; margin: 0;
    display: grid; gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.ws-shop__grid-card {
    border: 1px solid var(--ws-border);
    border-radius: 14px;
    overflow: hidden;
    background: var(--ws-surface);
    transition: transform .2s ease, border-color .2s;
}
.ws-shop__grid-card:hover {
    border-color: var(--ws-border-strong);
}
.ws-shop__grid-card.is-expanded {
    border-color: rgba(239,68,68,.3);
}

.ws-shop__card-trigger {
    width: 100%;
    padding: 0;
    background: transparent;
    color: inherit;
    border: 0;
    cursor: pointer;
    display: flex; flex-direction: column;
}
.ws-shop__card-image {
    width: 100%;
    aspect-ratio: 1/1;
    background: var(--ws-surface-2);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    position: relative;
}
.ws-shop__card-image img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
/* Some games use logo PNGs (transparent background) — contain instead of cover, with
   a dark backdrop so the logo reads cleanly. Marked per-slug. */
.ws-card-img--contain img {
    object-fit: contain !important;
    padding: 1rem;
    background: linear-gradient(180deg, var(--ws-surface) 0%, var(--ws-surface-3) 100%);
}
.ws-shop__card-image-fallback {
    /* Color cards by slug — generated bg + game name overlay */
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    font-weight: 800; font-size: 1.05rem;
    color: #fff;
    text-align: center;
    line-height: 1.2;
    text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
/* Per-slug gradient backgrounds for fallback covers */
.ws-card-bg-genshin-impact-ru { background: linear-gradient(135deg, #5b48a5 0%, #c084fc 100%); }
.ws-card-bg-honkai-star-rail-ru { background: linear-gradient(135deg, #1e3a8a 0%, #ec4899 100%); }
.ws-card-bg-zenless-zone-zero-ru { background: linear-gradient(135deg, #facc15 0%, #f59e0b 100%); color: #1a1a1a !important; }
.ws-card-bg-mobile-legends-ru { background: linear-gradient(135deg, #7c3aed 0%, #0ea5e9 100%); }
.ws-card-bg-mobile-legends-global { background: linear-gradient(135deg, #7c3aed 0%, #0ea5e9 100%); }
.ws-card-bg-pubg-mobile { background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%); }
.ws-card-bg-garena-free-fire { background: linear-gradient(135deg, #f97316 0%, #dc2626 100%); }
.ws-card-bg-marvel-rivals { background: linear-gradient(135deg, #dc2626 0%, #7c2d12 100%); }
.ws-card-bg-honor-of-kings { background: linear-gradient(135deg, #fbbf24 0%, #b91c1c 100%); }
.ws-card-bg-stumble-guys { background: linear-gradient(135deg, #06b6d4 0%, #6366f1 100%); }
.ws-card-bg-afk-journey { background: linear-gradient(135deg, #14b8a6 0%, #0891b2 100%); }
.ws-card-bg-snowbreak { background: linear-gradient(135deg, #e0e7ff 0%, #4f46e5 100%); color: #1e1b4b !important; text-shadow: 0 1px 4px rgba(255,255,255,.3) !important; }
.ws-card-bg-punishing-gray-raven { background: linear-gradient(135deg, #1f2937 0%, #9333ea 100%); }
.ws-card-bg-arena-breakout { background: linear-gradient(135deg, #44403c 0%, #ca8a04 100%); }
.ws-card-bg-delta-force { background: linear-gradient(135deg, #1e3a8a 0%, #65a30d 100%); }
.ws-card-bg-honkai-star-rail-us { background: linear-gradient(135deg, #312e81 0%, #f472b6 100%); }
.ws-card-bg-zenless-zone-zero-us { background: linear-gradient(135deg, #f59e0b 0%, #facc15 100%); color: #422006 !important; text-shadow: 0 1px 4px rgba(255,255,255,.3) !important; }
.ws-card-bg-genshin-impact-eu { background: linear-gradient(135deg, #4338ca 0%, #c084fc 100%); }

.ws-shop__card-name {
    padding: .75rem 1rem;
    font-size: .9375rem; font-weight: 600;
    margin: 0;
    text-align: left;
    color: var(--ws-text);
}

/* When a card's modal is open: only highlight the trigger, card stays in grid (no reflow) */
.ws-shop__grid-card.is-expanded { border-color: var(--ws-accent); }

/* Modal backdrop (solid, no blur — backdrop-filter on 11 gradient cards kills perf) */
body.ws-shop-modal-open { overflow: hidden; }
body.ws-shop-modal-open::before {
    content: '';
    position: fixed; inset: 0;
    background: rgba(0,0,0,.85);
    z-index: 1000;
}

/* Modal itself — only visible when parent card has .is-expanded */
.ws-shop-modal {
    display: none;
}
.ws-shop__grid-card.is-expanded .ws-shop-modal {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: min(900px, 92vw);
    max-height: 90vh;
    z-index: 1001;
    background: var(--ws-surface);
    border: 1px solid var(--ws-border);
    border-radius: 16px;
    overflow: hidden;
}

.ws-shop-modal__header {
    display: flex; align-items: center; gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--ws-surface);
    border-bottom: 1px solid var(--ws-border);
    flex-shrink: 0;
}
.ws-shop-modal__icon {
    width: 48px; height: 48px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    display: flex; align-items: stretch; justify-content: stretch;
    background: var(--ws-surface-3);
}
.ws-shop-modal__icon img { width: 100%; height: 100%; object-fit: cover; }
.ws-shop-modal__icon > span { display: block; width: 100%; height: 100%; }
.ws-shop-modal__title {
    flex: 1;
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 700;
    color: #fff;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ws-shop-modal__close {
    background: transparent;
    border: 0;
    color: var(--ws-text-muted);
    font-size: 1.25rem;
    line-height: 1;
    padding: .4rem .65rem;
    border-radius: 8px;
    cursor: pointer;
    transition: color .15s, background .15s;
}
.ws-shop-modal__close:hover {
    color: var(--ws-text);
    background: var(--ws-surface-3);
}

.ws-shop-modal__body {
    overflow-y: auto;
    padding: 1.25rem;
    flex: 1;
}

/* (old form-container rules replaced by .ws-shop-modal above) */

/* ===== Expanded game form — 2-col like Steam ===== */
.ws-game-form__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}
@media (min-width: 900px) {
    .ws-game-form__grid {
        grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
    }
}
.ws-game-form__left { display: flex; flex-direction: column; min-width: 0; }
.ws-game-form__header {
    display: flex; align-items: center; gap: 1rem;
    margin-bottom: 1.25rem;
}
.ws-game-form__cover {
    width: 80px; height: 80px; flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--ws-surface-3);
    display: flex; align-items: center; justify-content: center;
}
.ws-game-form__cover img { width: 100%; height: 100%; object-fit: cover; }
.ws-game-form__cover-text {
    color: #fff; font-weight: 700; font-size: .75rem;
    text-align: center; padding: .25rem; line-height: 1.1;
    text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.ws-game-form__heading { display: flex; flex-direction: column; gap: .25rem; }
.ws-game-form__title {
    font-size: 1.25rem; font-weight: 700; margin: 0; color: #fff; line-height: 1.2;
}
.ws-game-form__subtitle {
    font-size: .8125rem; color: var(--ws-text-muted); margin: 0;
}

.ws-game-form__label {
    display: block; font-size: .8125rem; color: var(--ws-text-muted);
    margin: .85rem 0 .35rem; font-weight: 500;
}
.ws-game-form__input {
    width: 100%;
    padding: .75rem .9rem;
    background: var(--ws-surface-3);
    border: 1px solid var(--ws-border);
    border-radius: 8px;
    color: #fff; font-size: .9375rem;
    box-sizing: border-box;
    transition: border-color .15s, background .15s;
}
.ws-game-form__input:hover { border-color: var(--ws-border-strong); }
.ws-game-form__input:focus {
    outline: none; border-color: var(--ws-accent);
    background: var(--ws-surface-2);
}
.ws-game-form__input::placeholder { color: var(--ws-text-dim); }
.ws-game-form__hint { font-size: .75rem; color: var(--ws-text-dim); margin: .35rem 0 0; }

.ws-game-form__right {
    background: var(--ws-surface);
    border: 1px solid var(--ws-border);
    border-radius: 12px;
    padding: 1rem;
    display: flex; flex-direction: column;
    height: fit-content;
}
.ws-game-form__denoms {
    display: flex; flex-direction: column; gap: .4rem;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 4px;
    margin-bottom: 1rem;
}
.ws-game-form__denoms::-webkit-scrollbar { width: 4px; }
.ws-game-form__denoms::-webkit-scrollbar-track { background: var(--ws-surface-2); border-radius: 4px; }
.ws-game-form__denoms::-webkit-scrollbar-thumb { background: var(--ws-border-strong); border-radius: 4px; }
.ws-game-form__denom {
    display: flex; align-items: center; gap: .65rem;
    padding: .65rem .8rem;
    background: var(--ws-surface-3);
    border: 1px solid var(--ws-border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.ws-game-form__denom:hover { border-color: var(--ws-border-strong); }
.ws-game-form__denom:has(input:checked) {
    border-color: var(--ws-accent);
    background: var(--ws-accent-soft);
}
.ws-game-form__denom input[type="radio"] {
    width: 16px; height: 16px; accent-color: var(--ws-accent); margin: 0; flex-shrink: 0;
}
.ws-game-form__denom-name {
    flex: 1; font-size: .8125rem; font-weight: 500; color: #fff;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ws-game-form__denom-price {
    font-size: .875rem; font-weight: 700; color: #fff;
    flex-shrink: 0;
}

.ws-game-form__summary {
    margin: 0 0 1rem;
    padding: .75rem .9rem;
    background: var(--ws-surface-3);
    border-radius: 8px;
}
.ws-game-form__summary-row {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: .9375rem;
}
.ws-game-form__summary-row > span { color: var(--ws-text-muted); }
.ws-game-form__summary-row > strong { color: #fff; font-weight: 700; font-size: 1.05rem; }

.ws-game-form__submit {
    width: 100%; height: 44px; border: 0;
    background: linear-gradient(135deg, var(--ws-accent) 0%, #dc2626 100%);
    color: #fff; border-radius: 10px;
    font-weight: 700; font-size: .9375rem;
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(239,68,68,.4), 0 6px 18px rgba(239,68,68,.15);
    transition: filter .15s, transform .15s;
}
.ws-game-form__submit:hover { filter: brightness(1.08); transform: translateY(-1px); }

.ws-game-form__terms-note {
    font-size: .7rem; color: var(--ws-text-dim);
    margin: .75rem 0 0; line-height: 1.4; text-align: center;
}
.ws-game-form__terms-note a { color: var(--ws-text-muted); text-decoration: underline; }
.ws-game-form__terms-note a:hover { color: var(--ws-accent); }

/* Error / fallback */
.ws-shop--error { text-align: center; padding: 4rem 1rem; }
.ws-shop__inline-error {
    padding: .8rem 1rem;
    background: var(--ws-accent-soft);
    border: 1px solid rgba(239,68,68,.3);
    border-radius: 10px;
    color: #fca5a5;
    font-size: .875rem;
    margin-bottom: 1rem;
}

/* Theme suppression on shop pages */
body.ws-shop-page .entry-title,
body.ws-shop-page .page-title,
body.ws-shop-page .post-title,
body.ws-shop-page .wp-block-post-title,
body.ws-shop-page header.entry-header,
body.ws-shop-page .page-header,
body.ws-shop-page .single-header,
body.ws-shop-page main > h1:first-child,
body.ws-shop-page article > h1:first-child,
body.ws-shop-page .elementor-heading-title,
body.ws-shop-page .breadcrumbs + h1 { display: none !important; }

.screen-reader-text { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
