/*
 * GamesGu.ru — мобильная оболочка 1.1.75.
 * Только адаптивный слой: десктопная верстка и бизнес-логика не меняются.
 */

.gg-mobile-nav,
.gg-mobile-sheet,
.gg-mobile-sheet-backdrop,
.gg-mobile-filter-tools,
.gg-mobile-filter-backdrop,
.gg-mobile-filter-close {
  display: none;
}

@media (max-width: 820px) {
  :root {
    --gg-mobile-nav-height: 70px;
    --gg-mobile-accent: #4361ee;
    --gg-mobile-text: #25272b;
    --gg-mobile-muted: #6c757d;
    --gg-mobile-border: #e5e7eb;
    --gg-mobile-bg: #ffffff;
  }

  html {
    scroll-padding-top: 104px;
  }

  body {
    padding-bottom: calc(var(--gg-mobile-nav-height) + 18px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* На телефоне верхняя полоса с телефонами и широкое desktop-меню только съедают экран. */
  #top,
  .main-nav {
    display: none !important;
  }

  header {
    position: sticky !important;
    top: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, 0.97) !important;
    border-bottom: 1px solid var(--gg-mobile-border);
    box-shadow: 0 3px 14px rgba(20, 25, 35, 0.06);
    padding: 8px 0 10px !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  header .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  header .header-content {
    display: grid !important;
    grid-template-columns: minmax(82px, 118px) minmax(0, 1fr) !important;
    gap: 9px !important;
    align-items: center !important;
    min-height: 0 !important;
  }

  header #logo {
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    text-decoration: none !important;
    overflow: hidden;
  }

  header #logo .brand-lockup,
  header #logo .logo-image {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  header #logo .brand-lockup__main,
  header #logo .logo-image img {
    width: 100% !important;
    max-width: 112px !important;
    height: auto !important;
    max-height: 42px !important;
    object-fit: contain !important;
    object-position: left center !important;
  }

  header #logo .brand-lockup__divider,
  header #logo .brand-lockup__tag,
  header #logo .logo-text,
  header #logo .logo-subtitle {
    display: none !important;
  }

  header .header-right {
    width: 100% !important;
    min-width: 0 !important;
    display: block !important;
    margin: 0 !important;
  }

  header .search-form {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    position: relative !important;
  }

  header .search-form input {
    width: 100% !important;
    height: 46px !important;
    border-radius: 16px !important;
    border: 1px solid #d9dde5 !important;
    background: #f8f9fb !important;
    padding: 0 48px 0 15px !important;
    font-size: 16px !important;
    box-shadow: none !important;
  }

  header .search-form input:focus {
    border-color: rgba(67, 97, 238, 0.55) !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.09) !important;
  }

  header .search-form button {
    position: absolute !important;
    right: 4px !important;
    top: 4px !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 12px !important;
    padding: 0 !important;
    display: grid !important;
    place-items: center !important;
  }

  /* Эти действия переезжают в нижнюю навигацию. */
  header #wishlist-header,
  header #cart,
  header .header-right > .wishlist-button,
  header .header-right > .cart-button {
    display: none !important;
  }

  .search-results {
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    top: 70px !important;
    width: auto !important;
    max-height: min(62vh, 520px) !important;
    z-index: 3500 !important;
    border-radius: 14px !important;
    overflow: auto !important;
  }

  /* Две товарные карточки в ряд, как в современных мобильных каталогах. */
  .products-grid,
  .catalog-products,
  #catalog-template-page #catalog-products-container,
  #subcategory-template-page #subcategory-products-container,
  #ps5-catalog-page #ps5-catalog-products,
  .wishlist-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  #catalog-products-container .product-image,
  #subcategory-products-container .product-image,
  #ps5-catalog-products .product-image,
  .product-card .product-image {
    height: 190px !important;
  }

  .product-card .product-content {
    padding: 10px 10px 12px !important;
  }

  .product-card .product-title,
  .product-card h3,
  .product-card h4 {
    font-size: 14px !important;
    line-height: 1.3 !important;
  }

  /* Боковой каталог на телефоне заменяет кнопка «Каталог» снизу. */
  #sidebar,
  .sidebar {
    display: none !important;
  }

  .content-wrapper {
    display: block !important;
  }

  #content {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  /* ===== Нижняя навигация ===== */
  .gg-mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2400;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: calc(var(--gg-mobile-nav-height) + env(safe-area-inset-bottom, 0px));
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid var(--gg-mobile-border);
    box-shadow: 0 -8px 24px rgba(16, 24, 40, 0.10);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
  }

  .gg-mobile-nav__item {
    position: relative;
    appearance: none;
    border: 0;
    background: transparent;
    color: #363a41;
    min-width: 0;
    padding: 4px 2px 2px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .gg-mobile-nav__item i {
    font-size: 21px;
    line-height: 1;
  }

  .gg-mobile-nav__label {
    display: block;
    max-width: 100%;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .gg-mobile-nav__item.is-active {
    color: var(--gg-mobile-accent);
  }

  .gg-mobile-nav__item:active {
    background: #f1f4ff;
  }

  .gg-mobile-nav__badge {
    position: absolute;
    top: 1px;
    left: calc(50% + 8px);
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: #e3132c;
    color: #fff;
    font-size: 10px;
    line-height: 17px;
    font-weight: 800;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
  }

  .gg-mobile-nav__badge[hidden] {
    display: none !important;
  }

  /* ===== Каталог снизу ===== */
  .gg-mobile-sheet-backdrop,
  .gg-mobile-filter-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2600;
    display: block;
    background: rgba(17, 24, 39, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .gg-mobile-sheet-backdrop.is-open,
  .gg-mobile-filter-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .gg-mobile-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2700;
    display: block;
    max-height: min(78dvh, 680px);
    padding: 10px 14px calc(18px + env(safe-area-inset-bottom, 0px));
    border-radius: 22px 22px 0 0;
    background: #fff;
    box-shadow: 0 -14px 40px rgba(17, 24, 39, 0.2);
    transform: translateY(105%);
    transition: transform 0.24s ease;
    overflow: hidden;
  }

  .gg-mobile-sheet.is-open {
    transform: translateY(0);
  }

  .gg-mobile-sheet__handle {
    width: 42px;
    height: 4px;
    margin: 0 auto 10px;
    border-radius: 999px;
    background: #d4d7dc;
  }

  .gg-mobile-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
  }

  .gg-mobile-sheet__head strong {
    font-size: 19px;
  }

  .gg-mobile-sheet__close,
  .gg-mobile-filter-close {
    appearance: none;
    border: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #f1f3f5;
    color: #343a40;
    font-size: 18px;
    cursor: pointer;
  }

  .gg-mobile-sheet__body {
    max-height: calc(min(78dvh, 680px) - 78px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 8px;
  }

  .gg-mobile-sheet__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .gg-mobile-sheet__link {
    min-height: 54px;
    border: 1px solid var(--gg-mobile-border);
    border-radius: 14px;
    padding: 10px 11px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--gg-mobile-text);
    background: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
  }

  .gg-mobile-sheet__link i {
    width: 22px;
    text-align: center;
    color: var(--gg-mobile-accent);
    font-size: 17px;
  }

  body.gg-mobile-sheet-lock {
    overflow: hidden !important;
    touch-action: none;
  }

  /* ===== Компактные фильтры категории ===== */
  .gg-mobile-filter-tools {
    display: block;
    margin: 6px 0 12px;
  }

  .gg-mobile-filter-tools__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
  }

  .gg-mobile-sort-select,
  .gg-mobile-filter-button {
    height: 44px;
    border: 1px solid #d9dde5;
    border-radius: 14px;
    background: #fff;
    color: var(--gg-mobile-text);
    font-size: 14px;
  }

  .gg-mobile-sort-select {
    width: 100%;
    min-width: 0;
    padding: 0 34px 0 12px;
  }

  .gg-mobile-filter-button {
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-weight: 700;
    white-space: nowrap;
  }

  .gg-mobile-filter-tools__chips {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    scrollbar-width: none;
    margin-top: 8px;
    padding: 1px 1px 3px;
    overscroll-behavior-inline: contain;
  }

  .gg-mobile-filter-tools__chips::-webkit-scrollbar {
    display: none;
  }

  .gg-mobile-filter-chip {
    flex: 0 0 auto;
    min-height: 36px;
    border: 1px solid #d9dde5;
    border-radius: 999px;
    padding: 7px 12px;
    color: #343a40;
    background: #fff;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 600;
    white-space: nowrap;
  }

  .gg-mobile-filter-chip.is-active {
    border-color: rgba(67, 97, 238, 0.45);
    background: #eef1ff;
    color: #304ed0;
  }

  .catalog-filter-panel {
    display: none !important;
  }

  .catalog-filter-panel.gg-mobile-filter-open {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 2750 !important;
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    max-height: 84dvh !important;
    margin: 0 !important;
    padding: 16px 14px calc(20px + env(safe-area-inset-bottom, 0px)) !important;
    border: 0 !important;
    border-radius: 22px 22px 0 0 !important;
    background: #fff !important;
    box-shadow: 0 -14px 40px rgba(17, 24, 39, 0.22) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
  }

  .catalog-filter-panel.gg-mobile-filter-open .gg-mobile-filter-close {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: 0 0 8px auto;
    display: grid;
    place-items: center;
  }

  .catalog-filter-panel.gg-mobile-filter-open .catalog-filter-main {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .catalog-filter-panel.gg-mobile-filter-open .catalog-filter-search,
  .catalog-filter-panel.gg-mobile-filter-open .catalog-filter-sort,
  .catalog-filter-panel.gg-mobile-filter-open .catalog-filter-actions {
    grid-column: 1 / -1 !important;
  }

  .catalog-filter-panel.gg-mobile-filter-open .catalog-filter-field {
    min-width: 0 !important;
  }

  .catalog-filter-panel.gg-mobile-filter-open .catalog-filter-field input,
  .catalog-filter-panel.gg-mobile-filter-open .catalog-filter-field select,
  .catalog-filter-panel.gg-mobile-filter-open .catalog-filter-apply,
  .catalog-filter-panel.gg-mobile-filter-open .catalog-filter-reset {
    min-height: 44px !important;
  }

  .catalog-filter-panel.gg-mobile-filter-open .gg-category-types,
  .catalog-filter-panel.gg-mobile-filter-open .catalog-filter-presets,
  .catalog-filter-panel.gg-mobile-filter-open .catalog-filter-alpha-row {
    display: flex !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    gap: 7px !important;
    scrollbar-width: none;
  }

  .catalog-filter-panel.gg-mobile-filter-open .gg-category-type,
  .catalog-filter-panel.gg-mobile-filter-open .catalog-filter-letter {
    flex: 0 0 auto !important;
  }

  /* Модальные окна всегда выше нижней панели. */
  .cart-modal,
  .telegram-modal,
  .gg-ui-modal,
  .product-image-lightbox,
  [role="dialog"] {
    z-index: 4000;
  }
}

@media (max-width: 390px) {
  header .header-content {
    grid-template-columns: 88px minmax(0, 1fr) !important;
  }

  .gg-mobile-nav__label {
    font-size: 10px;
  }

  .product-card .product-image,
  #catalog-products-container .product-image,
  #subcategory-products-container .product-image,
  #ps5-catalog-products .product-image {
    height: 165px !important;
  }
}

/* ===== MAG 1.1.73: компактный мобильный каталог ===== */
@media (max-width: 820px) {
  /* Старые верхние кнопки больше не нужны: каталог и основная навигация живут снизу. */
  .mobile-nav-actions,
  #mobile-catalog-toggle,
  #mobile-menu-toggle,
  #mobile-drawer-overlay {
    display: none !important;
  }

  html,
  body,
  #container,
  main,
  #category-page,
  #category-page > .container,
  #content {
    max-width: 100% !important;
    overflow-x: clip !important;
  }

  /* На телефоне hero оставляет только саму категорию. Служебные цифры здесь не помогают покупке. */
  #category-page .category-hero {
    margin: 10px 0 8px !important;
    padding: 15px 16px !important;
    min-height: 0 !important;
    border-radius: 16px !important;
  }

  #category-page .category-hero-main {
    gap: 11px !important;
    align-items: center !important;
  }

  #category-page .category-hero-icon {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    border-radius: 12px !important;
  }

  #category-page .category-hero-copy {
    min-width: 0 !important;
  }

  #category-page .category-hero-copy h1 {
    margin: 0 !important;
    font-size: clamp(22px, 6.4vw, 29px) !important;
    line-height: 1.08 !important;
    overflow-wrap: anywhere;
  }

  #category-page .category-hero-kicker,
  #category-page .category-hero-copy > p,
  #category-page .category-hero-meta {
    display: none !important;
  }

  /* Быстрые фильтры располагаются строками, а не растягивают всю страницу вправо. */
  .gg-mobile-filter-tools,
  .gg-mobile-filter-tools__row,
  .gg-mobile-filter-tools__chips {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .gg-mobile-filter-tools__chips {
    display: flex !important;
    flex-wrap: wrap !important;
    overflow: visible !important;
    gap: 6px !important;
    margin-top: 7px !important;
    padding: 0 !important;
  }

  .gg-mobile-filter-chip {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 32px !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
    line-height: 1.15 !important;
    white-space: normal !important;
    text-align: center;
    overflow-wrap: anywhere;
  }

  .gg-mobile-filter-chip--button {
    appearance: none;
    font-family: inherit;
    cursor: pointer;
  }

  /* Во внутреннем фильтре тоже оставляем короткие названия и запрещаем горизонтальную простыню. */
  .catalog-filter-panel.gg-mobile-filter-open .gg-category-types,
  .catalog-filter-panel.gg-mobile-filter-open .catalog-filter-presets,
  .catalog-filter-panel.gg-mobile-filter-open .catalog-filter-alpha-row {
    display: flex !important;
    flex-wrap: wrap !important;
    overflow-x: visible !important;
    max-width: 100% !important;
    gap: 6px !important;
  }

  .catalog-filter-panel.gg-mobile-filter-open .gg-category-type {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    padding: 7px 9px !important;
  }

  .catalog-filter-panel.gg-mobile-filter-open .gg-category-type-hint,
  .catalog-filter-panel.gg-mobile-filter-open .gg-category-type-copy small {
    display: none !important;
  }

  .catalog-filter-panel.gg-mobile-filter-open .gg-category-type-label {
    font-size: 12px !important;
    line-height: 1.15 !important;
  }

  .catalog-filter-panel.gg-mobile-filter-open .catalog-filter-letter {
    min-width: 31px !important;
    min-height: 31px !important;
    padding: 5px 8px !important;
    font-size: 12px !important;
  }

  .product-card,
  .product-card .product-content,
  .product-card .product-title {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .product-card .product-title,
  .product-card .product-title a {
    overflow-wrap: anywhere !important;
  }
}


/* ===== MAG 1.1.74: компактные фильтры + постоянно видимая нижняя навигация ===== */
@media (max-width: 820px) {
  /* Нижняя навигация остаётся видимой и поверх каталога/фильтров. */
  .gg-mobile-nav {
    z-index: 5200 !important;
  }

  .gg-mobile-sheet,
  .catalog-filter-panel.gg-mobile-filter-open {
    bottom: calc(var(--gg-mobile-nav-height) + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 5000 !important;
    max-height: calc(84dvh - var(--gg-mobile-nav-height)) !important;
    padding-bottom: 16px !important;
  }

  .gg-mobile-sheet-backdrop,
  .gg-mobile-filter-backdrop {
    bottom: calc(var(--gg-mobile-nav-height) + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 4900 !important;
  }

  body.gg-mobile-sheet-lock {
    overflow: hidden !important;
    touch-action: auto !important;
  }

  /* Тип товара: короткие кнопки без вторичного текста. */
  .gg-mobile-type-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
    width: 100%;
  }

  .gg-mobile-type-chip {
    min-width: 0;
    min-height: 34px;
    padding: 7px 6px;
    border: 1px solid #d9e0ee;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #33415c;
    background: #fff;
    text-decoration: none;
    text-align: center;
    font-size: 11px;
    line-height: 1.12;
    font-weight: 750;
    overflow-wrap: anywhere;
  }

  .gg-mobile-type-chip:first-child {
    grid-column: span 2;
  }

  .gg-mobile-type-chip.is-active {
    border-color: transparent;
    color: #fff;
    background: linear-gradient(105deg, #4361ee 0%, #7a12e6 100%);
    box-shadow: 0 3px 10px rgba(86, 54, 220, 0.18);
  }

  /* Алфавит расположен прямо над товарами. Никакого отдельного окна ради одной буквы. */
  .gg-mobile-alpha-block {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #edf0f5;
  }

  .gg-mobile-alpha-actions {
    display: grid;
    grid-template-columns: 1.15fr 1fr 1fr;
    gap: 6px;
    width: 100%;
    margin-bottom: 6px;
  }

  .gg-mobile-alpha-action {
    min-width: 0;
    min-height: 31px;
    padding: 6px 5px;
    border: 1px solid #d9e0ee;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #36517d;
    background: #fff;
    text-decoration: none;
    text-align: center;
    font-size: 10px;
    line-height: 1.08;
    font-weight: 750;
    white-space: nowrap;
  }

  .gg-mobile-alpha-action.is-active {
    border-color: transparent;
    color: #fff;
    background: linear-gradient(105deg, #4361ee 0%, #7a12e6 100%);
  }

  .gg-mobile-alpha-row {
    --gg-alpha-count: 1;
    display: grid;
    grid-template-columns: repeat(var(--gg-alpha-count), minmax(0, 1fr));
    gap: 4px;
    width: 100%;
    max-width: 100%;
    margin-top: 4px;
    overflow: hidden;
  }

  .gg-mobile-alpha-letter {
    min-width: 0;
    height: 27px;
    padding: 0 1px;
    border: 1px solid #dce3ef;
    border-radius: 7px;
    display: grid;
    place-items: center;
    color: #35517d;
    background: #f8faff;
    text-decoration: none;
    font-size: clamp(8px, 2.35vw, 11px);
    line-height: 1;
    font-weight: 800;
  }

  .gg-mobile-alpha-letter.is-active {
    border-color: #5367ee;
    color: #fff;
    background: #5367ee;
  }

  .gg-mobile-result-count {
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid #edf0f5;
    color: #71809a;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 600;
  }

  /* В полном bottom-sheet не повторяем то, что уже доступно сверху. */
  .catalog-filter-panel.gg-mobile-filter-open .gg-category-types,
  .catalog-filter-panel.gg-mobile-filter-open .catalog-filter-alphabet,
  .catalog-filter-panel.gg-mobile-filter-open .catalog-filter-result-count {
    display: none !important;
  }

  .catalog-filter-panel.gg-mobile-filter-open .catalog-filter-main {
    padding-top: 2px !important;
  }

  /* Старые быстрые chips 1.1.73 больше не используются. */
  .gg-mobile-filter-tools__chips {
    display: none !important;
  }

  /* Никакой элемент фильтров не может расширить страницу вправо. */
  .gg-mobile-filter-tools,
  .gg-mobile-type-grid,
  .gg-mobile-alpha-block,
  .gg-mobile-alpha-actions,
  .gg-mobile-alpha-row,
  .gg-mobile-result-count {
    box-sizing: border-box;
    max-width: 100% !important;
    min-width: 0 !important;
  }
}

@media (max-width: 390px) {
  .gg-mobile-type-chip {
    font-size: 10px;
    padding-left: 4px;
    padding-right: 4px;
  }

  .gg-mobile-alpha-action {
    font-size: 9px;
  }

  .gg-mobile-alpha-letter {
    height: 25px;
    font-size: clamp(7px, 2.2vw, 10px);
  }
}


/* ===== MAG 1.1.75: нижнее Меню + симметричные фильтры ===== */
@media (max-width: 820px) {
  /* Шесть постоянных пунктов: верхнее «Меню» окончательно переехало вниз. */
  .gg-mobile-nav {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    padding-left: 3px !important;
    padding-right: 3px !important;
  }

  .gg-mobile-nav__item {
    padding-left: 1px !important;
    padding-right: 1px !important;
  }

  .gg-mobile-nav__item i {
    font-size: 20px !important;
  }

  .gg-mobile-nav__label {
    font-size: 10px !important;
  }

  .gg-mobile-sheet__empty {
    grid-column: 1 / -1;
    padding: 18px 10px;
    color: #78849a;
    text-align: center;
    font-size: 13px;
  }

  /* Первая строка строго 50/50: «Все товары» слева, сортировка справа. */
  .gg-mobile-filter-tools__row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }

  .gg-mobile-all-products-slot,
  .gg-mobile-sort-select {
    width: 100% !important;
    min-width: 0 !important;
  }

  .gg-mobile-all-products {
    width: 100%;
    height: 44px;
    padding: 0 9px;
    border: 1px solid #d9e0ee;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    color: #33415c;
    background: #fff;
    text-decoration: none;
    text-align: center;
    font-size: 12px;
    line-height: 1.1;
    font-weight: 800;
  }

  .gg-mobile-all-products.is-active {
    border-color: transparent;
    color: #fff;
    background: linear-gradient(105deg, #4361ee 0%, #7a12e6 100%);
    box-shadow: 0 3px 10px rgba(86, 54, 220, 0.16);
  }

  .gg-mobile-sort-select {
    height: 44px !important;
    padding-left: 10px !important;
    padding-right: 28px !important;
    border-radius: 12px !important;
    font-size: 12px !important;
    font-weight: 700;
  }

  /* Четыре типа товара ровно в два ряда по две кнопки. */
  .gg-mobile-type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
    margin-top: 7px !important;
  }

  .gg-mobile-type-chip,
  .gg-mobile-type-chip:first-child {
    grid-column: auto !important;
    min-height: 36px !important;
    padding: 7px 8px !important;
    border-radius: 10px !important;
    font-size: 11px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Отдельной кнопки «Фильтры» больше нет: быстрые фильтры уже перед глазами. */
  .gg-mobile-filter-button,
  .gg-mobile-filter-backdrop,
  .gg-mobile-filter-close {
    display: none !important;
  }

  .catalog-filter-panel.gg-mobile-filter-open {
    display: none !important;
  }

  /* Алфавит остаётся двумя компактными строками и никогда не расширяет страницу. */
  .gg-mobile-alpha-row {
    width: 100% !important;
    max-width: 100% !important;
    grid-template-columns: repeat(var(--gg-alpha-count, 1), minmax(0, 1fr)) !important;
    gap: 3px !important;
  }

  .gg-mobile-alpha-letter {
    min-width: 0 !important;
    width: 100% !important;
    height: 28px !important;
    padding: 0 !important;
    border-radius: 6px !important;
    font-size: clamp(7px, 2.2vw, 10px) !important;
  }

  .gg-mobile-alpha-actions {
    grid-template-columns: 1.15fr 1fr 1fr !important;
    gap: 6px !important;
  }

  .gg-mobile-result-count {
    margin-top: 8px !important;
  }
}

@media (max-width: 360px) {
  .gg-mobile-nav__label {
    font-size: 9px !important;
  }

  .gg-mobile-nav__item i {
    font-size: 18px !important;
  }

  .gg-mobile-all-products,
  .gg-mobile-sort-select {
    font-size: 11px !important;
  }
}

/* ===== MAG 1.2.21: чат в нижней панели ===== */
@media (max-width:820px){
  .gg-mobile-nav{grid-template-columns:repeat(7,minmax(0,1fr))!important}
}
@media (max-width:420px){
  .gg-mobile-nav__item{padding-left:0!important;padding-right:0!important}
  .gg-mobile-nav__item i{font-size:19px!important}
  .gg-mobile-nav__label{font-size:9px!important}
}
