/**
 * Мобильный UI — aquagrp.ru
 * Подключать после shop.css и home-landing.css
 */
@media (max-width: 768px) {
  .search-mobile-sticky ~ .search-mobile-sticky {
    display: none !important;
  }

  html {
    --trust-strip-h: 0px;
    --mobile-search-h: 60px;
    --mobile-chrome-h: calc(var(--header-h, 56px) + var(--mobile-search-h));
  }

  .container {
    width: 100%;
    max-width: 100%;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    box-sizing: border-box;
  }

  html,
  body {
    overflow-x: hidden;
    max-width: 100%;
  }

  body {
    padding-bottom: calc(var(--mobile-action-h, 56px) + 16px + env(safe-area-inset-bottom, 0px));
  }

  /* Каталог только в липкой строке поиска, не в шапке */
  .header-start .header-catalog-btn,
  .site-header .header-catalog-btn:not(.header-catalog-btn--mobile) {
    display: none !important;
  }

  /* Шапка: компактные иконки без подписей и рамок */
  .site-header {
    padding-top: env(safe-area-inset-top, 0px);
  }

  .site-header__inner {
    gap: 8px;
    padding-block: 8px;
    justify-content: space-between;
  }

  .header-actions {
    gap: 0;
    margin-left: auto;
    flex-shrink: 0;
  }

  .header-call-link__short,
  .header-call-link__long,
  .cart-btn__text,
  .header-action-btn__label {
    display: none !important;
  }

  .site-header .header-call-link,
  .site-header .header-action-btn,
  .site-header .header-actions .cart-btn,
  .site-header .menu-toggle {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: center;
    min-width: 40px !important;
    width: 40px;
    height: 40px;
    min-height: 40px !important;
    padding: 0 !important;
    margin: 0;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--text) !important;
    font-size: 0 !important;
    line-height: 0 !important;
  }

  .site-header .menu-toggle {
    flex-direction: column !important;
    gap: 4px;
  }

  .site-header .menu-toggle span {
    width: 18px;
  }

  .site-header .header-action-btn__icon,
  .site-header .header-call-link__icon,
  .site-header .cart-btn__icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
  }

  .site-header .cart-btn__badge {
    top: 2px;
    right: 0;
  }

  .logo {
    gap: 8px;
    min-width: 0;
  }

  .logo__mark {
    width: 28px;
    height: 32px;
  }

  .logo__brand,
  .logo__tag {
    font-size: 1rem;
  }

  .mobile-action-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    display: flex;
    gap: 8px;
    padding: 8px max(12px, env(safe-area-inset-left, 0px)) calc(8px + env(safe-area-inset-bottom, 0px))
      max(12px, env(safe-area-inset-right, 0px));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(26, 43, 60, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .mobile-action-bar__btn {
    flex: 1;
    min-height: 48px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-btn, 6px);
    background: var(--surface, #fff);
    color: var(--text);
    font: 600 0.92rem/1.2 var(--font, system-ui, sans-serif);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
  }

  .mobile-action-bar__btn--primary {
    background: var(--color-primary, #1a5f7a);
    border-color: var(--color-primary, #1a5f7a);
    color: #fff;
  }

  .mobile-action-bar__badge {
    min-width: 20px;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--color-primary-dark, #0e5c80);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
  }

  .mobile-action-bar__btn--primary .mobile-action-bar__badge {
    background: rgba(255, 255, 255, 0.22);
  }

  /* ——— Меньше «липучек» сверху ——— */
  .site-trust-strip {
    display: none !important;
  }

  body.has-trust-strip .site-header {
    top: 0;
  }

  .search-mobile-sticky {
    top: var(--header-h, 56px);
    padding: 6px 0;
    z-index: 110;
  }

  .search--mobile-bar input {
    font-size: 16px;
    min-height: 48px;
    padding: 12px 16px 12px 44px;
    border-radius: 999px;
    background: var(--surface);
  }

  .search-mobile-sticky__row .header-catalog-btn--mobile {
    min-height: 48px;
    border-radius: 12px;
  }

  /* ——— Каталог на телефоне: полноэкранное меню, не выпадашка ——— */
  .header-catalog-panel__mobile-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
  }

  .header-catalog-panel__title {
    flex: 1;
    font: 600 1.05rem/1.2 var(--font, system-ui, sans-serif);
    text-align: center;
    color: var(--text);
  }

  .header-catalog-panel__back,
  .header-catalog-panel__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
  }

  .header-catalog-panel__back:not([hidden]) + .header-catalog-panel__title {
    text-align: left;
    padding-left: 4px;
  }

  .header-catalog-panel {
    inset: 0;
    top: 0 !important;
    max-height: none;
    z-index: 150;
  }

  .header-catalog-overlay {
    inset: 0 !important;
    top: 0 !important;
    z-index: 145;
    background: rgba(15, 25, 35, 0.45);
  }

  .header-catalog-panel > .container {
    height: 100%;
    max-height: 100%;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    background: var(--surface);
  }

  .header-catalog-panel__inner {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    padding: 0 !important;
  }

  .header-catalog-mega {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .header-catalog-mega__cats {
    display: flex;
    flex-direction: column;
    overflow: visible;
    overflow-y: auto;
    border-right: none;
    border-bottom: none;
    padding: 0;
    gap: 0;
    background: var(--surface);
    -webkit-overflow-scrolling: touch;
  }

  .header-catalog-mega__cat {
    width: 100%;
    max-width: none;
    white-space: normal;
    padding: 14px 16px;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    font-size: 1rem;
    background: var(--surface);
  }

  .header-catalog-mega__cat::after {
    content: "›";
    margin-left: auto;
    color: var(--muted);
    font-size: 1.25rem;
    line-height: 1;
  }

  .header-catalog-mega__cat.is-active {
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
  }

  .header-catalog-mega__subs {
    display: none;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
  }

  .header-catalog-mega.is-mobile-sub .header-catalog-mega__cats {
    display: none;
  }

  .header-catalog-mega.is-mobile-sub .header-catalog-mega__subs {
    display: block;
  }

  .header-catalog-mega__pane {
    padding: 0;
  }

  .header-catalog-mega__pane-head {
    display: none;
  }

  .header-catalog-mega__columns {
    display: block;
    gap: 0;
  }

  .header-catalog-mega__group {
    margin: 0;
  }

  .header-catalog-mega__group-title {
    display: block;
    padding: 12px 16px 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
  }

  .header-catalog-mega__links {
    display: block;
    gap: 0;
  }

  .header-catalog-mega__link-item {
    display: block;
  }

  .header-catalog-mega__links a,
  .header-catalog-mega__link-item > a {
    display: block;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
    text-decoration: none;
    color: var(--text);
  }

  .header-catalog-mega__brands {
    display: none;
  }

  body.header-catalog-open .site-header,
  body.header-catalog-open .search-mobile-sticky {
    z-index: 100;
  }

  body.header-catalog-open #mobile-action-bar,
  body.header-catalog-open #messenger-fab,
  body.header-catalog-open .cookie-banner,
  body.header-catalog-open .contact-dock {
    display: none !important;
  }

  body.header-catalog-open {
    overflow: hidden;
    touch-action: none;
  }

  /* ——— Шапка: иконки вместо длинного текста ——— */
  .header-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 44px;
    min-height: 44px;
    padding: 0 10px;
  }

  .header-action-btn__label {
    display: none;
  }

  .header-action-btn__icon {
    font-size: 1.15rem;
    line-height: 1;
  }

  .header-actions .cart-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 8px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .header-actions .btn--ghost:not(.cart-btn):not(.header-action-btn) {
    display: none;
  }

  .menu-toggle {
    min-width: 44px;
    min-height: 44px;
  }

  .mobile-nav .search-mobile {
    display: none !important;
  }

  .mobile-nav a {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 12px 0;
    font-size: 1rem;
  }

  /* ——— Мобильное меню: полноэкранная панель ——— */
  .mobile-nav {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    top: var(--header-h, 56px);
    bottom: 0;
    z-index: 136;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: var(--bg, #fff);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 16px calc(24px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border);
    max-height: none;
  }

  .mobile-nav.is-open {
    display: flex;
    flex-direction: column;
  }

  .mobile-nav > a {
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-weight: 500;
    text-decoration: none;
  }

  .mobile-nav > a:last-of-type {
    border-bottom: none;
  }

  body.mobile-nav-open {
    overflow: hidden;
    touch-action: none;
  }

  html.mobile-nav-scroll-lock {
    overflow: hidden;
    height: 100%;
  }

  html.mobile-nav-scroll-lock body {
    overflow: hidden;
    touch-action: none;
  }

  body.mobile-nav-open .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 140;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--bg, #fff);
  }

  #mobile-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 130;
    background: rgba(15, 25, 35, 0.42);
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    pointer-events: none;
  }

  #mobile-nav-backdrop:not([hidden]) {
    display: block;
    pointer-events: auto;
  }

  body.mobile-nav-open::before {
    content: none;
  }

  body.mobile-nav-open .search-mobile-sticky,
  body.mobile-nav-open #messenger-fab,
  body.mobile-nav-open #mobile-action-bar,
  body.mobile-nav-open .cookie-banner,
  body.mobile-nav-open .contact-dock,
  body.mobile-nav-open .compare-bar {
    display: none !important;
  }

  .mobile-nav__messengers {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    flex-wrap: nowrap !important;
    gap: 8px;
    padding-top: 16px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
  }

  .mobile-nav__msg {
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
    min-height: 48px;
    font-size: 0.95rem;
    gap: 10px;
    border-radius: var(--radius-sm, 8px);
    border: 0;
    color: #fff;
    font-weight: 600;
  }

  .mobile-nav__msg--wa,
  .mobile-nav__msg.btn--messenger-wa {
    background: #25d366;
    color: #fff;
  }

  .mobile-nav__msg--wa .msg-icon path,
  .mobile-nav__msg.btn--messenger-wa .msg-icon path {
    fill: #fff;
  }

  .mobile-nav__msg--tg,
  .mobile-nav__msg.btn--messenger-tg {
    background: #229ed9;
    color: #fff;
  }

  .mobile-nav__msg--max,
  .mobile-nav__msg.btn--messenger-max {
    background: #6b5ce7;
    color: #fff;
  }

  .mobile-nav a[href="/pages/favorites.html"] {
    display: none;
  }

  .mobile-nav__msg .msg-icon,
  .mobile-nav__msg .msg-icon--brand-max,
  .mobile-nav__msg .msg-icon--max-glyph {
    width: 22px !important;
    height: 22px !important;
    flex-shrink: 0;
  }

  .mobile-nav__phone {
    display: none;
  }

  .mobile-nav__cta {
    display: inline-flex;
    width: 100%;
    justify-content: center;
    min-height: 48px;
    margin-top: auto;
    padding-top: 16px;
  }

  /* ——— Главная: лента товаров WB ——— */
  html.is-home .catalog-home-lead,
  body.page-home .catalog-home-lead,
  html.is-home .home-catalog-cta,
  body.page-home .home-catalog-cta,
  html.is-home .catalog-preview-more,
  body.page-home .catalog-preview-more {
    display: none !important;
  }

  html.is-home .product-grid--wb,
  body.page-home .product-grid--wb {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  body.page-home .product-card--wb .product-card__tools {
    display: flex !important;
  }

  html.is-home .aqu-hero__messengers {
    display: none !important;
  }

  html.is-catalog .home-catalog-cta,
  body.page-catalog .home-catalog-cta {
    display: none !important;
  }

  html.is-catalog .aqu-hero,
  html.is-catalog .aqu-benefits--compact,
  body.page-catalog .aqu-hero,
  body.page-catalog .aqu-benefits--compact {
    display: none !important;
  }

  /* ——— Каталог /catalog/ ——— */
  html.is-catalog .catalog,
  body.page-catalog .catalog {
    padding-top: 8px;
  }

  html.is-catalog .catalog__title,
  body.page-catalog .catalog__title {
    font-size: 1.25rem;
    margin-bottom: 4px;
  }

  html.is-catalog .catalog-page-lead,
  body.page-catalog .catalog-page-lead {
    font-size: 0.88rem;
    margin-bottom: 12px;
  }

  .catalog-tools-row {
    top: var(--mobile-chrome-h);
    z-index: 48;
    padding: 6px 0 8px;
    margin-bottom: 8px;
    box-shadow: 0 6px 12px rgba(26, 43, 60, 0.06);
  }

  html.is-catalog .catalog-nav-toggle,
  html.is-catalog .smart-filter-toggle,
  body.page-catalog .catalog-nav-toggle,
  body.page-catalog .smart-filter-toggle {
    width: 100%;
    margin: 0;
    display: flex;
    min-height: 48px;
  }

  .toolbar select,
  .toolbar--filters select,
  .smart-filter select {
    min-height: 44px;
    font-size: 16px;
  }

  .catalog-nav__head,
  .catalog-nav__subhead,
  .catalog-nav__link {
    min-height: 44px;
    padding: 10px 8px;
    font-size: 0.95rem;
  }

  .toolbar {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
  }

  .toolbar select,
  .toolbar input[type="checkbox"] {
    min-height: 44px;
    font-size: 16px;
  }

  /* ——— Карточки товаров ——— */
  .product-card {
    overflow: hidden;
  }

  .product-card__body {
    padding: 12px 14px 14px;
  }

  .product-card__name {
    font-size: 0.95rem;
    line-height: 1.35;
  }

  .product-card__purchase {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .card-qty {
    width: 100%;
    justify-content: center;
    gap: 8px;
  }

  .card-qty__btn {
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
  }

  .card-qty__input {
    width: 64px;
    height: 44px;
    font-size: 16px;
  }

  .product-card__actions {
    gap: 8px;
  }

  .product-card__actions .btn {
    min-height: 44px;
    font-size: 0.92rem;
  }

  .qty button {
    width: 44px;
    height: 44px;
  }

  /* ——— Мессенджеры: горизонтальная панель ——— */
  .messenger-fab {
    flex-direction: row;
    left: max(12px, env(safe-area-inset-left, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: calc(var(--mobile-action-h, 56px) + 12px + env(safe-area-inset-bottom, 0px));
    justify-content: center;
    gap: 14px;
    width: auto;
  }

  body:has(#cookie-banner:not([hidden])) #messenger-fab {
    bottom: calc(var(--mobile-action-h, 56px) + 92px + env(safe-area-inset-bottom, 0px));
  }

  body:has(#cookie-banner:not([hidden])) {
    padding-bottom: calc(var(--mobile-action-h, 56px) + 112px + env(safe-area-inset-bottom, 0px));
  }

  .messenger-fab__btn {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
  }

  .messenger-fab__btn--max .msg-icon {
    width: 52px;
    height: 52px;
  }

  .shop-toast {
    bottom: calc(var(--mobile-action-h, 56px) + 24px + env(safe-area-inset-bottom, 0px));
  }

  .compare-bar {
    z-index: 95;
    bottom: calc(var(--mobile-action-h, 56px) + 16px + env(safe-area-inset-bottom, 0px));
  }

  /* ——— Лендинг ——— */
  .aqu-hero--banner {
    padding: 12px 0 10px;
  }

  .aqu-hero__banner {
    min-height: clamp(380px, 88vw, 480px);
    border-radius: 14px;
  }

  .aqu-hero__bg {
    object-position: 80% center;
    animation-duration: 28s;
  }

  .aqu-hero__shade {
    background: linear-gradient(180deg, rgba(10, 38, 54, 0.92) 0%, rgba(14, 58, 78, 0.88) 55%, rgba(26, 95, 122, 0.55) 100%);
  }

  .aqu-hero__content {
    padding: 22px 18px 24px;
    max-width: 100%;
    justify-content: flex-end;
    min-height: 100%;
  }

  .aqu-hero--banner h1 {
    font-size: 1.38rem;
    margin-bottom: 10px;
  }

  .aqu-hero--banner .aqu-hero__lead {
    font-size: 0.92rem;
    margin-bottom: 16px;
  }

  .aqu-hero__badges {
    margin-bottom: 12px;
  }

  .aqu-hero__badge {
    font-size: 0.72rem;
    padding: 5px 10px;
  }

  .aqu-hero__valve {
    top: 8%;
    right: 6%;
    width: 64px;
    height: 64px;
    opacity: 0.45;
  }

  .aqu-hero__pipe {
    display: none;
  }

  .aqu-hero__stats {
    margin-top: 16px;
    gap: 10px 16px;
  }

  .aqu-hero__stats li {
    min-width: 0;
    flex: 1 1 calc(33% - 12px);
  }

  .aqu-hero__stats strong {
    font-size: 0.92rem;
  }

  .aqu-hero__stats span {
    font-size: 0.68rem;
    max-width: none;
  }

  .aqu-hero {
    padding: 16px 0 12px;
  }

  .aqu-hero__card {
    padding: 22px 18px;
    min-height: 220px;
  }

  .aqu-hero h1 {
    font-size: 1.32rem;
    margin-bottom: 12px;
  }

  .aqu-hero__lead {
    font-size: 0.92rem;
    margin-bottom: 16px;
  }

  .aqu-hero__cta {
    flex-direction: column;
  }

  .aqu-hero__cta .aqu-btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  .aqu-hero__messengers {
    justify-content: stretch;
    flex-direction: column;
    margin-top: 14px;
  }

  .aqu-hero__messengers .btn--messenger {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .aqu-benefits--strip {
    padding: 0 0 12px;
  }

  .aqu-benefits__strip {
    grid-template-columns: 1fr 1fr;
  }

  .aqu-benefits__item {
    padding: 12px 14px;
  }

  .aqu-benefits__title {
    font-size: 0.82rem;
  }

  .aqu-benefits__text {
    font-size: 0.78rem;
  }

  /* ——— Модалки и корзина ——— */
  .cart-drawer__close,
  .modal__close,
  .smart-filter__close {
    min-width: 44px;
    min-height: 44px;
  }

  .cart-drawer {
    max-height: 92dvh;
  }

  .order-form input,
  .order-form textarea,
  .order-form select {
    font-size: 16px;
    min-height: 44px;
  }

  .order-form label,
  .order-form__consent-text {
    font-size: 0.875rem;
  }

  .site-footer--compact .site-footer__tagline,
  .site-footer__tagline,
  .site-footer__links a {
    font-size: 0.875rem;
    line-height: 1.45;
  }

  .site-footer--compact .site-footer__tagline {
    margin: 0;
  }
}

.home-catalog-cta {
  display: none;
}

@media (min-width: 769px) {
  .header-action-btn__icon {
    display: none;
  }
}
