/* 1001 МЕЛОЧЬ | клиентский мобильный интерфейс v1.0
   Узкая область действия: только body.customer-mobile-v1; только смартфоны/планшеты.
   Десктопные стили, размеры изображений и бизнес-логика остаются прежними.
*/
.customer-mobile-nav { display: none; }

@media (max-width: 780px) {
  body.customer-mobile-v1 {
    width: 100%;
    min-width: 0;
    padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px));
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
  }
  body.customer-mobile-v1 :where(main, section, article, aside, .page, .panel, .card) { min-width: 0; }
  body.customer-mobile-v1 :where(img, video, iframe) { max-width: 100%; }
  body.customer-mobile-v1 :where(input, select, textarea) { font-size: max(16px, 1em); }
  body.customer-mobile-v1 :where(a, button, input, select, textarea):focus-visible {
    outline: 3px solid #ff7a00;
    outline-offset: 3px;
  }
  body.customer-mobile-v1 :where(.page-title, .section-title, h1, h2) { overflow-wrap: anywhere; }
  body.customer-mobile-v1 :where(.page, .wrap, .container) { max-width: 100%; }

  /* Нижняя навигация не зависит от скрывающейся шапки. */
  body.customer-mobile-v1 .customer-mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    min-height: calc(67px + env(safe-area-inset-bottom, 0px));
    padding: 5px max(4px, env(safe-area-inset-left, 0px)) calc(5px + env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-right, 0px));
    border-top: 1px solid rgba(255, 122, 0, .25);
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 -8px 24px rgba(44, 27, 12, .10);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
  body.customer-mobile-v1 .customer-mobile-nav a {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
    min-width: 0;
    min-height: 52px;
    padding: 4px 1px;
    border-radius: 12px;
    color: #57534f;
    text-decoration: none;
    text-align: center;
    font-family: Inter, Arial, sans-serif;
    font-size: 10px;
    line-height: 1.15;
    font-weight: 750;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
  }
  body.customer-mobile-v1 .customer-mobile-nav a[aria-current="page"] {
    background: #fff0df;
    color: #b95300;
  }
  body.customer-mobile-v1 .customer-mobile-nav .mobile-nav-icon {
    display: block;
    font-size: 20px;
    line-height: 1.1;
    font-weight: 600;
  }
  /* Баннер cookie перекрывает нижнюю навигацию при запросе согласия. */
  body.customer-mobile-v1 #site-cookie-reopen { bottom: calc(75px + env(safe-area-inset-bottom, 0px)); }
  body.customer-mobile-v1 #site-cookie-settings { z-index: 99999; }

  /* Главная и каталог: компактная шапка с рабочим поиском. */
  body.mobile-page-home .header-shell,
  body.mobile-page-products .header-shell {
    width: calc(100% - 12px);
    top: 0;
    margin: 0;
    max-width: none;
  }
  body.mobile-page-home .header,
  body.mobile-page-products .header { border-radius: 0 0 17px 17px; }
  body.mobile-page-home .header-top,
  body.mobile-page-products .header-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 9px 10px 10px;
  }
  body.mobile-page-home .brand-logo,
  body.mobile-page-products .brand-logo {
    display: block;
    width: min(226px, 70vw);
    max-height: 48px;
    object-fit: contain;
    object-position: left center;
  }
  body.mobile-page-home .header-actions,
  body.mobile-page-products .header-actions,
  body.mobile-page-home .header .nav,
  body.mobile-page-products .header .nav { display: none !important; }
  body.mobile-page-home .search,
  body.mobile-page-products .search { width: 100%; min-width: 0; }
  body.mobile-page-home .search input,
  body.mobile-page-products .search input {
    width: 100%;
    min-width: 0;
    height: 46px;
    padding: 0 106px 0 38px;
    border-radius: 13px;
    font-size: 16px;
  }
  body.mobile-page-home .search-button,
  body.mobile-page-products .search-button {
    min-width: 72px;
    height: 36px;
    padding: 0 10px;
    font-size: 12px;
    border-radius: 10px;
  }
  body.mobile-page-home .search-clear,
  body.mobile-page-products .search-clear { right: 83px; }
  body.mobile-page-home .page,
  body.mobile-page-products .page {
    width: calc(100% - 16px);
    padding-top: 145px;
  }
  body.mobile-page-home .hero,
  body.mobile-page-products .hero { margin-top: 5px; padding: 19px 16px; gap: 12px; min-height: 0; border-radius: 20px; }
  body.mobile-page-home .hero h1,
  body.mobile-page-products .hero h1 { font-size: clamp(28px, 8vw, 38px); letter-spacing: -.7px; line-height: 1.05; }
  body.mobile-page-home .hero p,
  body.mobile-page-products .hero p { font-size: 14px; line-height: 1.48; }
  body.mobile-page-home .hero-button,
  body.mobile-page-products .hero-button { width: 100%; min-height: 46px; margin-top: 14px; }
  body.mobile-page-home .hero-visual,
  body.mobile-page-products .hero-visual { min-height: 155px; }
  body.mobile-page-home .hero .toolbox,
  body.mobile-page-products .hero .toolbox { min-height: 140px; }
  body.mobile-page-home .section,
  body.mobile-page-products .section { margin-top: 20px; }
  body.mobile-page-home .section-head,
  body.mobile-page-products .section-head { gap: 6px; }
  body.mobile-page-home .section-title,
  body.mobile-page-products .section-title { font-size: clamp(19px, 5vw, 26px); }

  /* Товарные карточки: 2 колонки от 320 до 780px; фото строго квадратные. */
  body.mobile-page-home .products-grid,
  body.mobile-page-products .products-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px;
  }
  body.mobile-page-home .products-grid .product-card,
  body.mobile-page-products .products-grid .product-card {
    min-width: 0;
    padding: 9px;
    border-radius: 15px;
  }
  body.mobile-page-home .products-grid .product-image,
  body.mobile-page-products .products-grid .product-image {
    width: 100%;
    min-height: 0;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
  }
  body.mobile-page-home .products-grid .product-visual,
  body.mobile-page-products .products-grid .product-visual {
    width: 68px;
    height: 68px;
    max-width: 90%;
    max-height: 90%;
    font-size: 36px;
  }
  body.mobile-page-products .products-grid .product-image .product-photo {
    display: block;
    width: 100%;
    height: 100%;
    /* Не меняем исходное object-fit и индивидуальные transform. */
  }
  body.mobile-page-home .products-grid .product-name,
  body.mobile-page-products .products-grid .product-name {
    font-size: 13px;
    line-height: 1.3;
    min-height: 3.9em;
    overflow-wrap: anywhere;
  }
  body.mobile-page-home .products-grid .article,
  body.mobile-page-products .products-grid .article { font-size: 10px; overflow-wrap: anywhere; }
  body.mobile-page-home .products-grid .price,
  body.mobile-page-products .products-grid .price { font-size: 18px; white-space: normal; }
  body.mobile-page-home .products-grid .stock,
  body.mobile-page-products .products-grid .stock { font-size: 11px; }
  body.mobile-page-home .products-grid .product-actions,
  body.mobile-page-products .products-grid .product-actions { gap: 5px; margin-top: auto; padding-top: 8px !important; }
  body.mobile-page-home .products-grid .add-button,
  body.mobile-page-products .products-grid .add-button {
    min-height: 44px !important;
    height: auto !important;
    padding: 5px 3px;
    font-size: 12px;
    line-height: 1.2;
    border-radius: 10px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  body.mobile-page-home .products-grid .favorite,
  body.mobile-page-products .products-grid .favorite {
    flex: 0 0 36px !important;
    width: 36px;
    min-height: 44px;
    height: 44px !important;
    border-radius: 10px;
  }
  body.mobile-page-products .products-grid .product-card.hidden { display: none !important; }
  body.mobile-page-home .info-strip,
  body.mobile-page-products .info-strip { grid-template-columns: 1fr; gap: 10px; }
  body.mobile-page-products .categories { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  body.mobile-page-products .category { min-height: 70px; padding: 9px 7px; border-radius: 14px; }
  body.mobile-page-products .category-name { font-size: 12px; }
  body.mobile-page-products .subcategory-filter-row { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
  body.mobile-page-products .subcategory-filter-select { max-width: 100%; min-width: 0; }

  /* Карточка товара: одна колонка, квадратное фото и удобные кнопки. */
  body.mobile-page-product-detail .page { width: calc(100% - 16px); padding-top: 8px; }
  body.mobile-page-product-detail .header { flex-direction: row; align-items: center; padding: 11px; }
  body.mobile-page-product-detail .header .nav { display: none; }
  body.mobile-page-product-detail .brand img { width: min(205px, 65vw); height: auto; }
  body.mobile-page-product-detail .detail { grid-template-columns: minmax(0, 1fr); padding: 13px; gap: 14px; }
  body.mobile-page-product-detail .photo-wrap { width: 100%; min-height: 0; aspect-ratio: 1 / 1; }
  body.mobile-page-product-detail h1 { font-size: clamp(23px, 6.8vw, 31px); overflow-wrap: anywhere; }
  body.mobile-page-product-detail .add-button { width: 100%; min-height: 48px; }
  body.mobile-page-product-detail .information { min-width: 0; }

  /* Корзина и оформление заказа: прячем дубль навигации в шапке. */
  body.mobile-page-cart .header .nav,
  body.mobile-page-checkout .header .nav,
  body.mobile-page-rental-tools .header .nav { display: none; }
  body.mobile-page-cart .header-top,
  body.mobile-page-checkout .header-top,
  body.mobile-page-rental-tools .header-top { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; padding: 10px 12px; gap: 0; }
  body.mobile-page-cart .header-actions,
  body.mobile-page-checkout .header-actions,
  body.mobile-page-rental-tools .header-actions { display: none !important; }
  body.mobile-page-cart .brand-logo,
  body.mobile-page-checkout .brand-logo,
  body.mobile-page-rental-tools .brand-logo { width: min(210px, 65vw); max-height: 55px; object-fit: contain; }
  body.mobile-page-cart .header,
  body.mobile-page-checkout .header,
  body.mobile-page-rental-tools .header { border-radius: 17px; }
  body.mobile-page-cart .cart-layout,
  body.mobile-page-checkout .checkout-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  body.mobile-page-cart .cart-item { max-width: 100%; }
  body.mobile-page-cart .summary,
  body.mobile-page-checkout .summary { position: static; width: 100%; }
  body.mobile-page-checkout .form-grid { grid-template-columns: minmax(0, 1fr); }
  body.mobile-page-checkout .field.full { grid-column: 1; }
  body.mobile-page-checkout .payment-options { grid-template-columns: minmax(0, 1fr); }
  body.mobile-page-checkout :where(.submit-button,.checkout-button),
  body.mobile-page-cart :where(.checkout-button,.back-button) { min-height: 48px; width: 100%; }

  /* Аренда: компактные фильтры и удобная форма бронирования. */
  body.mobile-page-rental-tools .page { width: calc(100% - 14px); }
  body.mobile-page-rental-tools .header-shell { top: 5px; margin-top: 5px; }
  body.mobile-page-rental-tools main { padding-top: 16px; }
  body.mobile-page-rental-tools .hero { padding: 18px 14px; gap: 12px; }
  body.mobile-page-rental-tools .hero h1 { font-size: clamp(27px, 7.7vw, 37px); }
  body.mobile-page-rental-tools .hero-art { min-height: 150px; }
  body.mobile-page-rental-tools .tools { grid-template-columns: minmax(0, 1fr); }
  body.mobile-page-rental-tools .filters { grid-template-columns: minmax(0, 1fr); }
  body.mobile-page-rental-tools .modal { max-width: 100%; max-height: 88dvh; }
  body.mobile-page-rental-tools .actions { grid-template-columns: minmax(0, 1fr); }
  body.mobile-page-rental-tools .actions .btn { min-height: 45px; }

  /* Общие формы, аккаунт, поддержка и правовые страницы. */
  body.customer-mobile-v1 :where(.header-nav, .header-actions) { max-width: 100%; }
  body.customer-mobile-v1 :where(.form, .form-grid, .formgrid, .support-form) { min-width: 0; }
  body.customer-mobile-v1 :where(.form input, .form textarea, .form select, .field input, .field textarea, .field select) {
    max-width: 100%;
    min-width: 0;
  }
  body.customer-mobile-v1 :where(.policy-wrap, .main, .login-card, .register-card) { max-width: 100%; }
  body.customer-mobile-v1 footer { overflow-wrap: anywhere; }
}

@media (max-width: 370px) {
  body.customer-mobile-v1 .customer-mobile-nav a { font-size: 9px; }
  body.customer-mobile-v1 .customer-mobile-nav .mobile-nav-icon { font-size: 19px; }
  body.mobile-page-products .products-grid,
  body.mobile-page-home .products-grid { gap: 7px; }
  body.mobile-page-products .products-grid .product-card,
  body.mobile-page-home .products-grid .product-card { padding: 7px; }
  body.mobile-page-products .products-grid .price,
  body.mobile-page-home .products-grid .price { font-size: 17px; }
  body.mobile-page-products .products-grid .favorite,
  body.mobile-page-home .products-grid .favorite { width: 32px; flex-basis: 32px !important; }
}

@media (prefers-reduced-motion: reduce) {
  body.customer-mobile-v1 * { scroll-behavior: auto !important; }
}


/* MOBILE CATALOG v1.0.1 */
@media (max-width: 780px) {
    body.mobile-page-products .hero {
        display: none !important;
    }

    body.mobile-page-products #catalog {
        margin-top: 10px;
        scroll-margin-top: 140px;
    }

    body.mobile-page-products .categories {
        display: flex !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 9px;
        scroll-snap-type: x proximity;
        scrollbar-width: thin;
    }

    body.mobile-page-products .category {
        flex: 0 0 112px;
        min-height: 66px;
        padding: 8px 6px;
        scroll-snap-align: start;
    }

    body.mobile-page-products .category-name {
        font-size: 11px;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    body.mobile-page-products .subcategory-filter-row {
        margin-top: 8px;
    }
}


/* 1001 MOBILE POLISH v1.0.2 */
@media (max-width: 780px) {
  /* Перемещаем повторный вход в настройки cookie в конец страницы,
     чтобы он больше не перекрывал оплату, покупку и нижнее меню. */
  body.customer-mobile-v1 #site-cookie-reopen {
    position: static !important;
    inset: auto !important;
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    width: auto;
    max-width: calc(100% - 28px);
    margin: 10px 14px 18px;
    font-size: 11px;
    z-index: auto;
  }
  body.mobile-page-cart .item-image { overflow: hidden; }
  body.mobile-page-cart .item-image img.customer-cart-thumb {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 12px;
  }
  body.mobile-page-checkout .submit-button { margin-bottom: 12px; }
}


/* 1001 MOBILE FIXED HEADER v1.0.4 */
/* Desktop: no additional header or logo. */
.customer-mobile-unified-header,
.customer-mobile-sticky-brand-logo { display: none !important; }

@media (max-width: 780px) {
  /* All customer pages use the same fixed position at viewport top. */
  body.customer-mobile-v1 .page > .header,
  body.customer-mobile-v1 .page > .header-shell,
  body.customer-mobile-v1 > .header-shell {
    position: fixed !important;
    top: 0 !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: min(100% - 12px, 780px) !important;
    max-width: 780px !important;
    margin: 0 !important;
    z-index: 9500 !important;
    box-sizing: border-box;
  }

  /* Preserve original brand and search; make every header light and solid. */
  body.customer-mobile-v1 .page > .header,
  body.customer-mobile-v1 .page > .header-shell > .header,
  body.customer-mobile-v1 > .header-shell > .header {
    background: rgba(255, 253, 250, .98) !important;
    border: 1px solid rgba(255, 122, 0, .15) !important;
    border-radius: 0 0 18px 18px !important;
    box-shadow: 0 7px 24px rgba(66, 36, 17, .10) !important;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
  body.customer-mobile-v1 .page > .header {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    min-height: 74px;
    padding: 11px 14px !important;
    gap: 0 !important;
  }
  body.customer-mobile-v1 .page > .header .header-nav,
  body.customer-mobile-v1 .page > .header .nav,
  body.customer-mobile-v1 .page > .header-shell .header-back { display: none !important; }
  body.customer-mobile-v1 .page > .header :is(.brand-logo, .brand img),
  body.customer-mobile-v1 .page > .header-shell :is(.brand-logo, .brand img) {
    display: block;
    width: auto;
    max-width: min(218px, 72vw);
    max-height: 46px;
    height: auto;
    object-fit: contain;
    object-position: left center;
  }
  body.customer-mobile-v1:not(.mobile-page-home):not(.mobile-page-products)
    .page > .header-shell .header-top {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    min-height: 70px;
    padding: 10px 12px !important;
  }
  /* The original sticky header no longer takes up layout space. */
  body.customer-mobile-v1:not(.mobile-page-home):not(.mobile-page-products) .page {
    padding-top: 91px !important;
  }
  /* Home/catalog header includes the search field, so it needs more space. */
  body.mobile-page-home .page,
  body.mobile-page-products .page { padding-top: 145px !important; }
  body.mobile-page-home .header-shell,
  body.mobile-page-products .header-shell { top: 0 !important; }
  body.mobile-page-products #catalog { scroll-margin-top: 147px !important; }
  body.customer-mobile-v1 :where(section[id], article[id]) {
    scroll-margin-top: 100px;
  }

  /* Support conversation has a text badge on desktop; keep its logo on mobile. */
  body.mobile-page-support-detail .header .brand-mark,
  body.mobile-page-support-detail .header .brand-text { display: none !important; }
  body.mobile-page-support-detail .header .customer-mobile-sticky-brand-logo {
    display: block !important;
    width: auto;
    max-width: min(218px, 72vw);
    max-height: 46px;
    object-fit: contain;
  }

  /* Two standalone client pages previously had no shared store header. */
  body.customer-mobile-v1 .customer-mobile-unified-header {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: min(100% - 12px, 780px) !important;
    min-height: 74px;
    align-items: center;
    justify-content: flex-start;
    padding: 11px 14px;
    z-index: 9500;
    background: rgba(255, 253, 250, .98);
    border: 1px solid rgba(255, 122, 0, .15);
    border-radius: 0 0 18px 18px;
    box-shadow: 0 7px 24px rgba(66,36,17,.10);
    box-sizing: border-box;
  }
  body.customer-mobile-v1 .customer-mobile-unified-header img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(218px, 72vw);
    max-height: 46px;
    object-fit: contain;
  }
  body.mobile-page-privacy-policy { padding-top: 86px !important; }
  body.mobile-page-order-success { padding-top: 98px !important; }
}


/* 1001 MOBILE NON-OVERLAPPING SCROLL v1.0.5 */
/*
  A fixed header normally overlays scrolling document content.
  For customer pages with .page, scroll only the viewport area BETWEEN
  the fixed header and the fixed bottom navigation instead.
  This does not alter desktop layout or staff/admin templates.
*/
@media (max-width: 780px) {
  body.customer-mobile-v1:has(.page) {
    --customer-mobile-content-top: 94px;
    --customer-mobile-content-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  /* Home/catalog header has two rows (logo + search). */
  body.customer-mobile-v1.mobile-page-home:has(.page),
  body.customer-mobile-v1.mobile-page-products:has(.page) {
    --customer-mobile-content-top: 136px;
  }

  body.customer-mobile-v1 .page {
    position: fixed !important;
    top: var(--customer-mobile-content-top, 94px) !important;
    bottom: var(--customer-mobile-content-bottom, 70px) !important;
    left: 0 !important;
    right: 0 !important;
    width: calc(100% - 16px) !important;
    max-width: 780px !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 auto !important;
    padding-top: 8px !important;
    padding-bottom: 22px !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    scroll-padding-top: 8px;
  }

  /* Two standalone customer pages have a different content wrapper. */
  body.mobile-page-order-success,
  body.mobile-page-privacy-policy {
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding-top: 0 !important;
  }
  body.mobile-page-order-success .shell,
  body.mobile-page-privacy-policy .policy-wrap {
    position: fixed !important;
    top: 94px !important;
    bottom: calc(70px + env(safe-area-inset-bottom, 0px)) !important;
    left: 0 !important;
    right: 0 !important;
    width: calc(100% - 16px) !important;
    max-width: 780px !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 auto !important;
    padding: 8px 0 22px !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  /* The fixed header stays outside the scrollable content region visually. */
  body.customer-mobile-v1 .page > .header,
  body.customer-mobile-v1 .page > .header-shell,
  body.customer-mobile-v1 > .header-shell,
  body.customer-mobile-v1 .customer-mobile-unified-header {
    z-index: 9500 !important;
  }

  body.customer-mobile-v1 .customer-mobile-nav {
    z-index: 9000 !important;
  }

  /* Native smooth anchor navigation works inside the scroll region. */
  body.customer-mobile-v1 .page :where(section[id], article[id], main[id]) {
    scroll-margin-top: 12px !important;
  }
}


/* 1001 MOBILE v1.0.7: footer within mobile scroll container */
@media (max-width: 780px) {
  /* All page content AND legal footer share one scrollport between the bars. */
  body.customer-mobile-v1 .page > #site-legal-footer,
  body.customer-mobile-v1 .shell > #site-legal-footer,
  body.customer-mobile-v1 .policy-wrap > #site-legal-footer {
    display: block !important;
    position: relative !important;
    clear: both !important;
    width: 100% !important;
    margin: 28px 0 0 !important;
    z-index: auto !important;
  }
  body.customer-mobile-v1 .page {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,122,0,.30) transparent;
  }
}


/* 1001 MOBILE HEADER QUALITY v1.0.8 */
@media (max-width: 780px) {
  body:is(.mobile-page-cart, .mobile-page-checkout, .mobile-page-rental-tools, .mobile-page-login, .mobile-page-auth, .mobile-page-account-login, .mobile-page-profile-login)
  .page > .header-shell {
    padding-top: 0 !important;
  }

  body:is(.mobile-page-cart, .mobile-page-checkout, .mobile-page-rental-tools, .mobile-page-login, .mobile-page-auth, .mobile-page-account-login, .mobile-page-profile-login)
  .page > .header-shell .header-top {
    min-height: 91px !important;
    padding: 5px 12px !important;
    display: flex !important;
    align-items: center !important;
  }

  body:is(.mobile-page-cart, .mobile-page-checkout, .mobile-page-rental-tools, .mobile-page-login, .mobile-page-auth, .mobile-page-account-login, .mobile-page-profile-login)
  .page > .header-shell .brand-logo {
    display: block !important;
    width: min(238px, 67vw) !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: left center !important;
  }
}


/* 1001 MOBILE SHARP BRAND TEXT v1.0.12 */
@media (max-width: 780px) {
    body.customer-mobile-v1 .header a:has(> img[src*="logo_1001_header.png"]) {
        position: relative !important;
        isolation: isolate;
    }

    body.customer-mobile-v1 .header a:has(> img[src*="logo_1001_header.png"])::after {
        content: "ВСЁ ДЛЯ ВАШЕГО ДОМА И РЕМОНТА";
        position: absolute;
        left: 40px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 2;

        box-sizing: border-box;
        width: min(240px, calc(100vw - 85px));
        padding: 7px 3px;

        background: #ffffff;
        color: #45413e;

        font-family: Arial, sans-serif;
        font-size: 12px;
        font-weight: 800;
        line-height: 1.25;
        letter-spacing: 0;
        text-align: left;
        white-space: normal;
        text-decoration: none;
    }
}


/* 1001 MOBILE BRAND OVERLAP FIX v1.0.13 */
@media (max-width: 780px) {

  body.customer-mobile-v1:is(
    .mobile-page-cart,
    .mobile-page-rental-tools
  ) .header-top > a:has(> img.brand-logo) {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    flex: 0 1 315px !important;
    width: min(315px, 100%) !important;
    min-width: 0 !important;
    min-height: 52px !important;
    isolation: isolate;
  }

  body.customer-mobile-v1:is(
    .mobile-page-cart,
    .mobile-page-rental-tools
  ) .header-top > a:has(> img.brand-logo) > img.brand-logo {
    -webkit-clip-path: inset(0 calc(100% - 36px) 0 0) !important;
    clip-path: inset(0 calc(100% - 36px) 0 0) !important;
  }

  body.customer-mobile-v1:is(
    .mobile-page-cart,
    .mobile-page-rental-tools
  ) .header-top > a:has(> img.brand-logo)::after {
    left: 49px !important;
    top: 50% !important;
    width: min(250px, calc(100% - 55px)) !important;
    padding: 0 !important;
    background: transparent !important;
    color: #242424 !important;
    font-family: Arial, sans-serif !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
    letter-spacing: 0 !important;
    white-space: normal !important;
    text-align: left !important;
    transform: translateY(-50%) !important;
    z-index: 2 !important;
  }
}


/* 1001 MOBILE BRAND FIX v1.0.14 */
@media (max-width: 780px) {

  body.customer-mobile-v1:is(
    .mobile-page-cart,
    .mobile-page-rental-tools,
    [class*="login"],
    [class*="auth"]
  ) .header a:has(> img.brand-logo[src*="logo_1001_header.png"]) {
    position: relative !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    flex: 0 1 315px !important;
    width: min(315px, 100%) !important;
    min-width: 0 !important;
    min-height: 52px !important;
  }

  body.customer-mobile-v1:is(
    .mobile-page-cart,
    .mobile-page-rental-tools,
    [class*="login"],
    [class*="auth"]
  ) .header a:has(> img.brand-logo[src*="logo_1001_header.png"])
  > img.brand-logo {
    display: block !important;
    position: static !important;
    flex: 0 0 46px !important;
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    height: 46px !important;
    max-height: 46px !important;
    object-fit: cover !important;
    object-position: left center !important;
    clip-path: none !important;
    -webkit-clip-path: none !important;
  }

  body.customer-mobile-v1:is(
    .mobile-page-cart,
    .mobile-page-rental-tools,
    [class*="login"],
    [class*="auth"]
  ) .header a:has(> img.brand-logo[src*="logo_1001_header.png"])::after {
    content: "ВСЁ ДЛЯ ВАШЕГО ДОМА И РЕМОНТА" !important;
    position: static !important;
    display: block !important;
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    background: transparent !important;
    color: #242424 !important;
    font-family: Arial, sans-serif !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
    letter-spacing: 0 !important;
    text-align: left !important;
    white-space: normal !important;
    text-decoration: none !important;
    z-index: auto !important;
  }
}


/* 1001 MOBILE BRAND CLEANUP v1.0.15 */
@media (max-width: 780px) {

  body.customer-mobile-v1:is(
    .mobile-page-cart,
    .mobile-page-rental-tools,
    [class*="login"],
    [class*="auth"]
  ) .header a:has(> img.brand-logo[src*="logo_1001_header.png"]) {
    text-decoration: none !important;
  }

  /* Убираем остатки старой надписи из PNG */
  body.customer-mobile-v1:is(
    .mobile-page-cart,
    .mobile-page-rental-tools,
    [class*="login"],
    [class*="auth"]
  ) .header a:has(> img.brand-logo[src*="logo_1001_header.png"])
  > img.brand-logo {
    clip-path: inset(0 18px 0 0) !important;
    -webkit-clip-path: inset(0 18px 0 0) !important;
    margin-right: -18px !important;
  }

  /* Убираем подчёркивание надписи */
  body.customer-mobile-v1:is(
    .mobile-page-cart,
    .mobile-page-rental-tools,
    [class*="login"],
    [class*="auth"]
  ) .header a:has(> img.brand-logo[src*="logo_1001_header.png"])::after {
    text-decoration: none !important;
  }

  /* Скрываем полосы прокрутки, сохраняя прокрутку */
  html:has(> body.customer-mobile-v1:is(
    .mobile-page-cart,
    .mobile-page-rental-tools,
    [class*="login"],
    [class*="auth"]
  )) {
    scrollbar-width: none !important;
  }

  html:has(> body.customer-mobile-v1:is(
    .mobile-page-cart,
    .mobile-page-rental-tools,
    [class*="login"],
    [class*="auth"]
  ))::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
  }

  body.customer-mobile-v1:is(
    .mobile-page-cart,
    .mobile-page-rental-tools,
    [class*="login"],
    [class*="auth"]
  ),
  body.customer-mobile-v1:is(
    .mobile-page-cart,
    .mobile-page-rental-tools,
    [class*="login"],
    [class*="auth"]
  ) .page {
    scrollbar-width: none !important;
  }

  body.customer-mobile-v1:is(
    .mobile-page-cart,
    .mobile-page-rental-tools,
    [class*="login"],
    [class*="auth"]
  )::-webkit-scrollbar,
  body.customer-mobile-v1:is(
    .mobile-page-cart,
    .mobile-page-rental-tools,
    [class*="login"],
    [class*="auth"]
  ) .page::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
  }
}


/* 1001 MOBILE BRAND ICON ISOLATION v1.0.17 */
@media (max-width: 780px) {
  /* Only cart, login/auth, and tool rental. Keep the existing sharp text. */
  body.customer-mobile-v1:is(
    .mobile-page-cart,
    .mobile-page-rental-tools,
    [class*="login"],
    [class*="auth"]
  ) .header a:has(> img.brand-logo[src*="logo_1001_header.png"])
  > img.brand-logo {
    display: none !important;
  }

  body.customer-mobile-v1:is(
    .mobile-page-cart,
    .mobile-page-rental-tools,
    [class*="login"],
    [class*="auth"]
  ) .header a:has(> img.brand-logo[src*="logo_1001_header.png"])::before {
    content: "" !important;
    display: block !important;
    box-sizing: border-box !important;
    flex: 0 0 46px !important;
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    min-height: 46px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: url("logo_1001_mobile_icon_v117.9599565950c6.png") center / contain no-repeat !important;
    box-shadow: none !important;
    transform: none !important;
  }
}


/* 1001 UNIFIED CUSTOMER BRAND v1.0.19 — only explicitly marked customer headers */
@media (max-width: 780px) {
  header a#customer-mobile-brand-v119 {
    box-sizing: border-box !important;
    display: inline-flex !important;
    position: relative !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-direction: row !important;
    flex: 0 1 315px !important;
    gap: 8px !important;
    width: min(315px, 100%) !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 46px !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #242424 !important;
    text-decoration: none !important;
    isolation: isolate;
  }
  header a#customer-mobile-brand-v119 > img[src*="logo_1001_header.png"],
  header a#customer-mobile-brand-v119 > .brand-mark,
  header a#customer-mobile-brand-v119 > .brand-text {
    display: none !important;
  }
  header a#customer-mobile-brand-v119::before {
    content: "" !important;
    display: block !important;
    position: static !important;
    flex: 0 0 46px !important;
    box-sizing: border-box !important;
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    height: 46px !important;
    min-height: 46px !important;
    max-height: 46px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: url("logo_1001_mobile_icon_v117.9599565950c6.png") center / contain no-repeat !important;
    box-shadow: none !important;
    clip-path: none !important;
    -webkit-clip-path: none !important;
    transform: none !important;
  }
  header a#customer-mobile-brand-v119::after {
    content: "ВСЁ ДЛЯ ВАШЕГО ДОМА И РЕМОНТА" !important;
    display: block !important;
    position: static !important;
    flex: 1 1 auto !important;
    box-sizing: border-box !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    color: #242424 !important;
    font: 800 12px/1.25 Arial, sans-serif !important;
    letter-spacing: 0 !important;
    white-space: normal !important;
    text-align: left !important;
    text-decoration: none !important;
    text-shadow: none !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    box-shadow: none !important;
    transform: none !important;
    z-index: auto !important;
  }
}
