/* ==============================================
   Mobile Styles — мобильная шапка + табббар
   ============================================== */

/* ---- Скрываем компоненты по-умолчанию на мобиле ---- */
@media (max-width: 768px) {

    /* Скрываем десктопную шапку и топбар */
    .top-bar {
        display: none !important;
    }

    .main-header {
        display: none !important;
    }

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


    /* Отступ снизу под таббар */
    body {
        padding-bottom: 68px;
    }

    /* Блокируем горизонтальный скролл на всех страницах */
    html {
        overflow-x: hidden;
    }

    #platinum-basket-wrapper {
        max-width: 100%;
        width: 100%;
    }

    /* Сдвигаем контент вниз под мобильную шапку */
    main.container {
        margin-top: 0;
        padding-top: 0;
    }

    /* ---- КАТАЛОГ: скрываем боковой фильтр ---- */
    .sidebar-filters {
        display: none !important;
        position: fixed !important;
        inset: 0 !important;
        width: auto !important;
        flex-shrink: unset !important;
        z-index: 800;
        background: rgba(0, 0, 0, 0.55);
        overflow: hidden;
    }

    .sidebar-filters.mob-open {
        display: flex !important;
        align-items: flex-end;
    }

    /* Панель фильтра — снизу */
    .sidebar-filters>* {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 85vh;
        overflow-y: auto;
        background: #fff;
        border-radius: 20px 20px 0 0;
        padding: 16px 16px 100px !important;
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
        flex-shrink: 0;
    }

    /* Лейаут каталога: 1 колонка */
    .category-layout {
        display: flex !important;
        flex-direction: column !important;
    }

    /* Сетка товаров — 2 колонки */
    .category-products-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    .category-products-grid .product-card {
        min-height: unset !important;
        padding: 10px 10px 12px !important;
        border-radius: 14px !important;
    }

    .category-products-grid .product-img-wrap {
        height: 150px !important;
        margin-bottom: 8px !important;
    }

    .category-products-grid .product-gallery-wrap {
        margin-bottom: 8px !important;
    }

    .category-products-grid .product-title {
        font-size: 12px !important;
        line-height: 1.35 !important;
        margin-bottom: 6px !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 3 !important;
        line-clamp: 3 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        height: auto !important;
        white-space: normal !important;
    }

    .category-products-grid .product-cat {
        font-size: 10px !important;
    }

    .category-products-grid .price-current {
        font-size: 15px !important;
        font-weight: 800 !important;
    }

    .category-products-grid .price-old {
        font-size: 11px !important;
    }

    .category-products-grid .product-bottom {
        gap: 8px !important;
    }

    .category-products-grid .btn-add,
    .category-products-grid .btn-preorder {
        font-size: 12px !important;
        padding: 9px 0 !important;
        border-radius: 8px !important;
    }

    .category-products-grid .product-badges {
        top: 8px !important;
        left: 8px !important;
    }

    .category-products-grid .product-badge {
        font-size: 9px !important;
        padding: 2px 6px !important;
    }

    .category-products-grid .product-fav {
        top: 6px !important;
        right: 6px !important;
        font-size: 16px !important;
    }

    .category-products-grid button.product-compare {
        top: 32px !important;
        right: 6px !important;
        font-size: 16px !important;
    }

    /* Скрываем десктопный контрол сортировки */
    .category-controls {
        display: none !important;
    }

    /* ---- ТУЛБАР: сортировка + фильтр ---- */
    .mob-catalog-toolbar {
        display: flex !important;
        gap: 10px;
        margin-bottom: 14px;
        align-items: center;
    }

    .mob-sort-select {
        flex: 1;
        background: #fff;
        border: 1.5px solid #e0e0e0;
        border-radius: 10px;
        padding: 10px 28px 10px 12px;
        font-size: 13px;
        font-weight: 600;
        color: var(--color-dark);
        appearance: none;
        -webkit-appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 10px center;
        cursor: pointer;
    }

    .mob-filter-btn {
        display: flex;
        align-items: center;
        gap: 7px;
        background: var(--color-dark, #1e1e26);
        border: none;
        border-radius: 10px;
        padding: 10px 16px;
        font-size: 13px;
        font-weight: 700;
        color: #fff;
        cursor: pointer;
        white-space: nowrap;
        -webkit-tap-highlight-color: transparent;
    }

    .mob-filter-btn i {
        color: #85c635;
        font-size: 14px;
    }

    .mob-filter-btn:active {
        opacity: 0.85;
    }

    /* ---- ТАБЛЕТКИ подразделов ---- */
    .subsections-pills {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        max-height: none !important;
        gap: 8px !important;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .subsections-pills::-webkit-scrollbar {
        display: none;
    }

    .pill-link {
        background: #f4f5f7 !important;
        color: var(--color-dark) !important;
        padding: 8px 18px !important;
        border-radius: 50px !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        height: 36px !important;
        border: 1.5px solid #e8e8e8;
        flex-shrink: 0;
    }

    .pill-link:active,
    .pill-link.active {
        background: var(--color-accent, #85c635) !important;
        color: #fff !important;
        border-color: var(--color-accent, #85c635) !important;
    }

    .show-more-pills {
        display: none !important;
    }

    .subsections-container {
        margin-bottom: 14px !important;
    }
}



/* ==================================================
   MOBILE CART (КОРЗИНА)
   ================================================== */
@media (max-width: 768px) {

    /* Лейаут: одна колонка */
    .cart-layout {
        flex-direction: column !important;
        gap: 16px !important;
        padding-bottom: 20px !important;
    }

    .cart-main {
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    .cart-items-list {
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    /* Заголовок «N товара(ов)» */
    #platinum-basket-wrapper>div:first-child {
        font-size: 16px !important;
        margin-bottom: 16px !important;
        margin-top: 0 !important;
    }

    /* ---- Элемент корзины ---- */
    .cart-item {
        padding: 12px !important;
        padding-right: 36px !important;
        /* место под крестик */
        flex-wrap: wrap !important;
        align-items: flex-start !important;
        gap: 0 !important;
        box-sizing: border-box !important;
        max-width: 100% !important;
    }

    .cart-item-img {
        width: 80px !important;
        height: 80px !important;
        margin-right: 12px !important;
        border-radius: 10px;
        flex-shrink: 0;
    }

    .cart-item-details {
        flex: 1 !important;
        min-width: 0 !important;
        overflow: visible !important;
    }

    .cart-item-title {
        font-size: 13px !important;
        line-height: 1.3 !important;
        margin-bottom: 5px !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 3 !important;
        line-clamp: 3 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }

    .cart-item-props {
        font-size: 12px !important;
    }

    /* Скрываем кнопку "Защита устройства", но показываем кнопку "Рекомендуем" */
    .cart-item-actions-inline {
        flex-wrap: wrap !important;
        gap: 8px !important;
        margin-top: 10px !important;
    }

    .btn-protection-toggle {
        display: none !important;
    }

    /* ---- Трей аксессуаров ---- */
    .inline-recs-tray {
        padding: 10px 0 !important;
        margin-bottom: 12px !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }

    .platinum-accessories-slider {
        width: 100% !important;
        max-width: calc(100vw - 30px) !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        padding: 4px 12px 10px !important;
        gap: 10px !important;
    }

    /* Карточка аксессуара — уменьшаем ширину под мобиль */
    .inline-acc-card {
        min-width: 200px !important;
        width: 200px !important;
        padding: 8px !important;
        gap: 8px !important;
        border-radius: 10px !important;
    }

    .inline-acc-card a[style*="width: 60px"] {
        width: 48px !important;
        height: 48px !important;
    }

    .inline-acc-card a[style*="font-size: 13px"] {
        font-size: 12px !important;
    }

    /* qty и цена — нижняя строка: qty слева, цена справа */
    .qty-control {
        margin-right: auto !important;
        margin-top: 10px !important;
        height: 34px !important;
        flex-shrink: 0 !important;
    }

    .qty-btn {
        padding: 6px 12px !important;
        font-size: 13px !important;
    }

    .qty-input {
        width: 32px !important;
        font-size: 14px !important;
    }

    .cart-item-price {
        font-size: 15px !important;
        font-weight: 800 !important;
        width: auto !important;
        min-width: fit-content !important;
        white-space: nowrap !important;
        overflow: visible !important;
        text-align: right !important;
        margin-top: 10px !important;
        align-self: center !important;
        flex-shrink: 0 !important;
    }

    /* Крестик — правый верхний угол, не мешает цене */
    .cart-item-remove {
        top: 10px !important;
        right: 10px !important;
        left: auto !important;
        font-size: 14px !important;
    }

    /* ---- Сайдбар — карточка итого в конце страницы ---- */
    .cart-sidebar {
        position: static !important;
        width: 100% !important;
        border-radius: 16px !important;
        padding: 18px 16px !important;
        box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08) !important;
        background: #fff !important;
        top: unset !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 4px;
        margin-top: 8px;
    }

    /* Показываем итого, скрываем лишнее */
    .sidebar-title {
        font-size: 18px !important;
        margin-bottom: 12px !important;
        display: block !important;
    }

    .sidebar-legal {
        display: none !important;
    }

    .summary-row {
        font-size: 14px !important;
        margin-bottom: 10px !important;
    }

    .summary-row.total {
        font-size: 18px !important;
        font-weight: 800 !important;
        margin-top: 8px !important;
        padding-top: 14px !important;
        border-top: 1px solid #f0f0f0 !important;
        margin-bottom: 14px !important;
    }

    .btn-checkout {
        padding: 15px !important;
        font-size: 16px !important;
        border-radius: 12px !important;
        margin-bottom: 0 !important;
    }
}

/* ==================================================
   MOBILE AUTH MODAL — Bottom Sheet
   ================================================== */
@media (max-width: 768px) {

    /* Backdrop: выравниваем к низу вместо центра */
    .auth-modal-backdrop {
        align-items: flex-end !important;
        justify-content: stretch !important;
    }

    /* Bottom sheet */
    .auth-modal {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 24px 24px 0 0 !important;
        padding: 12px 24px 36px !important;
        margin: 0 !important;
        transform: translateY(100%) !important;
        transition: transform .32s cubic-bezier(.32, 1, .23, 1) !important;

        /* Ручка-индикатор сверху */
        position: relative;
    }

    .auth-modal-backdrop.active .auth-modal {
        transform: translateY(0) !important;
    }

    /* Ручка */
    .auth-modal::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: #ddd;
        border-radius: 2px;
        margin: 0 auto 20px;
    }

    /* Логотип бренда внутри */
    .auth-modal__title {
        font-size: 20px !important;
        margin-bottom: 22px !important;
        padding-right: 40px; /* Prevent overlap with close button */
        padding-left: 40px; /* Keep it perfectly centered */
        line-height: 1.3;
    }

    /* Кнопка закрытия крупнее */
    .auth-modal__close {
        top: 28px !important; /* Align vertically with the title */
        right: 16px !important;
        font-size: 20px !important; /* Slightly smaller icon to fit the circle better */
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f4f4f4 !important;
        border-radius: 50%;
        color: #555 !important;
    }

    /* Поле телефона */
    .auth-field--phone input {
        font-size: 22px !important;
        padding: 20px 16px 14px !important;
        border-radius: 14px !important;
    }

    .auth-field input {
        font-size: 16px !important;
        padding: 18px 16px 12px !important;
        border-radius: 12px !important;
    }

    /* Кнопка */
    .auth-btn {
        padding: 18px !important;
        font-size: 17px !important;
        border-radius: 14px !important;
        margin-top: 12px !important;
    }

    /* Код SMS — ячейки крупнее */
    .auth-code-inputs {
        gap: 14px !important;
    }

    .auth-code-inputs input {
        width: 64px !important;
        height: 72px !important;
        font-size: 30px !important;
        border-radius: 16px !important;
    }
}



/* ---- На десктопе скрываем все мобильные элементы ---- */

@media (min-width: 769px) {

    .mob-header,
    .mob-drawer,
    .mob-drawer-backdrop,
    .mob-tabbar,
    .mob-search-overlay {
        display: none !important;
    }
}


/* ==================================================
   MOB HEADER — верхняя полоска
   ================================================== */
.mob-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #1e1e26;
    z-index: 500;
    box-shadow: none;
    transition: transform 0.3s ease;
    display: none;
}

@media (max-width: 768px) {
    .mob-header {
        display: block;
    }

    main.container {
        padding-top: 114px;
    }

    .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        max-width: 100vw !important;
    }

    /* Карточка товара — нейтрализуем отступ контейнера */
    .card__wrapper {
        margin-left: -10px !important;
        margin-right: -10px !important;
    }
}

.mob-header--hidden {
    transform: translateY(-100%);
}

.mob-header__inner {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

/* Бургер */
.mob-header__burger {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.07);
    border: none;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.mob-header__burger:hover {
    background: rgba(255, 255, 255, 0.14);
}

.mob-header__burger span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mob-header__burger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mob-header__burger.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mob-header__burger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Логотип */
.mob-header__logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
}

.mob-header__logo img {
    height: 32px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    filter: brightness(1.05);
}

/* Корзина */
.mob-header__cart {
    position: relative;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    text-decoration: none;
    transition: background 0.2s;
    flex-shrink: 0;
}

.mob-header__cart:hover {
    background: rgba(133, 198, 53, 0.2);
}

/* Строка поиска — под тёмной шапкой отдельным блоком */
.mob-header__search-bar {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    z-index: 499;
    background: #fff;
    padding: 7px 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    display: none;
    transition: transform 0.3s ease;
}

@media (max-width: 768px) {
    .mob-header__search-bar {
        display: block;
    }
}

.mob-header__search-btn {
    width: 100%;
    display: flex;
    align-items: center;
    background: #f4f5f7;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    padding: 0;
    cursor: pointer;
    font-size: 14px;
    text-align: left;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 0.2s;
}

.mob-header__search-btn:active {
    border-color: #85c635;
}

.mob-header__search-placeholder {
    flex: 1;
    padding: 9px 12px;
    color: #aaa;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: transparent;
}

.mob-header__search-btn i {
    flex-shrink: 0;
    width: 42px;
    height: 38px;
    background: #85c635;
    color: #fff;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mob-cart-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #85c635;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 0 0 2px #1e1e26;
}


/* ==================================================
   DRAWER — полноэкранное меню
   ================================================== */
.mob-drawer-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mob-drawer-backdrop.active {
    display: block;
    opacity: 1;
}

.mob-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 85vw);
    background: #ffffff;
    z-index: 700;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
}

.mob-drawer.open {
    transform: translateX(0);
}

/* Шапка дравера */
.mob-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    background: #1e1e26;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.mob-drawer__logo {
    height: 28px;
    width: auto;
    max-width: 130px;
    object-fit: contain;
}

.mob-drawer__close {
    width: 36px;
    height: 36px;
    background: #f2f2f2;
    border: none;
    border-radius: 8px;
    color: #555;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.mob-drawer__close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Поиск */
.mob-drawer__search {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.mob-drawer__search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f5f5f5;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 10px 14px;
}

.mob-drawer__search-wrap i {
    color: #aaa;
    font-size: 14px;
}

.mob-drawer__search-wrap input {
    background: none;
    border: none;
    outline: none;
    color: #1a1a1a;
    font-size: 14px;
    width: 100%;
}

.mob-drawer__search-wrap input::placeholder {
    color: #bbb;
}

/* Навигация */
.mob-drawer__nav {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}

.mob-drawer__section-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #aaa;
    padding: 14px 18px 6px;
}

.mob-drawer__section-title--admin {
    color: #e53935;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mob-drawer__item {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 18px;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    border-radius: 0;
    position: relative;
}

.mob-drawer__item i:first-child {
    width: 20px;
    text-align: center;
    font-size: 16px;
    color: #85c635;
    flex-shrink: 0;
}

/* Custom image icons */
.mob-drawer__icon {
    width: 52px;
    height: 52px;
    object-fit: cover;
    flex-shrink: 0;
    border-radius: 14px;
    background: #f4f5f7;
}

.mob-drawer__item:hover,
.mob-drawer__item:active {
    background: rgba(133, 198, 53, 0.08);
    color: #85c635;
}

.mob-drawer__item:hover i:first-child {
    color: #85c635;
}

.mob-drawer__arrow {
    margin-left: auto;
    font-size: 11px !important;
    color: #ccc !important;
    width: auto !important;
}

.mob-drawer__divider {
    height: 1px;
    background: #f0f0f0;
    margin: 8px 16px;
}

/* Подвал дравера */
.mob-drawer__footer {
    flex-shrink: 0;
    padding: 14px 16px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mob-drawer__footer-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    background: rgba(133, 198, 53, 0.15);
    color: #85c635;
    border: 1px solid rgba(133, 198, 53, 0.25);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

.mob-drawer__footer-btn:hover {
    background: rgba(133, 198, 53, 0.25);
}

.mob-drawer__footer-btn--out {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}

.mob-drawer__footer-btn--out:hover {
    background: rgba(239, 68, 68, 0.2);
}

.mob-drawer__footer-btn--login {
    background: #85c635;
    color: #fff;
    border-color: #85c635;
}

.mob-drawer__footer-btn--login:hover {
    background: #74b02a;
}

/* Скрытые категории (показать ещё) */
.mob-cat--hidden {
    display: none;
}

.mob-cat--hidden.mob-cat--visible {
    display: flex;
}

/* Кнопка-переключатель секции (Покупателям и т.п.) */
.mob-drawer__toggle {
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
    padding: 13px 18px;
    background: none;
    border: none;
    color: #1a1a1a;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.mob-drawer__toggle:hover {
    background: rgba(133, 198, 53, 0.08);
}

.mob-drawer__toggle-icon {
    font-size: 12px;
    color: #85c635;
    transition: transform 0.25s;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.mob-drawer__toggle.open .mob-drawer__toggle-icon {
    transform: rotate(90deg);
}

/* Подпункты (вложенный уровень) */
.mob-drawer__item--sub {
    padding-left: 32px;
    background: #fafafa;
    font-size: 14px;
}

/* ==================================================
   BOTTOM TAB BAR
   ================================================== */
.mob-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: #1e1e26;
    border-top: none;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    z-index: 500;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.35);
}

.mob-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.mob-tab i {
    font-size: 20px;
    transition: transform 0.2s;
}

.mob-tab:active i {
    transform: scale(0.88);
}

.mob-tab.active {
    color: #85c635;
}

.mob-tab.active i {
    color: #85c635;
}

/* Активная точка под иконкой у активного таба */
.mob-tab.active::after {
    content: '';
    position: absolute;
    bottom: 6px;
    width: 4px;
    height: 4px;
    background: #85c635;
    border-radius: 50%;
}

/* Обёртка иконки корзины с бейджем */
.mob-tab__icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mob-tab-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    background: #85c635;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 0 0 2px #1e1e26;
}


/* ==================================================
   SEARCH OVERLAY
   ================================================== */
.mob-search-overlay {
    position: fixed;
    inset: 0;
    background: #1e1e26;
    z-index: 800;
    display: flex;
    flex-direction: column;
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mob-search-overlay.active {
    transform: translateY(0);
}

.mob-search-overlay__inner {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mob-search-overlay__form {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 10px 14px;
}

.mob-search-overlay__back {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
}

.mob-search-overlay__back:hover {
    color: #fff;
}

.mob-search-overlay__form input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-size: 16px;
}

.mob-search-overlay__form input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.mob-search-overlay__submit {
    background: #85c635;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.mob-search-overlay__submit:hover {
    background: #74b02a;
}

/* ---- Результаты мобильного поиска ---- */
.mob-search-results {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 0 80px;
}

/* Заголовок секции (Хиты / Результаты) */
.mob-sr-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    padding: 4px 16px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mob-sr-title i {
    color: #85c635;
}

/* Таблетки категорий */
.mob-sr-cats {
    display: flex;
    gap: 8px;
    padding: 0 16px 14px;
    overflow-x: auto;
    scrollbar-width: none;
    flex-wrap: nowrap;
}

.mob-sr-cats::-webkit-scrollbar {
    display: none;
}

.mob-sr-cat {
    flex-shrink: 0;
    background: rgba(133, 198, 53, 0.15);
    color: #85c635;
    border: 1px solid rgba(133, 198, 53, 0.3);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s;
}

.mob-sr-cat:active {
    background: rgba(133, 198, 53, 0.3);
}

/* Строка товара */
.mob-sr-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.mob-sr-item:active {
    background: rgba(255, 255, 255, 0.05);
}

.mob-sr-img {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.mob-sr-info {
    flex: 1;
    min-width: 0;
}

.mob-sr-name {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mob-sr-price {
    font-size: 13px;
    font-weight: 700;
    color: #85c635;
}

/* Кнопка "Все результаты" */
.mob-sr-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 16px 16px 0;
    padding: 14px;
    background: rgba(133, 198, 53, 0.12);
    color: #85c635;
    border: 1px solid rgba(133, 198, 53, 0.25);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.mob-sr-all:active {
    background: rgba(133, 198, 53, 0.22);
}

/* Пусто */
.mob-sr-empty {
    padding: 32px 16px;
    text-align: center;
    color: rgba(255, 255, 255, 0.35);
    font-size: 14px;
}

/* ---- Горячие теги поиска ---- */
.mob-search-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px 4px;
}

.mob-search-tags__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(255, 255, 255, 0.3);
    width: 100%;
}

.mob-search-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: rgba(133, 198, 53, 0.12);
    border: 1px solid rgba(133, 198, 53, 0.28);
    border-radius: 20px;
    color: #85c635;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, transform 0.12s;
    -webkit-tap-highlight-color: transparent;
}

.mob-search-tag:active {
    background: rgba(133, 198, 53, 0.28);
    transform: scale(0.95);
}



/* ==================================================
   MOBILE FOOTER
   ================================================== */

/* Скрываем десктопный футер на мобиле */
@media (max-width: 768px) {
    .footer--desktop {
        display: none !important;
    }

    .footer-mob {
        display: block;
    }
}

/* Скрываем мобильный футер на десктопе */
@media (min-width: 769px) {
    .footer-mob {
        display: none !important;
    }
}

/* Стили мобильного футера */
.footer-mob {
    background: linear-gradient(135deg, #1a1a22 0%, #24242f 100%);
    padding: 28px 20px calc(80px + env(safe-area-inset-bottom, 0px)) 20px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    text-align: center;
}

/* Логотип */
.footer-mob__logo img {
    max-height: 36px;
    width: auto;
    filter: brightness(1.1);
}

/* Быстрые ссылки — 2 колонки */
.footer-mob__links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 32px;
    width: 100%;
    max-width: 300px;
}

.footer-mob__links a {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    text-align: left;
    padding: 3px 0;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.footer-mob__links a:active {
    color: #85c635;
}

/* Соцсети */
.footer-mob__socials {
    display: flex;
    gap: 14px;
}

.footer-mob__social {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.footer-mob__social:active {
    background: rgba(133, 198, 53, 0.2);
    color: #85c635;
    border-color: rgba(133, 198, 53, 0.35);
}

/* Copyright */
.footer-mob__copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-mob__copy p {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
    margin: 0;
}

.footer-mob__copy a {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
    text-decoration: underline;
    text-underline-offset: 2px;
}


/* ==================================================
   MOBILE ACCOUNT — Личный кабинет
   ================================================== */

@media (max-width: 768px) {

    /* ---- ACCOUNT-PAGE: на всю ширину viewport ---- */
    .account-page {
        margin-left: -15px;
        width: 100vw;
        /* 100vw надёжнее на всех устройствах */
        margin-top: -56px;
        /* подтягиваем под mob-header, убирая gap */
        box-sizing: border-box;
        overflow-x: hidden;
    }

    /* Mob-hero: компенсируем margin-top через padding-top — тёмный фон заполняется ЗА шапкой */
    .mob-account-hero {
        padding-top: calc(56px + 16px) !important;
        /* 56px(шапка) + 16px(нормальный top padding) */
    }

    /* Контент внутри — симметричный padding */
    .account-content {
        padding: 18px 16px 24px !important;
    }

    /* Внутренний лейаут */
    .account-layout {
        padding: 0;
    }

    /* ---- DASHBOARD: плитки 2 колонки ---- */
    .dashboard-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    .dashboard-card {
        padding: 18px 8px !important;
        border-radius: 14px !important;
        min-width: 0 !important;
        /* ключевой фикс: позволяет grid item сжиматься */
        overflow: hidden !important;
        /* обрезаем контент если не влезает */
        word-break: break-word !important;
    }

    .dashboard-card i {
        font-size: 24px !important;
        margin-bottom: 6px !important;
    }

    .dashboard-card span {
        font-size: 11px !important;
        white-space: normal !important;
    }


    /* ---- SUMMARY: статистика 2 колонки ---- */
    .summary-stats {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        margin-bottom: 20px !important;
    }

    .stat-card {
        padding: 16px 12px !important;
    }

    .stat-icon {
        width: 40px !important;
        height: 40px !important;
        font-size: 16px !important;
        margin-bottom: 8px !important;
    }

    .stat-value {
        font-size: 22px !important;
    }

    .stat-label {
        font-size: 11px !important;
    }

    /* Последние заказы в сводке */
    .recent-order-row {
        flex-wrap: wrap;
        gap: 4px;
        font-size: 13px !important;
    }

    .recent-order-row>div {
        flex: 1;
        min-width: 0;
    }

    /* ---- ПРОФИЛЬ: форма в 1 колонку ---- */
    .profile-form {
        max-width: 100% !important;
    }

    .form-row {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    .form-group input {
        padding: 14px 14px !important;
        font-size: 16px !important;
        /* предотвращаем zoom на iOS */
    }

    .btn-save {
        width: 100% !important;
        padding: 15px !important;
        font-size: 16px !important;
        border-radius: 12px !important;
    }

    /* ---- ИЗБРАННОЕ: 2 колонки ---- */
    .fav-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    .fav-info {
        padding: 10px 8px !important;
    }

    .fav-name {
        font-size: 12px !important;
    }

    .fav-price {
        font-size: 14px !important;
    }

    /* ---- БОНУСЫ: hero в колонку ---- */
    .bonus-hero {
        flex-direction: column !important;
        padding: 24px 20px !important;
        gap: 16px !important;
    }

    .bonus-hero::before {
        font-size: 120px !important;
    }

    .bonus-balance-amount {
        font-size: 38px !important;
    }

    .bonus-how {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        margin-bottom: 20px !important;
    }

    .bonus-how-card {
        padding: 16px !important;
        text-align: left !important;
        display: flex;
        gap: 14px;
        align-items: flex-start;
    }

    .bonus-how-card i {
        font-size: 22px !important;
        margin-bottom: 0 !important;
        flex-shrink: 0;
    }

    /* ---- НОВИНКИ: слайдер в л/к ---- */
    .dash-slider-btns {
        display: none !important;
    }

    /* свайп жестами */
    .dash-slider-wrap {
        margin-top: 20px !important;
    }

    .ds-card {
        flex: 0 0 130px !important;
    }

    .ds-img {
        height: 110px !important;
    }

    /* ---- ЗАГОЛОВОК КОНТЕНТА ---- */
    .account-content-title {
        font-size: 18px !important;
        margin-bottom: 16px !important;
        padding-bottom: 12px !important;
    }

    /* ---- АДРЕСА: placeholder ---- */
    .addresses-empty {
        padding: 40px 0 !important;
    }

    /* Форма адресов на всю ширину */
    .address-form {
        max-width: 100% !important;
    }

    /* ---- СРАВНЕНИЕ: 2 колонки ---- */
    .compare-empty {
        padding: 40px 0 !important;
    }

    .compare-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    .compare-img {
        height: 120px !important;
    }

    .compare-info {
        padding: 10px 8px !important;
    }

    .compare-name {
        font-size: 12px !important;
    }

    .compare-price {
        font-size: 14px !important;
    }

    .compare-actions {
        flex-direction: column !important;
    }

    .btn-compare-go,
    .btn-compare-clear {
        width: 100% !important;
        justify-content: center !important;
        padding: 14px !important;
        border-radius: 12px !important;
    }

    /* ---- ПОМОЩЬ: контакты вертикально ---- */
    .help-contacts {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        margin-bottom: 24px !important;
    }

    .help-contact-card {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        text-align: left !important;
        padding: 14px 16px !important;
        gap: 16px !important;
    }

    .help-contact-card i {
        margin-bottom: 0 !important;
        flex-shrink: 0 !important;
    }

    .faq-question {
        padding: 14px 16px !important;
    }

    .faq-answer {
        padding: 0 16px 14px !important;
    }
}


/* ==================================================
   PRODUCT PAGE — Карточка товара (мобиль)
   ================================================== */
@media (max-width: 768px) {

    /* Wrapper */
    .product-page-wrapper {
        padding: 6px 8px 0 !important;
    }

    /* Хлебные крошки — в одну строку */
    .product-page-wrapper .breadcrumbs {
        font-size: 11px !important;
        margin-bottom: 6px !important;
        white-space: normal !important;
        overflow: visible !important;
        display: block !important;
    }

    /* Заголовок */
    #product-title {
        font-size: 17px !important;
        font-weight: 800 !important;
        margin-bottom: 0 !important;
        line-height: 1.25 !important;
    }

    /* Внешний flex-ряд → колонка */
    .product-page {
        flex-direction: column !important;
        gap: 0 !important;
    }

    .product-main-area {
        gap: 12px !important;
    }

    /* buy-card full width, static */
    .product-page>div:last-child {
        width: 100% !important;
        position: static !important;
        height: auto !important;
        margin-bottom: 0;
    }

    .product-buy-card {
        border-radius: 16px !important;
        padding: 14px 14px !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06) !important;
        margin-top: 12px !important;
    }


    /* Верхний ряд: галерея + варианты → колонка */
    .product-top-row {
        flex-direction: column !important;
        gap: 0 !important;
    }

    /* Галерея */
    .product-gallery {
        width: 100% !important;
    }

    /* Главное фото: компактная высота */
    .product-main-image {
        height: 260px !important;
        border-radius: 14px !important;
        border: 1px solid #ebebeb !important;
        margin-bottom: 8px !important;
        padding: 10px !important;
    }

    /* Скрыть кнопки nav (prev/next) — свайп вместо них */
    .gallery-nav-btn {
        display: none !important;
    }

    /* Миниатюры — чуть меньше */
    #thumb-scroll .thumb-item {
        width: 58px !important;
        height: 58px !important;
        padding: 3px !important;
        border-radius: 8px !important;
    }

    /* Варианты товара */
    .product-variants {
        width: 100% !important;
        margin-top: 4px;
    }

    .sku-selectors {
        margin-bottom: 16px !important;
    }

    .variant-group {
        margin-bottom: 14px !important;
    }

    .variant-label {
        font-size: 13px !important;
        margin-bottom: 8px !important;
    }

    /* Цветовые свотчи */
    .color-swatch {
        width: 52px !important;
        height: 52px !important;
        border-radius: 10px !important;
    }

    .memory-btn {
        padding: 8px 14px !important;
        font-size: 13px !important;
        border-radius: 8px !important;
    }

    /* Краткие характеристики */
    .quick-specs {
        padding: 14px !important;
        border-radius: 12px !important;
        margin-top: 4px !important;
        margin-bottom: 0 !important;
    }

    .quick-specs-title {
        font-size: 15px !important;
        margin-bottom: 10px !important;
    }

    .quick-spec-item {
        font-size: 13px !important;
        margin-bottom: 8px !important;
    }

    /* Цена */
    .price-current {
        font-size: 24px !important;
    }

    .discount-badge {
        font-size: 12px !important;
        padding: 3px 8px !important;
    }

    .price-old {
        font-size: 14px !important;
    }

    .installment-block {
        font-size: 13px !important;
        margin-top: 10px !important;
        padding: 5px 10px !important;
    }

    /* Кнопки покупки */
    .buy-actions {
        gap: 8px !important;
        margin-bottom: 12px !important;
    }

    .btn-buy-main {
        font-size: 15px !important;
        padding: 13px !important;
        border-radius: 12px !important;
    }

    .btn-icon-action,
    .product-compare {
        width: 46px !important;
        height: 46px !important;
        border-radius: 10px !important;
        font-size: 18px !important;
    }

    /* Инфо о доставке */
    .product-meta {
        margin-bottom: 8px !important;
        font-size: 12px !important;
    }

    /* Tabы */
    .product-tabs-section {
        margin-top: 16px !important;
    }

    .product-tabs-header {
        gap: 24px !important;
        margin-bottom: 16px !important;
    }

    .tab-btn {
        font-size: 15px !important;
        padding-bottom: 10px !important;
    }

    /* Описание */
    .desc-content-wrap {
        font-size: 14px !important;
        line-height: 1.7 !important;
    }

    /* Характеристики — строки */
    .spec-label,
    .spec-value {
        font-size: 13px !important;
    }

    .spec-value {
        min-width: 38% !important;
        padding-left: 6px !important;
    }

    .specs-grid {
        gap: 12px !important;
    }

    /* Features mini: 2 колонки */
    .features-mini-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .feature-item-mini {
        padding: 14px 10px !important;
        border-radius: 12px !important;
    }

    .feature-item-mini i {
        font-size: 20px !important;
        margin-bottom: 8px !important;
    }

    .feature-item-mini h4 {
        font-size: 12px !important;
        margin-bottom: 4px !important;
    }

    .feature-item-mini p {
        font-size: 11px !important;
    }

    /* Кросс-сейл */
    .product-cross-sell {
        margin-top: 20px !important;
    }

    .product-cross-sell h3 {
        font-size: 18px !important;
        margin-bottom: 12px !important;
    }

    /* Без RuStore badge */
    .rustore-badge {
        font-size: 12px !important;
        padding: 4px 10px !important;
    }

    /* Popup цены — открывать вниз на мобиле */
    .price-info-popup {
        bottom: auto !important;
        top: calc(100% + 10px) !important;
        width: 260px !important;
    }
}

/* ---- Swipe-галерея для мобиля ---- */
@media (max-width: 768px) {
    #mainProductImage {
        touch-action: pan-y;
        user-select: none;
    }

    .product-main-image {
        overflow: hidden;
    }
}

/* ---- Sticky CTA-бар снизу ---- */
.mob-product-cta {
    display: none;
}

@media (max-width: 768px) {
    .mob-product-cta {
        display: flex;
        position: fixed;
        bottom: 62px;
        /* над tab-bar */
        left: 0;
        right: 0;
        background: #fff;
        border-top: 1px solid #ebebeb;
        padding: 10px 14px;
        gap: 10px;
        align-items: center;
        z-index: 450;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    }

    .mob-product-cta__price {
        flex: 1;
        font-size: 20px;
        font-weight: 800;
        color: var(--color-dark);
        white-space: nowrap;
    }

    .mob-product-cta__btn {
        flex-shrink: 0;
        background: var(--color-dark);
        color: #fff;
        border: none;
        border-radius: 12px;
        padding: 12px 22px;
        font-size: 15px;
        font-weight: 700;
        cursor: pointer;
        transition: background 0.2s;
    }

    .mob-product-cta__btn:active {
        background: var(--color-accent);
    }

    .mob-product-cta__btn--order {
        background: var(--color-accent);
    }
}