/* Topkeys overrides served alongside main2.css.
   These rules are not produced by the SASS pipeline (which writes to main.min.css).
   When this file grows, fold its rules into the matching SASS partials. */

/* Catalog card resilience: keep the original 424/198 aspect ratio at every viewport;
   instead of letting the card grow, shrink the badge and price chips so they always fit
   on one row alongside the Steam platform icon. */
.catalog .card {
    overflow: hidden;
    padding: 12px 16px;
    gap: 8px;
}
.catalog .card__top {
    width: 100%;
    min-width: 0;
    gap: 6px;
    flex-wrap: nowrap;
}
.catalog .card__top .badge {
    flex: 0 1 auto;
    min-width: 0;
    max-width: calc(100% - 40px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.15;
    padding: 4px 10px;
    height: auto;
    min-height: 22px;
    font-size: clamp(9px, 0.78vw, 12px);
}
.catalog .card__top .badge::before {
    width: clamp(10px, 0.95vw, 14px) !important;
}
.catalog .card__top .game-platform {
    margin-left: auto;
    flex: 0 0 auto;
    width: clamp(22px, 2vw, 28px);
}
.catalog .card__bottom {
    width: 100%;
    min-width: 0;
    gap: 8px;
}
.catalog .card .block-buy {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    padding: 4px 12px;
    gap: 4px;
}
.catalog .card .block-buy .old-price,
.catalog .card .block-buy .new-price {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.catalog .card .block-buy .new-price {
    font-size: clamp(11px, 0.95vw, 15px);
}
.catalog .card .block-buy .old-price {
    font-size: clamp(8px, 0.7vw, 11px);
}

/* Below the SASS desktopMd breakpoint the card already uses smaller padding,
   so just enforce the same compact badge/price sizing without breaking the aspect ratio. */
@media (max-width: 1199.98px) {
    .catalog .card {
        padding: 10px 14px;
        gap: 6px;
    }
    .catalog .card__top .badge {
        font-size: 10px;
        min-height: 20px;
        padding: 3px 8px;
    }
    .catalog .card .block-buy {
        padding: 3px 10px;
    }
    .catalog .card .block-buy .new-price {
        font-size: 12px;
    }
}

@media (max-width: 767.98px) {
    /* The SASS already switches the card to fixed height/100% width on mobile;
       keep the chip sizes consistent with the new compact look. */
    .catalog .card__top .badge {
        font-size: 11px;
        min-height: 22px;
    }
    .catalog .card .block-buy {
        padding: 4px 12px;
    }
    .catalog .card .block-buy .new-price {
        font-size: 14px;
    }
}

/* Footer requisites block (rendered when a footer slug is set in the landing settings) */
.footer__requisites {
    margin: 20px 0;
    color: rgba(242, 242, 242, 0.7);
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}
.footer__requisites p {
    margin: 4px 0;
}
.footer__requisites hr {
    border-color: rgba(255, 255, 255, 0.08);
    margin: 12px 0;
}
.footer__requisites .footer-requisites,
.footer__requisites .footer-contact {
    padding: 0 10px;
}
.footer__copy {
    color: rgba(242, 242, 242, 0.5);
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}
.footer__copy p {
    margin: 4px 0;
}
.footer__copy a {
    color: rgba(242, 242, 242, 0.85);
    text-decoration: underline;
}
.footer__copy a:hover {
    color: #ccff00;
}

/* Tabs dropdown (under 1200px) — replace overflowing tab nav with a full-width dropdown.
   Used by product tabs on the game page and by catalog category tabs on the home page. */
.tabs-dropdown {
    position: relative;
    width: 100%;
    margin-bottom: 16px;
}
.tabs-dropdown .btn-product-tabs-toggle {
    width: 100%;
    text-align: left;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f2f2f2;
    border-radius: 999px;
    padding: 14px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}
.tabs-dropdown .btn-product-tabs-toggle:focus,
.tabs-dropdown .btn-product-tabs-toggle:focus-visible {
    box-shadow: none;
    outline: none;
}
.tabs-dropdown .btn-product-tabs-toggle::after {
    margin-left: auto;
    border-top-color: rgba(242, 242, 242, 0.7);
}
.tabs-dropdown .dropdown-menu {
    width: 100%;
    background: #1b1b1b;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 6px;
}
.tabs-dropdown .dropdown-item {
    color: #f2f2f2;
    border-radius: 999px;
    padding: 10px 18px;
    font-weight: 500;
}
.tabs-dropdown .dropdown-item:hover,
.tabs-dropdown .dropdown-item:focus,
.tabs-dropdown .dropdown-item.active {
    background: rgba(204, 255, 0, 0.18);
    color: #ccff00;
}

/* Vertical sidebar menu — keep category items evenly spaced and don't stretch over the entire hero height */
.vertical-menu {
    height: auto !important;
    min-height: auto;
    position: sticky;
    top: 16px;
}
.vertical-menu .vertical-menu__inner {
    height: auto;
    padding: 8px 0;
}
.vertical-menu .vertical-menu__center {
    flex: 0 0 auto;
    gap: 12px;
    padding: 6px;
}
.vertical-menu .menu-icon {
    flex: 0 0 auto;
}
.vertical-menu .menu-icon__content {
    pointer-events: none;
}

/* Hero slider adaptiveness — keep both the hero slide and the steam platform card visible at intermediate widths */
.hero__main {
    flex-wrap: wrap;
    align-items: stretch;
}
.hero__slider {
    flex: 1 1 480px;
    min-width: 0;
}
.hero__main .platform-card {
    flex: 1 1 360px;
    min-width: 0;
}
@media (max-width: 1365.98px) {
    .hero__slider {
        min-width: 0;
        flex: 1 1 100%;
    }
    .hero__main .platform-card {
        width: 100%;
        flex: 1 1 100%;
    }
    .hero-slide {
        height: auto;
        min-height: 440px;
        padding: 24px 32px;
    }
    .platform-card {
        height: auto;
        min-height: 440px;
        padding: 24px 32px;
    }
}
@media (max-width: 1199.98px) {
    .hero-slide,
    .platform-card {
        min-height: 380px;
    }
    .hero-slide .brief__title,
    .platform-card .brief__title {
        font-size: 22px;
    }
}

/* Catalog page (/all-games) pagination — numbered pages above the "Назад на главную" button. */
.catalog-page .catalog-bottom {
    flex-direction: column;
    gap: 24px;
    margin-top: 32px;
}
.catalog-page .catalog-bottom > .btn {
    margin-top: 16px;
}
.catalog-pagination__pages {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}
.catalog-pagination__page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
    color: #f2f2f2;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.15s ease;
}
.catalog-pagination__page:hover {
    background: rgba(204, 255, 0, 0.18);
    color: #f2f2f2;
}
.catalog-pagination__page.is-active {
    background: #ccff00;
    color: #111;
    font-weight: 700;
}
.catalog-pagination__ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    color: rgba(242, 242, 242, 0.5);
    font-size: 14px;
}

/* Catalog tab AJAX loader */
.tab-pane.is-loading {
    position: relative;
    min-height: 200px;
    pointer-events: none;
}
.tab-pane.is-loading > * {
    opacity: 0.35;
    transition: opacity 0.15s ease-out;
}
.tab-pane.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 48px;
    height: 48px;
    margin: -24px 0 0 -24px;
    border: 3px solid rgba(204, 255, 0, 0.2);
    border-top-color: #ccff00;
    border-radius: 50%;
    animation: topkeys-tab-spin 0.7s linear infinite;
    z-index: 5;
}
@keyframes topkeys-tab-spin {
    to { transform: rotate(360deg); }
}

/* Product description tabs (desc / activation) — markup-aligned styles */
.product-description {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    color: rgb(242, 242, 242);
    font-size: 14px;
    line-height: 1.5;
}
.product-description > strong,
.product-description > b {
    display: block;
    color: rgb(242, 242, 242);
    font-weight: 900;
    font-size: 24px;
    line-height: 1.2;
}
.product-description p,
.product-description dl {
    margin: 0 0 20px;
}
.product-description dl dt {
    font-size: 12px;
    color: rgb(83, 83, 83);
    margin: 20px 0 4px;
    font-weight: 400;
}
.product-description dl dt:first-child {
    margin-top: 0;
}
.product-description dl dd {
    font-size: 14px;
    margin: 0.5em 0 0;
}
.product-description dl dd:last-child {
    margin-bottom: 0;
}
.product-description dl dd p {
    margin: 0 0 0.5em;
}
.product-description ol {
    list-style: none;
    counter-reset: prod-step;
    padding: 0;
    margin: 0;
    width: 100%;
}
.product-description ol li {
    counter-increment: prod-step;
    position: relative;
    padding-left: 48px;
    min-height: 32px;
    margin-bottom: 16px;
}
.product-description ol li:last-child {
    margin-bottom: 0;
}
.product-description ol li::before,
.product-description ol li::after {
    position: absolute;
    left: 4px;
    top: 16px;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    font-weight: 900;
    border-radius: 4px;
    justify-content: center;
    display: flex;
    align-items: center;
    text-transform: uppercase;
    font-size: 14px;
    color: #111;
}
.product-description ol li::before {
    z-index: 1;
    content: counter(prod-step);
}
.product-description ol li::after {
    content: '';
    transform: translateY(-50%) rotate(-45deg);
    transform-origin: center;
    background: #ccff00;
}
.product-description ol li dl {
    margin: 0;
}

/* Product page stats block (300K+ / 5 / 24/7) */
.stats {
    display: flex;
    gap: 20px;
    justify-content: flex-end;
}
.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: rgb(79, 56, 92);
    text-align: center;
    position: relative;
}
.stat-item__count {
    font-weight: 900;
    font-size: 24px;
    text-transform: uppercase;
}
.stat-item__text {
    font-size: 14px;
}
.stat-item:not(:last-child) {
    padding-right: 34px;
}
.stat-item:not(:last-child)::after {
    display: inline-block;
    position: absolute;
    top: 50%;
    transform: translateY(-50%) rotate(-75deg);
    right: -18px;
    content: '';
    width: 52px;
    border: 1px solid rgba(79, 56, 92, 0.28);
}
@media (max-width: 1199.98px) {
    .stats {
        justify-content: space-between;
        margin-bottom: 20px;
    }
    .stat-item {
        flex: 1;
    }
}
@media (max-width: 767.98px) {
    .stats {
        flex-wrap: wrap;
    }
    .stat-item:last-child {
        flex: none;
        width: 100%;
    }
}

/* Attention block (Увага / Важно!) */
.attention {
    color: #ccff00;
    margin-top: 8px;
    width: 100%;
}
.attention__title {
    margin-bottom: 4px;
    font-size: 24px;
    font-weight: 900;
}
.attention__text {
    font-size: 14px;
    color: #ccff00;
}
.attention__text p {
    margin: 0;
}

/* Product page system requirements tab — label/value list */
.sys-req {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.sys-req__label {
    margin: 0 0 6px;
    color: rgba(242, 242, 242, 0.5);
    font-weight: 400;
    font-size: 14px;
    line-height: 1.4;
}
.sys-req__value {
    margin: 0 0 24px;
    color: rgb(242, 242, 242);
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
}
.sys-req__value:last-child {
    margin-bottom: 0;
}

/* Login modal: rules-confirm checkbox layout and validation feedback */
#login .rules-confirm {
    padding-left: 0;
    margin-bottom: 16px;
}
#login .rules-confirm .form-check-label {
    cursor: pointer;
    color: rgb(242, 242, 242);
    font-size: 14px;
    line-height: 1.4;
    display: inline-block;
    position: relative;
}
#login .rules-confirm .invalid-feedback,
#login .rules-confirm__feedback {
    display: none;
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.3;
    color: #FF4D4D !important;
    text-align: center;
    width: 100%;
    font-weight: 600;
}
#login .rules-confirm.is-invalid .invalid-feedback,
#login .rules-confirm.is-invalid .rules-confirm__feedback {
    display: block !important;
}
#login .rules-confirm.is-invalid .form-check-label {
    color: #FF4D4D !important;
}
#login .rules-confirm.is-invalid .form-check-label::before {
    border-color: #FF4D4D !important;
    background-color: rgba(255, 77, 77, 0.12) !important;
    box-shadow: 0 0 0 2px rgba(255, 77, 77, 0.25);
}
#login .rules-confirm.is-invalid .form-check-label::after {
    background-color: #FF4D4D !important;
}
