@media (max-width: 1508px) {
    .main .custom-tabs > .tab-links {
        grid-gap: 20px;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        padding-bottom: 60px;
    }

    .main .custom-tabs {
        padding-bottom: 60px;
    }

    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="money"] > .results-wrapper > .result-price,
    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="money"] > .results-wrapper > .result-amount,
    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="other"] > .results-wrapper > .result-price,
    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="other"] > .results-wrapper > .result-amount {
        width: 50%;
    }

    .main .custom-tabs > .tabs-wrapper > .items > .item-list > .item-id:last-child:after {
        display: none;
    }
}

@media (max-width: 1399px) {
    #slider > .slider-wrapper {
        height: 400px !important;
    }

    #slider > .slider-wrapper > .slider-slide {
        padding: 40px 60px;
    }

    .main .custom-tabs > .tabs-wrapper > .items > .item-list {
        width: 560px;
    }

    .main .custom-tabs > .tabs-wrapper > .items > .item-list > .item-id {
        font-size: 16px;
    }

    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="cases"] > .amount-title,
    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="money"] > .amount-title {
        font-size: 20px;
    }

    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="cases"] > .results-wrapper {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="cases"] > .results-wrapper > .result-amount {
        height: 80px;
    }

    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="cases"] > .results-wrapper > .result-price {
        padding-left: 0;
        justify-content: center;
        text-align: center;
        height: 80px;
    }
}

@media (max-width: 1199px) {
    .main .custom-tabs > .tab-links {
        grid-gap: 8px;
        grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
        padding-bottom: 40px;
    }

    .main .custom-tabs > .tab-links > li {
        height: 120px;
        padding-top: 80px;
        font-size: 14px;
    }

    .main .custom-tabs > .tab-links > li > .image {
        background-size: contain;
        padding: 20px;
    }

    .main .page-description {
        padding-bottom: 40px;
    }

    .main .custom-tabs > .tabs-wrapper {
        padding: 0;
    }

    .main .custom-tabs > .tabs-wrapper > .items > .item-list {
        width: 400px;
        padding-right: 20px;
    }

    .main .custom-tabs > .tabs-wrapper > .item {
        padding-left: 20px;
    }

    .main .custom-tabs > .tabs-wrapper > .items > .item-list > .item-id {
        padding: 0 40px;
        font-size: 14px;
    }


    .main .custom-tabs > .tabs-wrapper > .items > .item-list > .item-id > .block-info {
        margin-left: 20px;
    }
}

@media (max-width: 991px) {
    #slider > .slider-wrapper {
        height: 280px !important;
    }

    #slider > .slider-wrapper > .slider-slide h1 {
        font-size: 32px;
        line-height: normal;
    }

    #slider > .slider-wrapper > .slider-slide .slide-description {
        padding: 20px 0;
        font-size: 16px;
        line-height: normal;
    }

    #slider > .slider-wrapper > .slider-slide .slide-button {
        height: 48px;
        width: 240px;
        max-width: 100%;
    }

    .main .custom-tabs > .tab-links {
        display: flex;
        gap: 20px;
        flex-wrap: wrap;

    }

    .main .custom-tabs > .tab-links > li {
        flex-grow: 1;
        width: auto;
        min-width: 160px;
    }

    .main .custom-tabs > .tabs-wrapper > .item > .title > .title-wrapper {
        font-size: 20px;
    }

    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="money"] > .results-wrapper,
    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="other"] > .results-wrapper {
        flex-wrap: wrap;
        gap: 20px;
    }

    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="money"] > .results-wrapper > .result-price,
    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="money"] > .results-wrapper > .result-amount,
    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="other"] > .results-wrapper > .result-price,
    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="other"] > .results-wrapper > .result-amount {
        width: 100%;
        margin: 0;
        height: 60px;
    }

    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="money"] > .results-wrapper > .result-amount > .result,
    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="other"] > .results-wrapper > .result-amount > .result {
        font-size: 14px;
    }

    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="money"] > .results-wrapper > .result-price input,
    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="other"] > .results-wrapper > .result-price input {
        height: 60px;
        font-size: 18px;
    }

    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="money"] > .form-wrapper,
    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="other"] > .form-wrapper {
        padding-top: 20px;
    }

    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="permgroup"] > .form-wrapper > .block-time {
        width: 100%;
    }

    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="subs"] > .form-wrapper > .block-time {
        width: 100%;
    }
}

@media (max-width: 767px) {
    body.item-has-opened,
    html.item-has-opened{
        overflow: hidden;
        position:relative;
        height: 100%;
    }

    .main .custom-tabs > .tabs-wrapper {
        display: block;
    }

    .main .custom-tabs > .tabs-wrapper > .items {
        width: 100%;
        max-width: 100%;
        border-right: 0;
        border-radius: 20px;
    }

    .main .custom-tabs > .tabs-wrapper > .items > .item-list {
        width: 100%;
        max-width: 100%;
        max-height: 100%;
        padding: 16px 12px;
    }
    
    .main .custom-tabs > .tabs-wrapper > .items > .item-list > .item-id {
        padding: 24px 18px;
        margin-bottom: 12px;
        border-radius: 16px;
    }
    
    .main .custom-tabs > .tabs-wrapper > .items > .item-list > .item-id > .image {
        width: 48px;
        height: 48px;
    }
    
    .main .custom-tabs > .tabs-wrapper > .items > .item-list > .item-id > .block-info {
        margin-left: 14px;
    }
    
    .main .custom-tabs > .tabs-wrapper > .items > .item-list > .item-id > .block-info > .title {
        font-size: 16px;
    }
    
    .main .custom-tabs > .tabs-wrapper > .items > .item-list > .item-id > .block-price > .price > .current-price {
        font-size: 14px;
    }
    
    .items-header {
        padding: 16px 20px;
        border-radius: 20px 20px 0 0;
    }
    
    .items-header-title {
        font-size: 16px;
    }
    
    .items-header-arrow {
        width: 36px;
        height: 36px;
    }

    .main .custom-tabs > .tabs-wrapper > .item {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        margin: 0;
        margin-left: 0 !important;
        background-color: #000;
        z-index: 100;
        padding: 12px;
        padding-top: 70px;
        padding-bottom: 12px;
        display: none;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box;
    }

    body.dark-theme .main .custom-tabs > .tabs-wrapper > .item {
        background-color: #000;
    }

    .main .custom-tabs > .tabs-wrapper > .item.open {
        display: flex;
        flex-direction: column;
    }

    .main .custom-tabs > .tabs-wrapper > .item.open > .close-item {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 58px;
        background: #0a0a0a;
        border-bottom: 1px solid #222;
        justify-content: space-between;
        align-items: center;
        padding: 0 16px;
        z-index: 101;
        font-size: 0;
        color: transparent;
    }
    
    .main .custom-tabs > .tabs-wrapper > .item.open > .close-item::before {
        content: "OREMINE";
        font-size: 18px;
        font-weight: 900;
        color: #ffffff;
        text-transform: uppercase;
        letter-spacing: 2px;
        font-style: italic;
    }
    
    .main .custom-tabs > .tabs-wrapper > .item.open > .close-item::after {
        content: "✕";
        font-size: 22px;
        font-weight: 300;
        color: #ffffff;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Заголовок товара в попапе */
    .main .custom-tabs > .tabs-wrapper > .item > .title {
        border-radius: 16px;
        padding: 14px 16px;
        margin-bottom: 8px;
        flex-shrink: 0;
    }
    
    .main .custom-tabs > .tabs-wrapper > .item > .title .title-wrapper {
        font-size: 18px;
    }
    
    .main .custom-tabs > .tabs-wrapper > .item > .title > .title-left > .title-label {
        font-size: 10px;
    }
    
    .main .custom-tabs > .tabs-wrapper > .item > .title > .title-icon .product-icon {
        width: 44px;
        height: 44px;
        border-radius: 10px;
    }
    
    /* Описание */
    .main .custom-tabs > .tabs-wrapper > .item > .description {
        border-radius: 14px;
        padding: 12px 14px;
        margin-top: 8px;
        font-size: 12px;
        line-height: 1.4;
        overflow-y: auto;
        min-height: 0;
        max-height: 35vh;
        height: auto;
        flex-shrink: 0;
    }
    
    /* Поле ввода ника */
    .main .custom-tabs > .tabs-wrapper > .item .username-block {
        margin-top: 8px;
        flex-shrink: 0;
    }
    
    .main .custom-tabs > .tabs-wrapper > .item .username-block .username-input input {
        height: 48px;
        border-radius: 12px;
        font-size: 14px;
    }
    
    /* Поле ввода ника (внутри item-wrapper) */
    .main .custom-tabs > .tabs-wrapper > .item .username-block-inner {
        margin-top: 12px;
    }
    
    .main .custom-tabs > .tabs-wrapper > .item .username-block-inner input {
        height: 48px;
        border-radius: 12px;
        font-size: 14px;
    }
    
    /* Checkout wrapper - в мобильной версии поле ввода и кнопка в одну строку */
    .main .custom-tabs > .tabs-wrapper > .item .checkout-wrapper {
        padding: 16px;
        border-radius: 16px;
        display: flex;
        flex-direction: row;
        gap: 12px;
        align-items: flex-start;
    }
    
    .main .custom-tabs > .tabs-wrapper > .item .checkout-wrapper .username-block-inner {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        flex: 1;
        min-width: 0;
        position: relative;
        height: 48px;
    }
    
    .main .custom-tabs > .tabs-wrapper > .item .checkout-wrapper .username-block-inner input {
        height: 48px !important;
        width: 100%;
        margin: 0 !important;
        padding: 0 24px;
        box-sizing: border-box;
    }
    
    /* Сообщения об ошибках не должны влиять на выравнивание */
    .main .custom-tabs > .tabs-wrapper > .item .checkout-wrapper .username-block-inner .input-error,
    .main .custom-tabs > .tabs-wrapper > .item .checkout-wrapper .username-block-inner .input-success {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        margin-top: 4px;
        z-index: 1;
    }
    
    .main .custom-tabs > .tabs-wrapper > .item .checkout-bottom {
        display: flex;
        flex-direction: row;
        gap: 0;
        align-items: center;
        border-top: none;
        margin-top: 0 !important;
        padding-top: 0 !important;
        flex-shrink: 0;
        width: auto;
        height: 48px;
        align-self: flex-start;
    }
    
    /* Скрываем блок с иконкой и ценой в мобильной версии */
    .main .custom-tabs > .tabs-wrapper > .item .checkout-bottom .checkout-info {
        display: none !important;
    }
    
    .main .custom-tabs > .tabs-wrapper > .item .checkout-icon {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }
    
    .main .custom-tabs > .tabs-wrapper > .item .checkout-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .main .custom-tabs > .tabs-wrapper > .item .checkout-price .purchase-amount {
        font-size: 22px;
    }
    
    /* Кнопка покупки - квадратная со стрелкой в мобильной версии */
    .main .custom-tabs > .tabs-wrapper > .item .checkout-bottom .purchase-btn {
        width: 48px !important;
        min-width: 48px !important;
        max-width: 48px !important;
        height: 48px !important;
        padding: 0 !important;
        flex-shrink: 0;
        font-size: 0 !important;
        position: relative;
        border-radius: 12px;
        gap: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Скрываем текст кнопки, показываем только стрелку - идеальное центрирование */
    .main .custom-tabs > .tabs-wrapper > .item .checkout-bottom .purchase-btn::after {
        content: "→" !important;
        font-size: 24px !important;
        font-weight: 400 !important;
        margin: 0 !important;
        padding: 0 !important;
        position: absolute !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        line-height: 24px !important;
        display: table-cell !important;
        vertical-align: middle !important;
        width: 24px !important;
        height: 24px !important;
        text-align: center !important;
        box-sizing: border-box !important;
        font-family: inherit !important;
    }
    
    .main .custom-tabs > .tabs-wrapper > .item .checkout-bottom .purchase-btn:hover::after {
        transform: translate(-50%, -50%) translateX(2px) !important;
    }
    
    .main .custom-tabs > .tabs-wrapper > .item .checkout-bottom .purchase-btn:hover::after {
        transform: translate(-50%, -50%) translateX(2px) !important;
    }
    
    /* Убираем существующий ::before для блика, если он мешает */
    .main .custom-tabs > .tabs-wrapper > .item .checkout-bottom .purchase-btn::before {
        display: block;
    }
    
    /* Блок покупки */
    .main .custom-tabs > .tabs-wrapper > .item .purchase-block {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 14px 16px;
        border-radius: 14px;
        margin-top: 8px;
        flex-shrink: 0;
    }
    
    .main .custom-tabs > .tabs-wrapper > .item .purchase-block .purchase-info {
        flex-shrink: 0;
    }
    
    .main .custom-tabs > .tabs-wrapper > .item .purchase-block .purchase-icon {
        display: none;
    }
    
    .main .custom-tabs > .tabs-wrapper > .item .purchase-block .purchase-label {
        font-size: 11px;
    }
    
    .main .custom-tabs > .tabs-wrapper > .item .purchase-block .purchase-amount {
        font-size: 22px;
    }
    
    .main .custom-tabs > .tabs-wrapper > .item .purchase-block .purchase-btn {
        height: 48px;
        padding: 0 24px;
        font-size: 14px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* item-wrapper */
    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper {
        flex-shrink: 0;
    }
    
    /* Заглушка на мобильных скрыта - товар уже выбран при открытии */
    .main .custom-tabs > .tabs-wrapper > .item > .item-placeholder {
        display: none;
    }

    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="permgroup"] > .form-wrapper {
        display: grid;
        grid-gap: 12px;
        grid-template-columns: 100%;
    }

    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="permgroup"] > .form-wrapper > .block-username {
        width: 100%;
    }

    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="subs"] > .form-wrapper {
        display: grid;
        grid-gap: 12px;
        grid-template-columns: 100%;
    }

    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="subs"] > .form-wrapper > .block-username {
        width: 100%;
    }

    .main .custom-tabs > .tabs-wrapper > .item > [type="submit"] {
        width: 100%;
        margin-top: 16px;
    }


    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="money"] > .form-wrapper,
    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="other"] > .form-wrapper,
    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="cases"] > .form-wrapper {
        padding-top: 12px;
        width: 100%;
    }

    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="cases"] > .form-wrapper > .block-username,
    .main .custom-tabs > .tabs-wrapper > .item > .item-wrapper[data-type="cases"] > .form-wrapper > .block-time {
        width: 100%;
    }



    .modal[data-id="buy"] .modal-footer-new {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .modal[data-id="buy"] .btn-check {
        width: 100%;
    }

    .modal .btn {
        margin-top: 0;
    }
}

@media (max-width: 639px) {
    #slider {
        display: none;
    }

    .main {
        padding-top: 0;
    }

    .main .pagename {
        padding-top: 0;
    }

    .main .page-description {
        padding-bottom: 40px;
    }

    .modal > .wrapper > .modal-content > .modal-header {
        text-align: center;
    }
}

@media (max-width: 559px) {
    .modal[data-id="buy"] > .wrapper > .modal-content > .modal-footer,
    .modal[data-id="buy"] > .wrapper > .modal-content > .modal-body {
        width: 100%;
    }

    .modal[data-id="buy"] > .wrapper > .modal-content > .modal-header {
        font-size: 20px;
        gap: 20px;
    }

    .modal[data-id="buy"] > .wrapper > .modal-content > .modal-description {
        padding: 20px 0;
        font-size: 14px;
    }

    .modal[data-id="confirm"] .parts {
        grid-template-columns: 100%;
    }

    .modal[data-id="commission"] > .wrapper > .modal-content > .modal-footer {
        display: grid;
        grid-gap: 20px;
        grid-template-columns: 100%;
        align-items: start;
    }

    .modal[data-id="commission"] > .wrapper > .modal-content > .modal-footer .btn {
        display: flex;
        width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 440px) {
    .main .custom-tabs > .tabs-wrapper > .items > .item-list > .item-id {
        padding: 0 12px;
    }


    .modal[data-id="buy"] > .wrapper > .modal-content > .modal-body {
        padding: 28px 24px;
    }
    
    .modal[data-id="buy"] .modal-header-new {
        padding: 28px 24px;
    }
    
    .modal[data-id="buy"] .modal-footer-new {
        padding: 24px;
    }
    
    .modal[data-id="buy"] .modal-subinfo-new {
        padding: 20px 24px 28px;
    }
}

/* Модальное окно выбора способа оплаты на мобильных */
@media (max-width: 767px) {
    .modal[data-id="method"] {
        padding: 16px;
    }
    
    .modal[data-id="method"] > .wrapper {
        max-width: 100%;
        max-height: calc(100vh - 32px);
        display: flex;
        flex-direction: column;
    }
    
    .modal[data-id="method"] > .wrapper > .modal-content {
        border-radius: 24px;
        max-height: 100%;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    .modal[data-id="method"] > .wrapper > .modal-content > .modal-header {
        padding: 20px 60px 20px 24px;
        font-size: 18px;
        flex-shrink: 0;
    }
    
    .modal[data-id="method"] > .wrapper > .modal-content > .close-modal {
        top: 14px;
        right: 14px;
        width: 40px;
        height: 40px;
    }
    
    .modal[data-id="method"] > .wrapper > .modal-content > .modal-body {
        padding: 16px;
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .modal[data-id="method"] .methods {
        grid-template-columns: 1fr;
        grid-gap: 10px;
    }

    .prefix-templates {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .prefix-form-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .category-fast-link {
        margin-left: 0;
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 387px) {
    .modal[data-id="method"] .methods > li > .block-top > .subtext {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .prefix-templates {
        grid-template-columns: 1fr;
    }
}