/* ============================================
   Responsive Utility Classes
   Breakpoints:
     xs: <576px
     sm: 576-767px
     md: 768-991px
     lg: 992-1199px
     xl: ≥1200px
   ============================================ */

/* --- Tailwind-style responsive gaps/flex --- */
@media (min-width: 640px) {
    .sm\:gap-4 { gap: 1rem; }
    .sm\:gap-6 { gap: 1.5rem; }
    .sm\:flex-row { flex-direction: row; }
}

@media (min-width: 768px) {
    .md\:gap-4 { gap: 1rem; }
    .md\:gap-6 { gap: 1.5rem; }
    .md\:flex-row { flex-direction: row; }
}

@media (min-width: 1024px) {
    .lg\:gap-4 { gap: 1rem; }
    .lg\:gap-6 { gap: 1.5rem; }
    .lg\:flex-row { flex-direction: row; }
}

@media (min-width: 1280px) {
    .xl\:gap-4 { gap: 1rem; }
    .xl\:gap-10 { gap: 2.5rem; }
    .xl\:flex-col { flex-direction: column; }
}

/* --- Visibility helpers --- */
@media (max-width: 575px) {
    .hidden-xs-down { display: none !important; }
}

@media (max-width: 767px) {
    .hidden-sm-down { display: none !important; }
}

/* Hidden on tablets and below (sidebar hides here) */
@media (max-width: 991px) {
    .hidden-md-down { display: none !important; }
}

/* Hidden on desktop and above (mobile menu toggle hides here) */
@media (min-width: 992px) {
    .hidden-md-up { display: none !important; }
}

@media (max-width: 1199px) {
    .hidden-lg-down { display: none !important; }
}

@media (min-width: 1200px) {
    .hidden-xl-up { display: none !important; }
}

/* --- Header logo link: на мобиле занимает центр между гамбургером и action-кнопками,
   на десктопе остаётся как было (центрировано) --- */
.header-logo-link {
    display: inline-block;
    text-align: center;
}
.header-logo-link img { max-height: 68px; width: auto; }

@media (max-width: 991px) {
    .container-header {
        justify-content: space-between;
        gap: 8px;
        padding: 0 6px;
    }
    .header-logo-link {
        flex: 1 1 auto;
        text-align: center;
        min-width: 0;
    }
    .header-logo-link img {
        max-height: 60px;
        max-width: 100%;
    }
}

/* --- Mobile action buttons (ЛК + вход/выход в шапке) --- */
.header-mobile-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.header-mobile-action {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 8px;
    color: #A2CF41;
    text-decoration: none;
    border-radius: 50%;
    transition: background-color 0.2s;
}
.header-mobile-action:hover,
.header-mobile-action:focus,
.header-mobile-action:active {
    color: #8BB238;
    background-color: rgba(162, 207, 65, 0.08);
    text-decoration: none;
}
.header-mobile-action .fa { font-size: 22px; }
/* Переопределяем absolute-позиционирование .exit-header внутри мобильной кнопки */
.header-mobile-action .exit-header {
    position: static;
    top: auto;
    left: auto;
    width: 28px;
    height: 28px;
    background-size: 56px;
    background-position: 0 center;
}
.header-mobile-action--auth:hover .exit-header,
.header-mobile-action--auth:focus .exit-header {
    background-position: -28px center;
}

/* --- Navbar / Header --- */
@media (max-width: 991px) {
    .site_logo2 { height: 80px; }

    .navbar-header { height: 84px; }

    .navbar-toggle {
        padding: 10px 12px;
        display: block;
        margin: 0;
        min-width: 44px;
        min-height: 44px;
        flex-shrink: 0;
    }

    .navbar-collapse {
        border-top: 1px solid transparent;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
        max-height: inherit !important;
    }

    .navbar-fixed-top {
        top: 0;
        border-width: 0 0 1px;
    }

    .navbar-nav > li {
        float: left;
        display: inline-table;
        line-height: 1.5;
    }

    .navbar-nav > li > a {
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .collapse.in { display: block !important; }

    .container-header { display: flex; }

    .navbar-nav { display: none !important; }
}

/* --- Header bar zoom --- */
@media (max-width: 1200px) { .header-bar { zoom: 0.91; } }
@media (max-width: 1140px) { .header-bar { zoom: 0.9; } }
@media (max-width: 1100px) { .header-bar { zoom: 0.85; } }

@media (min-width: 992px) and (max-width: 1068px) {
    .nav > li > a { padding: 15px 7px 10px 7px; }
}

/* --- Modal dialog --- */
@media (min-width: 768px) {
    .modal-dialog { width: 760px; margin: 30px auto; }
}

/* Планшеты (портрет): 760px почти впритык к краям экрана — оставляем отступ */
@media (min-width: 768px) and (max-width: 991px) {
    .modal-dialog { width: calc(100% - 48px); margin: 30px auto; }
}

/* --- Catalog / Sidebar --- */
@media only screen and (max-width: 992px) {
    .side-bar-news { margin-top: auto; }

    .product-carousel { margin-top: 10px; }
}

@media only screen and (max-width: 768px) {
    .product-carousel { margin-top: 20px; }

    .resultsBirdiebugSpecials {
        padding-right: initial;
        margin-left: 15px;
    }

    .search-bar-wrapper {
        margin-top: 30px;
        margin-bottom: 30px;
    }

    .resultsPricesRange { padding-left: 15px; text-align: left; }
    .resultsTimesPromos { padding-left: 10px; }
}

/* --- Карточка товара (детальная) на мобиле/планшете ---
   Фото-блок имеет фикс. height:300px в modern.css — на мобиле картинка часто
   мельче и создаёт пустое пространство. Делаем гибким, чтобы рамка
   подстраивалась под фото. */
@media (max-width: 991px) {
    #page-container.container-fluid {
        padding-left: 0;
        padding-right: 0;
    }

    .page-content {
        padding-top: 12px;
        padding-bottom: 12px;
        overflow-x: hidden;
        margin-left: 0;
        margin-right: 0;
    }

    .page-content > [class*="col-"] {
        max-width: 100%;
        overflow-x: hidden;
    }

    .product-card .row { margin-left: -8px; margin-right: -8px; }
    .product-card .row > [class*="col-"] {
        padding-left: 8px;
        padding-right: 8px;
    }

    .product-card .product-image-main {
        height: auto;
        min-height: 200px;
        max-height: 70vw;
        padding: 6px;
    }
    .product-card .product-image-main img {
        height: auto;
        max-height: 65vw;
        width: auto;
        max-width: 100%;
    }

    /* search-bar row */
    .search-bar-row {
        margin-top: 1rem;
    }
}

/* --- Карточка-листинг: убираем фикс. height блока контента,
   уменьшаем шрифт «stock-status», нормализуем кнопку корзины --- */
@media (max-width: 767px) {
    /* Inline-style на .product-grid .flex.flex-col.p-3 имеет max-height:160 / min-height:150 —
       перебиваем для всех экранов планшета и ниже (а не только ≤520). */
    .product-grid .flex.flex-col.p-3 {
        max-height: none !important;
        min-height: auto !important;
        height: auto !important;
        padding: 8px !important;
    }

    /* «Есть в наличии и по предзаказу» — мельче и компактнее */
    /*.product-grid .stock-status {*/
    /*    font-size: 12px;*/
    /*    min-height: 0;*/
    /*    line-height: 1.25;*/
    /*    margin-bottom: 4px;*/
    /*}*/

    /* Кнопка корзины — фикс. размер, без растяжения на всю ширину */
    /*.product-grid .btn-buy {*/
    /*    height: 2.6rem;*/
    /*    width: 2.6rem;*/
    /*    background-position: -23px center;*/
    /*    background-size: 56px;*/
    /*    flex-shrink: 0;*/
    /*}*/

    /*.product-grid .product-title {*/
    /*    font-size: 0.9rem;*/
    /*    line-height: 1.25;*/
    /*    margin-bottom: 4px !important;*/
    /*}*/
}

/* --- Product Grid Cards (mobile fixes) --- */

/* Mobile: compact card layout */
@media only screen and (max-width: 520px) {
    /*.product-grid .product-qty-block {*/
    /*    flex-direction: column;*/
    /*    gap: 4px;*/
    /*}*/

    /*.product-grid .p-qty-num {*/
    /*    justify-content: center;*/
    /*}*/

    /*.product-grid .btn-buy {*/
    /*    height: 2.5rem;*/
    /*    width: 2.5rem;*/
    /*}*/

    /*.product-grid .qty-input {*/
    /*    width: 1.8rem;*/
    /*    height: 2rem;*/
    /*    font-size: 1rem;*/
    /*}*/

    /*.product-grid .product-btn-minus,*/
    /*.product-grid .product-btn-plus {*/
    /*    width: 22px;*/
    /*    height: 22px;*/
    /*    font-size: 10px;*/
    /*    padding: 1px;*/
    /*}*/

    /*.product-grid .text-2xl {*/
    /*    font-size: 1rem;*/
    /*}*/

    .product-thumbnail {
        overflow: hidden;
    }

    .product-grid-img a {
        padding: 0.4rem;
    }

    /*.product-grid .product-title {*/
    /*    min-height: 2.5rem;*/
    /*    font-size: 0.8rem;*/
    /*    line-height: 1.3;*/
    /*}*/

    /* Reduce bottom padding to fit controls */
    /*.product-grid .flex.flex-col.p-3 {*/
    /*    padding: 6px !important;*/
    /*    max-height: none !important;*/
    /*    min-height: auto !important;*/
    /*}*/
}

/* Small phones: tighter layout */
@media only screen and (max-width: 380px) {
    /*.product-grid .product-qty-block {*/
    /*    flex-direction: column;*/
    /*    align-items: center;*/
    /*    gap: 2px;*/
    /*}*/

    /*.product-grid .flex.flex-row.justify-between.items-center {*/
    /*    flex-direction: column;*/
    /*    gap: 4px;*/
    /*}*/

    /*.product-grid .btn-buy {*/
    /*    width: 2.4rem;*/
    /*    height: 2.4rem;*/
    /*    background-position: -23px center;*/
    /*    background-size: 52px;*/
    /*}*/
}

/* 521px-610px: column layout for qty block */
@media only screen and (min-width: 521px) and (max-width: 610px) {
    /*.product-grid .product-qty-block {*/
    /*    flex: 0 0 auto;*/
    /*    flex-direction: column;*/
    /*}*/

    /*.product-grid .btn-buy {*/
    /*    height: 3rem;*/
    /*    width: 3rem;*/
    /*}*/
}

/* 611px+: row layout for qty block */
@media only screen and (min-width: 611px) {
    /*.product-grid .product-qty-block {*/
    /*    flex: 1 1 0;*/
    /*    flex-direction: row;*/
    /*}*/

    /*.product-grid .btn-buy {*/
    /*    height: 3rem;*/
    /*    width: 3rem;*/
    /*}*/
}

/* Desktop sidebar visible, product grid adjusts */
@media (min-width: 992px) and (max-width: 1199px) {
    /*.product-grid .product-qty-block {*/
    /*    flex: 0 0 auto;*/
    /*    flex-direction: column;*/
    /*}*/

    /*.product-grid .btn-buy {*/
    /*    height: 4rem;*/
    /*    width: 4rem;*/
    /*}*/
}

/* --- Корзина: ширины колонок (бывшие inline width:NNNpx) --- */
.table-cart .cart-col-price { width: 80px; }
.table-cart .cart-col-qty { width: 90px; }
.table-cart .cart-qty-value {
    display: inline-block;
    width: 40px;
    padding: 4px 2px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 3px;
    -moz-appearance: textfield;
}
.table-cart .cart-qty-value::-webkit-outer-spin-button,
.table-cart .cart-qty-value::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Иконки +/-/корзина — везде (десктоп/планшет/мобиле) одного,
   компактного размера — раньше уменьшались только на мобиле. */
.btn-cart-change-qty { padding: 4px 5px; }
.btn-cart-delete-product { font-size: 14px; padding: 4px; }

/* «(по предзаказу)» — отдельной строкой под названием товара, на всех
   экранах; жирным на десктопе/планшете, обычным начертанием на мобиле
   (см. переопределение внутри @media max-width:767px ниже). */
.table-cart .cart-title-preorder {
    display: block;
    font-weight: 700;
    margin-top: 2px;
}

/* Корзина на мобиле/планшете: карточный рендер вместо широкой таблицы.
   Скрываем «технические» колонки SKU/Сферы/Предзаказ/№ и раскладываем
   ячейки построчно блоком. */
@media (max-width: 767px) {
    .table-cart {
        border: 0;
    }
    .table-cart thead { display: none; }

    .table-cart > tbody > tr {
        display: grid;
        grid-template-columns: auto 1fr auto auto;
        grid-template-areas:
            "title   title   title   title"
            "price   cost    cost    cost"
            "bonus   bonus   qty     actions";
        position: relative;
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 6px;
        margin-bottom: 10px;
        padding: 10px;
        align-items: center;
        gap: 0 4px;
    }
    .table-cart > tbody > tr > td {
        display: block;
        border: 0 !important;
        padding: 3px 0;
        width: auto !important;
        text-align: left !important;
        white-space: normal !important;
    }

    /* Скрытые колонки (техническая инфа, не критична на мобиле) */
    .table-cart .cart-col-index,
    .table-cart .cart-col-sku {
        display: none !important;
    }

    /* «Сферы» — показываем только если есть значение (для позиций без
       бонуса ячейка пустая, лишний ярлык не нужен). Раньше эта колонка
       была скрыта совсем — теряли стоимость товара в сферах на мобиле. */
    .table-cart .cart-col-bonus {
        grid-area: bonus;
        display: none;
        font-size: 12px;
        color: #666;
    }
    .table-cart .cart-col-bonus:not(:empty) {
        display: block;
    }
    .table-cart .cart-col-bonus:not(:empty)::before {
        content: 'Сферы: ';
        color: #666;
    }

    .table-cart .cart-col-title {
        grid-area: title;
        font-weight: 600;
        font-size: 14.5px;
        line-height: 1.3;
        padding-right: 4px;
        word-break: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    /* «(по предзаказу)» под названием — обычным начертанием на мобиле
       (жирным — на десктопе/планшете, базовое правило выше). */
    .table-cart .cart-title-preorder {
        font-weight: normal;
        font-size: 13px;
    }

    /* Цена / Кол-во / Стоимость идут с подписями (псевдо-метки) */
    .table-cart .cart-col-price::before {
        content: 'Цена: ';
        color: #666;
        font-size: 12px;
    }
    .table-cart .cart-col-price::after {
        content: ' /';
        color: #666;
        margin-right: 0;
    }
    .table-cart .cart-col-cost::before {
        content: 'Стоимость: ';
        color: #666;
        font-size: 12px;
    }

    .table-cart .cart-col-qty {
        grid-area: qty;
        margin-top: 0;
        justify-self: center;
    }
    .table-cart .cart-col-qty .flex {
        justify-content: center !important;
    }

    .table-cart .cart-col-price {
        grid-area: price;
    }
    .table-cart .cart-col-cost {
        grid-area: cost;
        justify-self: start;
    }

    /* Кнопка удалить — справа от плюс/минус */
    .table-cart .cart-col-actions {
        grid-area: actions;
        position: static !important;
        padding: 0 !important;
        text-align: center !important;
        align-self: center;
    }

    /* Totals — компактный flex-ряд */
    .table-cart > tbody > tr[data-cart-subtotal-row],
    .table-cart > tbody > tr[data-cart-delivery-row],
    .table-cart > tbody > tr[data-cart-total-row] {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        padding: 6px 10px;
        background: transparent;
        border: 0;
        border-top: 1px dashed #ddd;
        border-radius: 0;
        margin-bottom: 0;
    }
    .table-cart > tbody > tr[data-cart-total-row] {
        border-top: 2px solid #A2CF41;
        margin-top: 4px;
    }
    .table-cart .cart-totals-spacer { display: none !important; }
    .table-cart .cart-totals-label {
        font-weight: 700;
        flex: 1;
    }
    .table-cart .cart-totals-value {
        font-weight: 700;
    }
}

/* --- Корзина модальная --- */
/*#cartModal .modal-dialog {*/
/*    max-width: 480px;*/
/*    width: 90%;*/
/*}*/

@media (max-width: 767px) {
    /* Заголовок страницы — компактнее на мобиле */
    h1.lined { font-size: 1.8rem; }

    /* Кнопка удалить — вертикальное позиционирование в карточке
       (размер иконки теперь общий для всех breakpoint'ов, см. выше) */
    .btn-cart-delete-product { margin-top: 0; }

    /* Количество и удаление стоят в одной строке со сферами. */
    .table-cart .cart-col-qty { margin-top: 0; }

    /* Получатель — поля друг под другом */
    .order-options-receiver .row > .col-xs-4 { width: 100%; float: none; }

    #cartModal .modal-dialog {
        margin: 10px;
    }

    #cartModal .modal-body {
        max-height: calc(100vh - 150px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    #cartModal .modal-footer {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
    #cartModal .modal-footer .btn {
        width: 100%;
        margin: 0;
    }
}

/* --- Модалка адресов: распорка задаёт минимальную ширину формы на десктопе,
   на мобиле «складывается» в 100%. --- */
.address-modal-spacer {
    width: 100%;
}
@media (min-width: 768px) {
    .address-modal-spacer {
        min-width: 500px;
        height: 0;
    }
}

/* --- Кошелёк: формы вывода/обмена/перевода ---
   На мобиле inline width/min-width выталкивают контент за viewport.
   Перебиваем все через !important. */
@media (max-width: 767px) {
    /* Все div с inline min-width внутри кошелька */
    .col-lg-9 div[style*="min-width"] {
        min-width: 0 !important;
    }

    /* Панели кошелька — обрезать overflow */
    .col-lg-9 .panel-body {
        overflow-x: auto;
    }

    /* Inputs суммы и реквизитов */
    #swap-amount,
    #withdrawal-amount,
    #transfer-amount,
    #transfer-recipient {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* form-group и flex-обёртки — на полную ширину */
    #swap-form .form-group,
    #swap-form > div,
    #withdrawal-form .form-group,
    #withdrawal-form > div,
    #transfer-form .form-group,
    #transfer-form > div {
        min-width: 0 !important;
        flex-basis: 100% !important;
        max-width: 100%;
    }

    #swap-result {
        display: inline-block;
        white-space: normal;
    }
    #swap-result-wrap {
        min-width: 0 !important;
        width: 100% !important;
        text-align: center;
    }

    #swap-amount + button,
    #withdrawal-amount + button,
    #transfer-amount + button {
        flex-shrink: 0;
    }
    #swap-amount,
    #withdrawal-amount,
    #transfer-amount {
        flex: 1 1 auto;
        min-width: 0 !important;
    }

    .panel-body table[style*="max-width"] {
        max-width: 100% !important;
    }

    #tab-withdrawal .table,
    #tab-swap .table {
        font-size: 12px;
    }
    #tab-withdrawal .table > tbody > tr > td,
    #tab-withdrawal .table > thead > tr > th,
    #tab-swap .table > tbody > tr > td,
    #tab-swap .table > thead > tr > th {
        padding: 4px 3px;
    }
}

/* Header items: легаси-правила удалены — шапка перестроена на flex
   (.site-header), см. блок «REFACTORED HEADER» в modern.css. */

/* --- Very small screens --- */
@media only screen and (max-width: 400px) {
    .site_logo2 { display: none !important; }

    .product-card .product-qty-block { flex-direction: column; }

    .product-carousel {
        padding: 0 25px 30px 25px;
    }

    .product-carousel .carousel-control.right { right: -20px; z-index: 9; }
    .product-carousel .carousel-control.left { left: -20px; z-index: 9; }
}

@media only screen and (max-width: 375px) {
    .header-mobile-about {
        margin-right: auto;
        padding: 15px 5px;
        zoom: 0.9;
    }
}

/* --- Container width on tablets --- */
@media (min-width: 600px) and (max-width: 991px) {
    .container { width: auto; }
}

/* --- Footer: desktop (>=992px) — 5 колонок в ряд (как было исторически) --- */
@media (min-width: 992px) {
    .col-xs-2.hidden-xs-up.resultsBirdiebugSpecials { display: none !important; }

    .foot_wrap {
        display: flex;
        height: 80px;
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }

    .container-footer {
        text-align: left;
    }
}

/* --- Footer: tablet + mobile (<992px) — верхний ряд в 2 колонки
   (ссылки | контакты), ниже — тоже 2 колонки (ближайшие доставки |
   бесплатная доставка); если доставка отключена (.no-freeship) —
   «ближайшие доставки» на всю ширину. Одинаковая сетка на планшете и
   мобиле, только отступы/gap чуть просторнее на планшете. --- */
@media (max-width: 991px) {
    .container-footer {
        padding: 18px 15px calc(18px + env(safe-area-inset-bottom, 0px));
    }

    .foot_wrap {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "links contacts"
            "delivery freeship";
        gap: 14px 16px;
        height: auto;
    }

    .foot_wrap.no-freeship {
        grid-template-areas:
            "links contacts"
            "delivery delivery";
    }

    .foot_wrap .footer-col {
        width: auto;
        line-height: 1.4;
    }

    .footer-col-links   { grid-area: links; }
    .footer-col-contacts { grid-area: contacts; }
    .footer-col-delivery { grid-area: delivery; }
    .footer-col-min-order { grid-area: freeship; }

    .footer-col-title {
        font-weight: 700;
        opacity: 0.9;
        margin-bottom: 2px;
    }

    .footer-col-logo { display: none; }
}

@media (min-width: 700px) and (max-width: 991px) {
    .foot_wrap {
        gap: 20px 24px;
    }

    /* Без блока «Бесплатная доставка» ставим «Ближайшие доставки» в один
       ряд с «Контакты» (как на десктопе), а не отдельной строкой снизу —
       иначе получается «лесенка». */
    .foot_wrap.no-freeship {
        grid-template-columns: 1fr 1fr 1fr;
        grid-template-areas: "links contacts delivery";
    }
}

/* --- Бета-плашка (mobile-first) --- */
.beta-notice {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}
.beta-notice-inner {
    background: #fff;
    color: #b40c8f;
    border: 2px solid #ff5fa2;
    border-radius: 6px;
    padding: 12px 18px;
    max-width: 360px;
    text-align: center;
    font-size: 14px;
    line-height: 1.45;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.beta-notice-title {
    font-weight: 700;
    font-size: 15px;
}
.beta-notice-title--mt { margin-top: 8px; }

@media (min-width: 992px) {
    .beta-notice { margin-top: 14px; }
    .beta-notice-inner { font-size: 13px; padding: 10px 16px; }
}

/* --- iOS notch / safe-area для фикс. шапки --- */
.navbar-fixed-top {
    padding-top: env(safe-area-inset-top, 0px);
}

/* --- Pull-to-refresh: не сворачивать сайт при крайнем скролле вверх --- */
html, body {
    overscroll-behavior-y: contain;
}

/* --- Print CSS --- */
@media print {
    .navbar,
    .navbar-fixed-top,
    .navbar-toggle,
    .menu_overlay,
    .menu_content,
    footer,
    .container-footer,
    .beta-notice,
    .header-cart-item,
    [data-cart-modal],
    .modal,
    .fancybox-overlay {
        display: none !important;
    }
    body { padding-top: 0 !important; }
    .page-shell { min-height: 0 !important; }
    a { color: #000 !important; text-decoration: underline; }
}

/* --- Таблица заказов ЛК: карточный рендер на мобиле --- */
@media (max-width: 767px) {
    .table-orders {
        border: 0;
    }
    .table-orders thead {
        display: none;
    }
    .table-orders > tbody > tr {
        display: block;
        position: relative;
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        margin-bottom: 12px;
        padding: 12px 14px;
        padding-right: 44px;
        text-align: left;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
        cursor: pointer;
        transition: border-color 0.15s;
    }
    .table-orders > tbody > tr:active {
        border-color: #A2CF41;
    }
    .table-orders > tbody > tr > td {
        display: flex;
        align-items: baseline;
        gap: 6px;
        border: 0 !important;
        padding: 3px 0;
        text-align: left;
        font-size: 14px;
    }
    .table-orders > tbody > tr > td[data-label]::before {
        content: attr(data-label);
        color: #999;
        font-size: 12px;
        min-width: 70px;
        flex-shrink: 0;
    }
    .table-orders > tbody > tr > td[data-label=""]::before {
        content: none;
    }
    .table-orders > tbody > tr > td[data-label="№"] {
        font-weight: 700;
        font-size: 15px;
        padding-bottom: 4px;
        border-bottom: 1px solid #f0f0f0 !important;
        margin-bottom: 4px;
    }

    .table-orders .orders-col-detail {
        display: none !important;
    }

    .table-orders .orders-col-cancel {
        position: absolute;
        top: 10px;
        right: 10px;
        padding: 0 !important;
        display: block;
    }
    .table-orders .orders-col-cancel .text-muted {
        display: none;
    }

    .table-responsive {
        border: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* --- Детали заказа: инфо-таблица (ключ-значение) --- */
    .table-order-info {
        display: block;
        width: 100%;
        max-width: 100%;
        border: 0;
    }
    .table-order-info > tbody {
        display: block;
        width: 100%;
    }
    .table-order-info > tbody > tr {
        display: flex;
        flex-direction: column;
        border: 0;
        border-bottom: 1px solid #f0f0f0;
        padding: 6px 0;
    }
    .table-order-info > tbody > tr > th,
    .table-order-info > tbody > tr > td {
        display: block;
        border: 0 !important;
        padding: 1px 0;
        width: 100% !important;
        text-align: left;
        white-space: normal !important;
        word-break: break-word;
        overflow-wrap: anywhere;
    }
    .table-order-info > tbody > tr > th {
        color: #999;
        font-size: 12px;
        font-weight: 400;
    }
    .table-order-info > tbody > tr > td {
        font-size: 14px;
    }

    /* --- Детали заказа: товары — карточки --- */
    .table-order-items {
        display: block;
        width: 100%;
        max-width: 100%;
        border: 0;
    }
    .table-order-items > tbody {
        display: block;
        width: 100%;
    }
    .table-order-items thead {
        display: none;
    }
    .table-order-items > tbody > tr:not(.order-totals-row) {
        display: block;
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        margin-bottom: 10px;
        padding: 10px 12px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    }
    .table-order-items > tbody > tr:not(.order-totals-row) > td {
        display: flex;
        align-items: baseline;
        gap: 6px;
        border: 0 !important;
        padding: 2px 0;
        font-size: 14px;
        text-align: left;
        white-space: normal !important;
        word-break: break-word;
        overflow-wrap: anywhere;
    }
    .table-order-items > tbody > tr > td[data-label]::before {
        content: attr(data-label);
        color: #999;
        font-size: 12px;
        min-width: 70px;
        flex-shrink: 0;
    }
    .table-order-items > tbody > tr > td[data-label=""]::before {
        content: none;
    }
    .table-order-items > tbody > tr > td[data-label=""] {
        display: block;
        font-weight: 600;
        padding-bottom: 4px;
        border-bottom: 1px solid #f0f0f0 !important;
        margin-bottom: 2px;
    }
    .table-order-items .order-items-col-sku,
    .table-order-items .order-items-col-preorder {
        display: none !important;
    }
    .table-order-items .order-totals-row {
        display: flex;
        justify-content: space-between;
        border: 0;
        border-top: 1px dashed #ddd;
        padding: 6px 0;
        margin: 0;
    }
    .table-order-items .order-totals-row > td {
        border: 0 !important;
        padding: 2px 0;
    }
    .table-order-items .order-totals-row > td[colspan] {
        flex: 1;
        text-align: right;
        padding-right: 10px;
    }

    /* --- Детали заказа: платежи — карточки --- */
    .table-order-payments {
        display: block;
        width: 100%;
        max-width: 100%;
        border: 0;
    }
    .table-order-payments > tbody {
        display: block;
        width: 100%;
    }
    .table-order-payments thead {
        display: none;
    }
    .table-order-payments > tbody > tr:not(.order-totals-row) {
        display: block;
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        margin-bottom: 10px;
        padding: 10px 12px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    }
    .table-order-payments > tbody > tr:not(.order-totals-row) > td {
        display: flex;
        align-items: baseline;
        gap: 6px;
        border: 0 !important;
        padding: 2px 0;
        font-size: 14px;
        text-align: left;
        white-space: normal !important;
        word-break: break-word;
        overflow-wrap: anywhere;
    }
    .table-order-payments > tbody > tr > td[data-label]::before {
        content: attr(data-label);
        color: #999;
        font-size: 12px;
        min-width: 70px;
        flex-shrink: 0;
    }
    .table-order-payments .order-totals-row {
        display: flex;
        justify-content: space-between;
        border: 0;
        border-top: 1px dashed #ddd;
        padding: 6px 0;
    }
    .table-order-payments .order-totals-row > td {
        border: 0 !important;
        padding: 2px 0;
    }
    .table-order-payments .order-totals-row > td[colspan] {
        flex: 1;
        text-align: right;
        padding-right: 10px;
    }
    .table-order-payments .order-totals-row > td:empty {
        display: none;
    }

    /* --- История транзакций кошелька: карточный рендер на мобиле --- */
    .table-wallet-tx {
        display: block;
        width: 100%;
        max-width: 100%;
        border: 0;
    }
    .table-wallet-tx > tbody {
        display: block;
        width: 100%;
    }
    .table-wallet-tx thead {
        display: none;
    }
    .table-wallet-tx > tbody > tr {
        display: block;
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        margin-bottom: 12px;
        padding: 12px 14px;
        text-align: left;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    }
    .table-wallet-tx > tbody > tr > td {
        display: grid;
        grid-template-columns: 90px minmax(0, 1fr);
        align-items: baseline;
        gap: 6px;
        border: 0 !important;
        padding: 3px 0;
        text-align: left;
        font-size: 14px;
        /* Bootstrap в .table-responsive ставит white-space:nowrap — перебиваем,
           чтобы длинные значения (примечания, #номера) переносились */
        white-space: normal !important;
        word-break: break-word;
        overflow-wrap: anywhere;
    }
    .table-wallet-tx > tbody > tr > td[data-label]::before {
        content: attr(data-label);
        color: #999;
        font-size: 12px;
    }
    .table-wallet-tx > tbody > tr > td:empty {
        display: none;
    }
    /* Дата — заголовок карточки */
    .table-wallet-tx > tbody > tr > td[data-label="Дата"] {
        display: block;
        font-weight: 700;
        font-size: 15px;
        padding-bottom: 6px;
        border-bottom: 1px solid #f0f0f0 !important;
        margin-bottom: 4px;
    }
    .table-wallet-tx > tbody > tr > td[data-label="Дата"]::before {
        content: none;
    }

    /* --- Курс валют: карточный рендер на мобиле --- */
    .table-rates {
        display: block;
        width: 100%;
        max-width: 100%;
        border: 0;
    }
    .table-rates > tbody {
        display: block;
        width: 100%;
    }
    .table-rates thead {
        display: none;
    }
    /* Строки-разделители секций — подзаголовки на всю ширину */
    .table-rates > tbody > tr.rates-section {
        display: block;
        background: transparent;
        border: 0;
        margin: 14px 0 6px;
    }
    .table-rates > tbody > tr.rates-section > td {
        display: block;
        border: 0 !important;
        padding: 0;
        font-size: 15px;
    }
    /* Обычные строки валют — карточки */
    .table-rates > tbody > tr:not(.rates-section) {
        display: block;
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        margin-bottom: 10px;
        padding: 10px 12px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    }
    .table-rates > tbody > tr:not(.rates-section) > td {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 6px;
        border: 0 !important;
        padding: 3px 0;
        font-size: 14px;
        text-align: right;
        white-space: normal !important;
        word-break: break-word;
        overflow-wrap: anywhere;
    }
    .table-rates > tbody > tr:not(.rates-section) > td[data-label]::before {
        content: attr(data-label);
        color: #999;
        font-size: 12px;
        flex-shrink: 0;
        text-align: left;
    }
    /* Валюта — заголовок карточки */
    .table-rates > tbody > tr > td[data-label="Валюта"] {
        font-weight: 700;
        font-size: 15px;
        justify-content: flex-start;
        padding-bottom: 6px;
        border-bottom: 1px solid #f0f0f0 !important;
        margin-bottom: 4px;
        text-align: left;
    }
    .table-rates > tbody > tr > td[data-label="Валюта"]::before {
        content: none;
    }

    /* --- Табы операций кошелька: вертикальный стек на мобиле --- */
    .wallet-tabs {
        display: block;
        padding: 10px;
        border-bottom: none !important;
    }
    .wallet-tabs > li {
        float: none;
        display: block;
        margin: 0 0 6px 0;
    }
    .wallet-tabs > li:last-child {
        margin-bottom: 0;
    }
    .wallet-tabs > li > a {
        display: block;
        margin: 0;
        padding: 11px 14px;
        border: 1px solid #ddd;
        border-radius: 6px;
        background: #f7f7f7;
        color: #337ab7;
        font-size: 14px;
        text-align: center;
    }
    .wallet-tabs > li.active > a,
    .wallet-tabs > li.active > a:hover,
    .wallet-tabs > li.active > a:focus {
        border-color: #A2CF41;
        background: #A2CF41;
        color: #fff;
    }

    /* --- Рефералы: таблица партнёров → карточки на мобиле --- */
    .ref-partners {
        display: block;
        width: 100%;
        max-width: 100%;
        border: 0;
    }
    .ref-partners > tbody {
        display: block;
        width: 100%;
    }
    .ref-partners thead {
        display: none;
    }
    .ref-partners > tbody > tr {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        border: 1px solid #e0e0e0 !important;
        border-radius: 8px;
        margin-bottom: 12px;
        padding: 10px 12px;
        text-align: left;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    }
    /* Поля данных — каждое на своей строке «подпись: значение» */
    .ref-partners > tbody > tr > td {
        flex: 0 0 100%;
        display: grid;
        grid-template-columns: 130px minmax(0, 1fr);
        align-items: baseline;
        gap: 6px;
        border: 0 !important;
        padding: 3px 0 !important;
        text-align: left;
        font-size: 14px;
        white-space: normal !important;
        word-break: break-word;
        overflow-wrap: anywhere;
    }
    .ref-partners > tbody > tr > td[data-label]::before {
        content: attr(data-label);
        color: #999;
        font-size: 12px;
    }
    /* № в карточке не нужен */
    .ref-partners > tbody > tr > td[data-label="№"] {
        display: none;
    }
    /* Заголовок карточки: ФИО + #ID на одной строке */
    .ref-partners > tbody > tr > td[data-label="ФИО"],
    .ref-partners > tbody > tr > td[data-label="ID"] {
        flex: 0 0 auto;
        display: block;
        order: -1;
        padding: 0 0 6px 0 !important;
        margin-bottom: 4px;
    }
    .ref-partners > tbody > tr > td[data-label="ФИО"] {
        font-weight: 700;
        font-size: 15px;
        margin-right: 6px;
    }
    .ref-partners > tbody > tr > td[data-label="ФИО"]::before {
        content: none;
    }
    .ref-partners > tbody > tr > td[data-label="ID"] {
        color: #999;
        font-weight: 400;
        font-size: 13px;
    }
    .ref-partners > tbody > tr > td[data-label="ID"]::before {
        content: "#";
        color: #999;
    }
    /* Разделитель под заголовком карточки */
    .ref-partners > tbody > tr > td[data-label="Уровень"] {
        border-top: 1px solid #f0f0f0 !important;
        padding-top: 7px !important;
        margin-top: 2px;
    }
    /* Итоговая строка периода */
    .ref-partners > tbody > tr.ref-total-row {
        display: flex;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: baseline;
        gap: 8px;
        background: transparent;
        border: 0 !important;
        box-shadow: none;
        padding: 6px 2px;
        margin-bottom: 0;
    }
    .ref-partners > tbody > tr.ref-total-row > td {
        flex: 0 1 auto;
        display: block;
        padding: 0 !important;
        text-align: left;
        font-size: 13px;
    }
    .ref-partners > tbody > tr.ref-total-row > td::before {
        content: none;
    }
}
