/* Mobile storefront: header, navigation and shared page rhythm. */
@media (max-width: 650px) {
  .hdr-row.wrap { column-gap: 6px; row-gap: 4px; padding-block: 6px 10px; }
  .hdr-row .avx-logo { margin-inline-end: auto; }
  .hdr-row .mobile-header-contacts { margin-inline-start: auto; gap: 0; }
  .hdr-row .mobile-header-contacts .mobile-header-messengers { gap: 0; }
  .hdr-row .mobile-header-contacts .mobile-header-messengers .msg-btn { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
  .hdr-row .hdr-search { gap: 8px; }
  .hdr-row .hdr-search input { height: 48px; padding-inline: 12px; border-width: 1px; font-size: 16px; }
  .hdr-row .hdr-search button[type="submit"] { height: 48px; min-width: 76px; padding-inline: 14px; font-size: 15px; }

  .mobile-dock { padding-inline: max(3px, env(safe-area-inset-left)) max(3px, env(safe-area-inset-right)); }
  .mobile-dock a { min-width: 0; gap: 2px; min-height: 60px; padding-block: 4px; font-size: clamp(10px, 2.9vw, 12px); touch-action: manipulation; }
  .mobile-dock a > :is(svg, .hdr-act__ic) { width: 38px; height: 29px; border-radius: 8px; margin: 0; }
  .mobile-dock a > svg { padding: 3px 8px; }
  .mobile-dock a > .hdr-act__ic { display: grid; place-items: center; }
  .mobile-dock a > .hdr-act__ic svg { width: 22px; height: 22px; }
  .mobile-dock a[aria-current] > :is(svg, .hdr-act__ic) { background: var(--red-tint); }
  .mobile-dock .hdr-badge { top: -2px; right: 0; }
  .mobile-dock a:focus-visible { outline-offset: -3px; border-radius: 8px; }

  .page--inner { padding-block: 16px 22px; }
  .page--inner > .wrap > .crumbs { margin-block: 0 10px; font-size: 13px; line-height: 1.4; }
  .page--inner > .wrap > .crumbs a { text-decoration: underline; text-underline-offset: 3px; }
  .page--inner .pg-title { font-size: clamp(23px, 5.7vw, 30px); line-height: 1.18; }
  .page--inner .pg-title > small { font-size: 14px; white-space: nowrap; }
  .page--inner :is(.pg-title, .sub-title) { text-wrap: balance; }
  .um-tools { gap: 8px; margin-block: 12px 16px; }
  .um-tools > .search-box { padding: 12px; border-radius: 12px; }
  .um-tools > .search-box > b { margin-bottom: 8px; font-size: 15px; }
  .um-tools .cat-find { gap: 7px; flex-wrap: wrap; }
  .um-tools .cat-find input { flex: 1 1 150px; min-width: 0; min-height: 44px; padding-inline: 10px; }
  .um-tools .cat-find button { min-height: 44px; padding-inline: 12px; }
  .um-tools .cat-find a { min-height: 44px; display: inline-flex; align-items: center; }
  .um-tools > .help-box { padding: 0; border: 0; box-shadow: none; background: transparent; }
  .um-tools > .help-box > b { display: none; }
  .um-tools > .help-box > .help-btn { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--red); font-size: 14px; box-shadow: none; }
  .um-tools > .help-box > .help-btn:active { background: var(--red-tint); }
  .page--inner .subnav a { min-height: 40px; display: inline-flex; align-items: center; gap: 4px; }
  .cat-layout__side summary { min-height: 44px; }
  .page--inner form.filters[action="/search"] { display: grid; gap: 6px; margin-block: 0 14px; }
  .page--inner form.filters[action="/search"] .filters__item { min-height: 44px; padding: 7px 12px; border-width: 1px; font-size: 14px; }
  .page--inner form.filters[action="/search"] .filters__sort select { width: 100%; max-width: none; height: 44px; border-width: 1px; font-size: 14px; }

  .cart-page .cart-empty { padding: 20px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
  .cart-page .cart-empty .btn-red { min-height: 46px; }
  .cart-page .order-form { padding: 16px; }
  .cart-page .order-form :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]) { min-height: 44px; }
  .auth-page .auth-form :is(.auth-submit, .pw-eye) { min-height: 44px; }
}
@media (max-width: 359px) {
  .hdr-row.wrap { column-gap: 4px; }
  .hdr-row:has(> .mobile-header-contacts) .avx-logo { font-size: 12.5px; }
  .hdr-row .mobile-header-contacts .mobile-header-phone { font-size: 10px; }
  .hdr-row .hdr-search button[type="submit"] { min-width: 68px; padding-inline: 10px; }
}
/* Главная на телефоне: автостёкла и быстрые переходы. */
@media (max-width: 650px) {
  body:has(> .hm-hero2) > .hm-main {
    --home-panel-radius: 14px;
    --home-panel-padding: clamp(12px, 3.4vw, 16px);
    padding-block: 14px 20px;
  }

  body:has(> .hm-hero2) > .hm-main > .wrap > .hm-glass {
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: start;
    gap: 5px 10px;
    margin-block: 0 12px;
    padding: 12px var(--home-panel-padding);
    border: 1px solid var(--line);
    border-radius: var(--home-panel-radius);
  }

  .hm-main .hm-glass__ic {
    inline-size: 38px;
    block-size: 38px;
    border-radius: 10px;
    background: var(--red-tint);
  }

  .hm-main .hm-glass__ic svg { inline-size: 22px; block-size: 22px; stroke: var(--red); }
  .hm-main .hm-glass__text { min-inline-size: 0; gap: 4px; }
  .hm-main .hm-glass__text b { font: 700 18px/1.2 var(--f-head); }
  .hm-main .hm-glass__text span { font: 400 14px/1.42 var(--f-body); text-wrap: pretty; }
  .hm-main .hm-glass__go { justify-self: start; margin-inline-start: 0; font: 700 14px/1.3 var(--f-body); }

  .hm-main .mobile-home-services[hidden] {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: var(--home-panel-radius);
    background: var(--white);
  }

  .hm-main .mobile-home-services > a {
    display: grid;
    align-items: center;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 10px;
    min-block-size: 50px;
    padding: 8px var(--home-panel-padding);
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    font: 700 15px/1.3 var(--f-body);
    overflow-wrap: anywhere;
  }

  .hm-main .mobile-home-services > a:first-child {
    border-start-start-radius: var(--home-panel-radius);
    border-start-end-radius: var(--home-panel-radius);
  }

  .hm-main .mobile-home-services > a + a { border-block-start: 1px solid var(--line); }
  .hm-main .mobile-home-services > a:last-child {
    border-end-start-radius: var(--home-panel-radius);
    border-end-end-radius: var(--home-panel-radius);
  }

  .hm-main .mobile-service-icon { border-radius: 9px; background: var(--red-tint); }
  .hm-main .mobile-home-services > a:focus-visible { outline-offset: -3px; }
  .hm-main .mobile-home-services > a:active { background: var(--red-soft); }
}

@media (440px <= width <= 650px) {
  .hm-main .mobile-home-services[hidden] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-main .mobile-home-services > a:nth-child(2) { border-end-start-radius: var(--home-panel-radius); }
  .hm-main .mobile-home-services > a:last-child {
    border-inline-start: 1px solid var(--line);
    border-end-start-radius: 0;
  }
}

@media (480px <= width <= 650px) {
  body:has(> .hm-hero2) > .hm-main > .wrap > .hm-glass {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
  }
  body:has(> .hm-hero2) .hm-main .hm-glass__go { grid-column: 3; }
}

@media (max-width: 650px) and (prefers-reduced-motion: reduce) {
  .hm-main .hm-glass { transition: none; }
}

@media (max-width: 650px) {
  .catalog-product-grid { gap: 10px; }
  .catalog-product-card__body { min-width: 0; padding: 12px; gap: 8px; }
  .catalog-product-card__name { font-weight: 700; overflow-wrap: anywhere; }
  .catalog-product-card .cpc-price .catalog-product-card__price {
    font-size: clamp(16px, 4.3vw, 20px);
    font-variant-numeric: tabular-nums;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .catalog-product-card .cpc-foot { align-items: center; }
  .catalog-product-card .cpc-foot .cart-btn { width: 44px; height: 44px; }

  :is(.catalog-product-card, .pcard) .vols > :is(a, b) {
    min-height: 36px;
    padding-inline: 9px;
  }
  :is(.catalog-product-card, .pcard) .vols > a:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 2px;
  }

  /* Строки результатов витрины. Другие списки с классом prow используют свою сетку. */
  .page--inner .plist > .prow:where(:has(> .prow-name[href^="/p/"])) {
    grid-template: "name name" "meta meta" "price arr" / minmax(0, 1fr) 44px;
    gap: 5px 10px;
    padding: 12px;
    align-items: center;
  }
  .page--inner .plist > .prow--img:where(:has(> .prow-name[href^="/p/"])) {
    grid-template: "img name name" "img meta meta" "price price arr" / 56px minmax(0, 1fr) 44px;
  }
  .page--inner .plist > .prow:where(:has(> .prow-name[href^="/p/"])):has(> .vols) {
    grid-template-areas: "name name" "meta meta" "vols vols" "price arr";
  }
  .page--inner .plist > .prow--img:where(:has(> .prow-name[href^="/p/"])):has(> .vols) {
    grid-template-areas: "img name name" "img meta meta" "vols vols vols" "price price arr";
  }
  .plist > .prow:where(:has(> .prow-name[href^="/p/"])) > .prow-name {
    font-weight: 700;
    line-height: 1.34;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .plist > .prow:where(:has(> .prow-name[href^="/p/"])) > .prow-meta {
    gap: 4px 8px;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .plist > .prow:where(:has(> .prow-name[href^="/p/"])) > .vols {
    grid-area: vols;
    position: relative;
    z-index: 1;
    margin-block: 3px;
  }
  .plist > .prow:where(:has(> .prow-name[href^="/p/"])) > .vols > :is(a, b) { min-height: 36px; }
  .plist > .prow:where(:has(> .prow-name[href^="/p/"])) > .prow-price {
    justify-self: start;
    font-size: 18px;
    font-variant-numeric: tabular-nums;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .plist > .prow:where(:has(> .prow-name[href^="/p/"])) > .prow-price small {
    display: block;
    margin-inline: 0;
    margin-top: 2px;
    line-height: 1.3;
  }
  .plist > .prow:where(:has(> .prow-name[href^="/p/"])) > i { justify-self: center; }

  .page--inner .pcard { gap: 18px; }
  .pcard .pcard-img {
    aspect-ratio: auto;
    min-width: 0;
    height: clamp(170px, 51vw, 230px);
    padding: 8px;
    border-radius: 14px;
  }
  .pcard-info { min-width: 0; }
  .pcard .pcard-info h1 {
    margin-bottom: 12px;
    font-size: clamp(21px, 5.6vw, 28px);
    line-height: 1.22;
  }
  .pcard .pcard-info dl {
    grid-template-columns: minmax(0, 104px) minmax(0, 1fr);
    gap: 7px 12px;
    margin-bottom: 14px;
    font-size: 14px;
    overflow-wrap: anywhere;
  }
  .pcard .pcard-buy { padding: 14px; gap: 12px; margin-bottom: 12px; border-radius: 14px; }
  .pcard .pcard-buy .pcard-price {
    font-size: clamp(23px, 6.3vw, 29px);
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .pcard .pcard-buy .buy-form {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
  }
  .pcard .pcard-buy .qty { border-width: 1px; height: 48px; }
  .pcard .pcard-buy .qty input { width: 33px; font-size: 16px; }
  .pcard .pcard-buy .qty-btn { width: 44px; }
  .pcard .pcard-buy :is(.btn-red, .pcard-cta) { min-height: 48px; padding-inline: 9px; }
  .pcard .pcard-more { display: grid; place-items: center; min-height: 44px; }
  .pcard .specs :is(th, td) { padding-inline: 6px; overflow-wrap: anywhere; }

  .page--inner .offers-box[data-mode="search"] { min-height: 0; }
  .page--inner .offers-box[data-mode="search"]:empty { display: none; }
  .page--inner .offers-box .offer {
    grid-template: "part part part" "stock days days" "price price buy" / minmax(0, 1fr) minmax(0, 1fr) 44px;
    gap: 6px 10px;
    padding: 12px;
  }
  .page--inner .offers-box .offer-main { grid-area: part; min-width: 0; overflow-wrap: anywhere; }
  .page--inner .offers-box .offer-stock { grid-area: stock; overflow-wrap: anywhere; }
  .page--inner .offers-box .offer-days { grid-area: days; overflow-wrap: anywhere; }
  .page--inner .offers-box .offer-price {
    grid-area: price;
    text-align: left;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
  }
  .page--inner .offers-box .offer-buy { grid-area: buy; }
  .page--inner .offers-box .offer-grp > summary {
    grid-template-columns: minmax(0, 1fr) minmax(0, auto) 18px;
    min-height: 56px;
    padding: 10px 12px;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 480px) {
  .catalog-product-grid { grid-template-columns: minmax(0, 1fr); }
  .catalog-product-grid .catalog-product-card {
    display: grid;
    grid-template-columns: clamp(76px, 24vw, 110px) minmax(0, 1fr);
  }
  .catalog-product-grid .catalog-product-card__visual {
    align-self: start;
    min-width: 0;
    aspect-ratio: 1;
    margin: 10px 0 10px 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
  }
  .catalog-product-grid .catalog-product-card__visual--empty { font-size: 12px; text-align: center; }
  .catalog-product-grid .catalog-product-card__name {
    display: block;
    min-height: 0;
    max-height: none;
    font-size: 15px;
    line-height: 1.31;
  }
}

@media (max-width: 650px) {
  body:has(> .hm-hero2) > main.hm-main { padding-block-start: 0; }

  .mobile-shop-hero[hidden] {
    display: block;
    padding-block: 24px;
    background-color: #25272b;
    background-image:
      linear-gradient(0deg, #16191ce0, #16191c24 88%),
      linear-gradient(90deg, #15171af7, #171a1db0 43%, #1b1e231a),
      url("/static/img/home/hero-warehouse-light-960.webp");
    background-position: center, center, right 55%;
    background-size: cover;
    color: var(--white);
  }

  .mobile-shop-hero .wrap { width: 100%; }
  .mobile-shop-hero h1 {
    margin: 0 0 14px;
    color: inherit;
    font: 800 clamp(29px, 9vw, 52px)/1.02 var(--f-head);
    letter-spacing: -.035em;
  }

  .mobile-shop-hero__map {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    min-height: 46px;
    gap: 12px;
    padding: 0 13px;
    border-radius: 9px;
    background: var(--red);
    color: var(--white);
    font: 700 15px var(--f-head);
  }
  .mobile-shop-hero__map:focus-visible { outline-color: var(--white); }

  .mobile-shop-hero__details {
    display: grid;
    gap: 10px;
    max-width: 340px;
    margin: 0 0 16px;
    color: #f4f5f6;
    font: 500 14px/1.4 var(--f-body);
  }
  .mobile-shop-hero__details dd {
    display: grid;
    grid-template-columns: 19px minmax(0, 1fr);
    align-items: start;
    gap: 9px;
    margin: 0;
    overflow-wrap: anywhere;
  }
  .mobile-shop-hero__details svg { color: #ffabab; }

  .mobile-shop-hero__details svg, .mobile-shop-hero__map svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  body:has(> .hm-hero2) > .hm-main > .wrap > .hm-glass { margin-block-start: 12px; }
}

@media (prefers-reduced-motion: no-preference) and (max-width: 650px) {
  .mobile-shop-hero > .wrap { animation: mobile-hero-in .32s ease-out both; }
  @keyframes mobile-hero-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

/* Мобильная витрина каталога. */
@media (max-width: 650px) {
  .page--inner > .wrap:has(> .mobile-catalog-shortcuts) > .crumbs { display: none; }

  main.page--inner > .wrap:has(> .mobile-catalog-shortcuts) > .mobile-parts-title {
    margin-block: 0 14px;
    padding: 0;
    font: 700 clamp(28px, 7vw, 36px)/1.04 var(--f-head);
    letter-spacing: -.025em;
  }

  main.page--inner > .wrap:has(> .mobile-catalog-shortcuts) > .mobile-parts-title::before {
    content: none;
  }

  .page--inner > .wrap > .mobile-catalog-shortcuts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .page--inner > .wrap > .mobile-catalog-shortcuts > a {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    min-block-size: 56px;
    gap: 6px;
    padding: 10px;
    font: 700 clamp(13px, 3.6vw, 16px)/1.2 var(--f-head);
  }

  .page--inner > .wrap > .mobile-catalog-shortcuts > a > svg {
    inline-size: 21px;
    block-size: 21px;
  }

  .mobile-catalog-shortcuts > a > span[aria-hidden] {
    font: 600 22px/1 var(--f-body);
  }

  .page--inner > .wrap > .mobile-catalog-shortcuts > a:first-child {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) 38px;
    align-items: end;
    gap: 16px;
    min-block-size: clamp(120px, 34vw, 175px);
    padding: 14px 14px 14px 18px;
    border: 0;
    border-radius: 16px;
    color: var(--white);
    background:
      linear-gradient(90deg, rgb(23 25 29 / 96%), rgb(23 25 29 / 70%) 43%, rgb(23 25 29 / 7%) 85%),
      var(--dark) url('/static/img/home/hero-three-vehicles.jpg') right 58% / cover no-repeat;
  }

  .mobile-catalog-shortcuts > a:first-child .mobile-shortcut-label {
    max-inline-size: 10ch;
    font-size: clamp(21px, 5.9vw, 32px);
    line-height: 1.05;
  }

  .mobile-catalog-shortcuts > a:first-child > svg {
    display: none;
  }

  .mobile-catalog-shortcuts > a:first-child > span[aria-hidden] {
    display: grid;
    place-items: center;
    inline-size: 38px;
    block-size: 38px;
    border-radius: 9px;
    background: var(--red);
    color: var(--white);
  }

  .page--inner > .wrap:has(> .mobile-catalog-shortcuts) > .mobile-goods-section {
    margin-block-start: 24px;
  }

  .page--inner > .wrap:has(> .mobile-catalog-shortcuts) .mobile-goods-section > .goods-grid--browse {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .page--inner > .wrap:has(> .mobile-catalog-shortcuts) .mobile-goods-section .goods-category-card {
    grid-template: "visual arrow" auto "copy copy" 1fr / minmax(0, 1fr) 14px;
    gap: 8px 6px;
    min-block-size: 98px;
    padding: 9px 10px 10px;
    border-radius: 13px;
    box-shadow: none;
  }

  .mobile-catalog-shortcuts ~ .mobile-goods-section .goods-category-card__visual {
    grid-area: visual;
    inline-size: 38px;
    block-size: 38px;
    border-radius: 8px;
    background: var(--red-tint);
  }

  .mobile-goods-section .goods-category-card .goods-category-card__visual > svg {
    inline-size: 25px;
    block-size: 25px;
  }

  .mobile-catalog-shortcuts ~ .mobile-goods-section .goods-category-card__copy {
    grid-area: copy;
    align-content: start;
    align-self: start;
    gap: 4px;
  }

  .mobile-catalog-shortcuts ~ .mobile-goods-section .goods-category-card.goods-card .goods-category-card__copy b {
    font-size: clamp(13px, 3.5vw, 17px);
    line-height: 1.22;
    overflow-wrap: break-word;
  }

  .mobile-catalog-shortcuts ~ .mobile-goods-section .goods-category-card__copy small {
    font-size: 12px;
  }

  .mobile-catalog-shortcuts ~ .mobile-goods-section .goods-category-card__arrow {
    grid-area: arrow;
    align-self: center;
  }

  .mobile-catalog-shortcuts ~ .mobile-goods-section .goods-category-card__arrow > svg {
    inline-size: 14px;
    block-size: 14px;
  }

  .mobile-catalog-shortcuts > a:active,
  .mobile-catalog-shortcuts ~ .mobile-goods-section .goods-category-card:active {
    transform: translateY(1px);
  }
}
