/* mr-path.css — правки под путь покупателя: навигация → выбор → покупка (18.11.2026).
   Только существующие токены сайта (design-system.css :root). Откат: убрать <link> из header.php. */

/* 1. Навигация: вход в кабинет виден в шапке на всех ширинах (раньше скрыт до 1279px). */
@media (max-width: 1279px) {
  .mr-global .g-header-actions > a[href="/account/"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* 2. Навигация: быстрые разделы каталога над первым экраном главной. */
.mr-quicknav {
  display: flex;
  gap: 8px;
  padding-block: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.mr-quicknav::-webkit-scrollbar { display: none; }
.mr-quicknav a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line, #e5e5e5);
  border-radius: var(--control-radius, 60px);
  background: var(--white, #fff);
  color: var(--ink, #171717);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}
.mr-quicknav a:hover { border-color: var(--ink, #171717); }
.mr-quicknav a:focus-visible { outline: 3px solid var(--ink, #171717); outline-offset: 2px; }
/* На ширине от 1280px разделы уже видны в основной навигации — полоса не нужна. */
@media (min-width: 1280px) {
  .mr-quicknav { display: none; }
}

/* 4. Выбор: строка фактов в карточке списка (ноутбук, объём, вес). */
.g-card-facts { margin: 4px 0 0; font-size: 13px; line-height: 1.4; color: var(--bp-muted, #555); }

/* 5. Навигация: на телефоне верхняя полоса в одну строку — объявление и телефон; соцсети — в мобильном меню (.mr-nav-socials). */
@media (max-width: 767px) {
  .mrbar .mrbar-socials { display: none; }
  .mrbar .mrbar-inner { grid-template-columns: minmax(0, 1fr) auto; }
  .mrbar .mrbar-carousel { grid-column: 1; grid-row: 1; width: 100%; margin: 0; border-top: 0; grid-template-columns: minmax(0, 1fr); }
  .mrbar .mrbar-slides { grid-column: 1; text-align: left; }
  .mrbar .mrbar-utilities { grid-column: 2; grid-row: 1; }
  .mrbar .mrbar-slide { min-height: 44px; padding-block: 0; justify-content: flex-start; }
  .mrbar .mrbar-slide a { justify-content: flex-start; }
}
.mr-nav-socials { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 16px 20px 24px; border-top: 1px solid var(--line, #e5e5e5); }
.mr-nav-socials a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; color: var(--bp-muted, #555); text-decoration: none; }
.mr-nav-socials a:hover { color: var(--ink, #171717); }
@media (min-width: 768px) { .mr-nav-socials { display: none; } }

/* 6. Выбор: ряд «В наличии» на главной стоит над слайдером — плотнее отступ сверху. */
.mr-home-instock { padding-top: 8px; }

/* 7. Покупка: служебные страницы модулей (возврат после оплаты Ozon Pay и т. п., data-page="service")
   выводят текст прямо в <body> без контейнера — даём ему ширину и поля .wrap. */
body[data-page="service"] > p { width: min(var(--max-width, 1400px), calc(100% - 96px)); margin: 40px auto; font-size: 16px; line-height: 1.5; }
@media (max-width: 767px) { body[data-page="service"] > p { width: calc(100% - 40px); margin-block: 24px; } }

/* 8. Покупка: «В корзину» в плитке от 768 px стоит по центру через translateX(-50%) (global.css),
   а отклик нажатия в brand-polish.css заменял его на scale(.97) — кнопка прыгала вправо на половину ширины.
   Сдвиг сохраняем, сжатие добавляем к нему. */
@media (min-width: 768px) {
  .g-card-cta:active { transform: translateX(-50%) scale(.97); }
}
@media (min-width: 768px) and (prefers-reduced-motion: reduce) {
  .g-card-cta:active { transform: translateX(-50%); }
}

/* 3. Снято 18.11 (решение координатора по B9, вариант В): фото в карточке на телефоне снова квадратное;
   кнопку покупки держит закреплённая панель #mr-buybar (проверено в headless Playwright 375×812). */

/* F1 (20.11, «Правки сайт» п. 10, 11): главная — баннер на первом экране, «В наличии» ниже; на десктопе 4 товара в ряд
   (в каждой подборке главной по 4 карточки: без одиночной карточки и пустого места справа). */
@media (min-width: 1024px) {
  body[data-page="home"] .g-product-grid, .mr-home-instock .g-product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}
.g-slideshow { margin-top: 8px; }

/* F1 (20.11, «Правки сайт» п. 2, 4, 5). Карточка товара в списках от 768 px: кнопка «В корзину» всегда видна и стоит в своей полосе под фото
   (раньше — на фото, невидима до наведения и перекрывала предмет); фото не вылезает за свой квадрат. */
@media (min-width: 768px) {
  .mr-global .g-card .product-picture { overflow: visible; aspect-ratio: auto; padding-bottom: 56px; }
  .mr-global .g-card .product-picture > a:first-child { aspect-ratio: 1; height: auto; overflow: hidden; }
  .mr-global .g-card .product-picture > .g-card-cta { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); opacity: 1; width: max-content; max-width: calc(100% - 24px); min-height: 44px; }
}
/* п. 5: масштаб предмета в кадре выровнен (доля предмета в квадрате ≈ 0,78; замер по файлам фото 20.11, scale_before.json);
   новые товары без записи показываются без поправки. */
.product-card[data-product-id="c79744ca-77b6-11ee-8125-000c298d7c43"] .product-picture>a:first-child img{scale:1.083}
.product-card[data-product-id="42d4fdfa-7a29-11ee-8125-000c298d7c43"] .product-picture>a:first-child img{scale:0.975}
.product-card[data-product-id="439d3a23-7a29-11ee-8125-000c298d7c43"] .product-picture>a:first-child img{scale:1.120}
.product-card[data-product-id="4403be74-7a29-11ee-8125-000c298d7c43"] .product-picture>a:first-child img{scale:1.120}
.product-card[data-product-id="4422cd1c-7a29-11ee-8125-000c298d7c43"] .product-picture>a:first-child img{scale:1.120}
.product-card[data-product-id="444da196-7a29-11ee-8125-000c298d7c43"] .product-picture>a:first-child img{scale:0.850}
.product-card[data-product-id="448e1389-7a29-11ee-8125-000c298d7c43"] .product-picture>a:first-child img{scale:0.929}
.product-card[data-product-id="448e16ae-7a29-11ee-8125-000c298d7c43"] .product-picture>a:first-child img{scale:0.907}
.product-card[data-product-id="448e16af-7a29-11ee-8125-000c298d7c43"] .product-picture>a:first-child img{scale:0.857}
.product-card[data-product-id="448e16c3-7a29-11ee-8125-000c298d7c43"] .product-picture>a:first-child img{scale:0.857}
.product-card[data-product-id="448e16d6-7a29-11ee-8125-000c298d7c43"] .product-picture>a:first-child img{scale:0.850}
.product-card[data-product-id="45481ac9-7a29-11ee-8125-000c298d7c43"] .product-picture>a:first-child img{scale:1.120}
.product-card[data-product-id="45bf5079-7a29-11ee-8125-000c298d7c43"] .product-picture>a:first-child img{scale:1.114}
.product-card[data-product-id="45fd339a-7a29-11ee-8125-000c298d7c43"] .product-picture>a:first-child img{scale:1.120}
.product-card[data-product-id="46937f06-7a29-11ee-8125-000c298d7c43"] .product-picture>a:first-child img{scale:1.120}
.product-card[data-product-id="46b98c8f-7a29-11ee-8125-000c298d7c43"] .product-picture>a:first-child img{scale:1.068}
.product-card[data-product-id="ab721fde-8aa3-11ee-8126-000c298d7c43"] .product-picture>a:first-child img{scale:1.026}
.product-card[data-product-id="a01b033c-2e2a-11ef-812c-000c298d7c43"] .product-picture>a:first-child img{scale:1.026}
.product-card[data-product-id="cc7f8b64-2e2a-11ef-812c-000c298d7c43"] .product-picture>a:first-child img{scale:1.026}
.product-card[data-product-id="4757e6c0-2e2b-11ef-812c-000c298d7c43"] .product-picture>a:first-child img{scale:1.120}
.product-card[data-product-id="5ba83c49-2e2b-11ef-812c-000c298d7c43"] .product-picture>a:first-child img{scale:1.099}
.product-card[data-product-id="2ea76483-4271-11ef-812e-000c298d7c43"] .product-picture>a:first-child img{scale:1.026}
.product-card[data-product-id="5227a431-4271-11ef-812e-000c298d7c43"] .product-picture>a:first-child img{scale:1.083}
.product-card[data-product-id="754d9dfb-4271-11ef-812e-000c298d7c43"] .product-picture>a:first-child img{scale:1.026}
.product-card[data-product-id="94d69110-4271-11ef-812e-000c298d7c43"] .product-picture>a:first-child img{scale:1.120}
.product-card[data-product-id="1cdc2773-4273-11ef-812e-000c298d7c43"] .product-picture>a:first-child img{scale:0.850}
.product-card[data-product-id="7e10d550-4273-11ef-812e-000c298d7c43"] .product-picture>a:first-child img{scale:0.850}
.product-card[data-product-id="99dba5f3-4273-11ef-812e-000c298d7c43"] .product-picture>a:first-child img{scale:0.850}
.product-card[data-product-id="9c20a964-651b-11ef-812f-000c298d7c43"] .product-picture>a:first-child img{scale:1.120}
.product-card[data-product-id="f0c4feaf-e091-11ef-813a-000c298d7c43"] .product-picture>a:first-child img{scale:0.857}
.product-card[data-product-id="f2e30185-2a56-11f0-8141-000c298d7c43"] .product-picture>a:first-child img{scale:0.850}
.product-card[data-product-id="ff13f2d9-2a56-11f0-8141-000c298d7c43"] .product-picture>a:first-child img{scale:0.857}
.product-card[data-product-id="0fb93b81-2a57-11f0-8141-000c298d7c43"] .product-picture>a:first-child img{scale:0.850}
.product-card[data-product-id="1f2c457f-2a57-11f0-8141-000c298d7c43"] .product-picture>a:first-child img{scale:0.867}
.product-card[data-product-id="901937bb-7c1f-11f0-8149-000c298d7c43"] .product-picture>a:first-child img{scale:1.026}
.product-card[data-product-id="9efa4698-7c1f-11f0-8149-000c298d7c43"] .product-picture>a:first-child img{scale:1.026}
.product-card[data-product-id="ac76b1c1-7c1f-11f0-8149-000c298d7c43"] .product-picture>a:first-child img{scale:1.026}
.product-card[data-product-id="ddaab3f0-7c1f-11f0-8149-000c298d7c43"] .product-picture>a:first-child img{scale:0.963}
.product-card[data-product-id="f5a9ec05-7c1f-11f0-8149-000c298d7c43"] .product-picture>a:first-child img{scale:1.068}
.product-card[data-product-id="005201b5-7c20-11f0-8149-000c298d7c43"] .product-picture>a:first-child img{scale:0.907}
.product-card[data-product-id="e4b27eb2-8d68-11f0-8149-000c298d7c43"] .product-picture>a:first-child img{scale:1.120}
.product-card[data-product-id="0046645e-8d69-11f0-8149-000c298d7c43"] .product-picture>a:first-child img{scale:0.963}
.product-card[data-product-id="b51833c5-43b0-11f1-815b-000c298d7c43"] .product-picture>a:first-child img{scale:0.897}
.product-card[data-product-id="e89e2f53-43b0-11f1-815b-000c298d7c43"] .product-picture>a:first-child img{scale:0.975}
.product-card[data-product-id="fe293628-43b0-11f1-815b-000c298d7c43"] .product-picture>a:first-child img{scale:0.867}
.product-card[data-product-id="186c2f6a-43b1-11f1-815b-000c298d7c43"] .product-picture>a:first-child img{scale:0.951}
.product-card[data-product-id="ca83992e-60ce-11f1-815d-000c298d7c43"] .product-picture>a:first-child img{scale:0.907}
.product-card[data-product-id="2e11c212-60cf-11f1-815d-000c298d7c43"] .product-picture>a:first-child img{scale:1.054}
.product-card[data-product-id="7e3ba3e0-60cf-11f1-815d-000c298d7c43"] .product-picture>a:first-child img{scale:0.940}
.product-card[data-product-id="e60a488e-9a58-11f1-8160-000c298d7c43"] .product-picture>a:first-child img{scale:1.054}
.product-card[data-product-id="fdb53139-9a58-11f1-8160-000c298d7c43"] .product-picture>a:first-child img{scale:1.068}
.product-card[data-product-id="4386d54b-9a59-11f1-8160-000c298d7c43"] .product-picture>a:first-child img{scale:1.040}
.product-card[data-product-id="5f805867-9a59-11f1-8160-000c298d7c43"] .product-picture>a:first-child img{scale:1.054}
.product-card[data-product-id="80f996c9-9a59-11f1-8160-000c298d7c43"] .product-picture>a:first-child img{scale:1.068}
.product-card[data-product-id="dd12f659-9b39-11f1-8160-000c298d7c43"] .product-picture>a:first-child img{scale:0.897}
.product-card[data-product-id="3eac6eb0-aa88-11f1-8162-000c298d7c43"] .product-picture>a:first-child img{scale:1.068}
.product-card[data-product-id="ca420770-bca5-11f1-8164-000c298d7c43"] .product-picture>a:first-child img{scale:0.951}
.product-card[data-product-id="d1d201d0-7c1f-11f0-8149-000c298d7c43"] .product-picture>a:first-child img{scale:0.867}
/* п. 2 (телефон): главное фото товара 4:3 вместо квадрата — кнопка «Купить» целиком на первом экране 375×812 */
@media (max-width: 767px) {
  .g-product .main-photo { aspect-ratio: 4 / 3; }
  .g-product .main-photo img { object-fit: contain; }
}

/* F1 п. 4/5 (телефон): кнопка плитки вплотную под фото (было: bottom 8 px → заходила на фото на 8 px); фото обрезается по своему квадрату. */
.mr-global .g-card .product-picture > a:first-child { overflow: hidden; }
@media (max-width: 767px) {
  .mr-global .g-card .product-picture > .g-card-cta { bottom: 0; }
}

/* A1d (20.11): баннер cookies на телефоне занимал 193 px и закрывал «Оформить с Яндекс ID / без входа» на /cart/ (замер 375×812: баннер 607–800,
   кнопки 603–655 и 679–732). Компактный вид ≤767 px: текст в 2–3 строки, «Принять» и закрытие в одной строке, ≈ 100 px;
   на /cart/ и /checkout/ баннер не фиксируется поверх содержимого, а стоит в потоке под ним. */
@media (max-width: 767px) {
  .mr-cookie { padding: 10px 12px; gap: 8px; font-size: 12px; line-height: 1.35; }
  .mr-cookie p { flex: 1 1 100%; }
  .mr-cookie .btn { min-height: 40px; padding: 8px 16px; flex: 1; }
  body[data-page="cart"] .mr-cookie, body[data-page="checkout"] .mr-cookie { position: static; margin: 12px; box-shadow: none; }
}
/* A1d: тот же блок с повышенной специфичностью (inline-стиль баннера в analytics_body.php стоит в body и перебивал правила выше). */
@media (max-width: 767px) {
  body.mr-global .mr-cookie { padding: 10px 12px; gap: 8px; font-size: 12px; line-height: 1.35; }
  body.mr-global .mr-cookie p { flex: 1 1 100%; }
  body.mr-global .mr-cookie .btn { min-height: 40px; padding: 8px 16px; flex: 1; }
}

/* A1d, задание 1 (20.11, координатор): на телефоне баннер cookies не перекрывает «Купить» на карточке товара —
   на карточках товара, в корзине и оформлении он стоит в потоке страницы (под содержимым), а не fixed поверх. Текст и логика согласия не менялись. */
@media (max-width: 767px) {
  body[data-page^="products/"] .mr-cookie { position: static; margin: 12px; box-shadow: none; }
}
