/* Страницы магазинов (QA 18.10.2026): адаптив без горизонтальных прокруток. Подключается только на шаблонах магазинов.
   Глобальный css2/style.css не трогаем — всё переопределяется здесь. */

/* 0. Контейнер: глобальное правило жмёт его до 300/460px с полями 11–20% */
@media (max-width:900px){
  body .container{max-width:none;width:100%;padding-left:12px;padding-right:12px;box-sizing:border-box}
  body .container .container{padding-left:0;padding-right:0}
}
/* 0.1 Резерв под РСЯ над контентом: без него заголовок прыгает (CLS) */
@media (max-width:900px){#yandex_rtb{min-height:250px}}
@media (min-width:901px){#yandex_rtb{min-height:180px}}

/* 1. Заголовки блоков: на телефоне/планшете не крупнее 22–26px */
@media (max-width:900px){
  h2.title.review__title,.tovar__title,.contact__text--title{font-size:26px;line-height:1.2}
}
@media (max-width:560px){
  h2.title.review__title,.tovar__title{font-size:22px}
}

/* 2. Плитки категорий магазина: 2 в ряд (≤560), 3 в ряд (561–900) */
@media (max-width:900px){
  .citywith__item--inner.pod_vsekategorii{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;align-items:stretch}
  .citywith__item--inner.pod_vsekategorii>:not(.rec__item){grid-column:1/-1}
  .citywith__item--inner.pod_vsekategorii>.rec__item{width:auto!important;max-width:none!important;margin:0!important;min-width:0;height:auto!important}
  .citywith__item--inner.pod_vsekategorii>.rec__item.itemfor3{display:block;padding:0}
  .rec__item.itemfor3 .pod_kategorii>a:not(:first-child),.rec__item.itemfor3 .pod_kategorii>p{display:none}
  .rec__item.itemfor3 .pod_kategorii>a:first-child{display:grid;grid-template-columns:36px minmax(0,1fr);align-items:center;gap:8px;padding:12px;min-height:64px;text-decoration:none}
  .rec__item.itemfor3 .product__name{order:2;margin:0;font-size:15px;line-height:1.2;overflow-wrap:break-word;hyphens:auto}
  .rec__item.itemfor3 .item__full--img--inner{order:1;width:36px;height:36px;margin:0;display:flex;align-items:center;justify-content:center}
  .rec__item.itemfor3 .item__full--img{max-width:32px;max-height:32px;width:auto;height:auto}
  .rec__item.itemfor3 .knop_smotri{display:none}
  .rec__item.itemfor3 .skrito_img,.rec__item.itemfor3 .vmesto_style2,.rec__item.itemfor3 .vmesto_style3{display:none}
  .rec__item.itemfor3 .pod_kategorii{margin:0;padding:0;min-height:0;height:auto}
  .citywith__item--inner.pod_vsekategorii>.rec__item.itemfor3{min-height:0}
}
@media (max-width:560px){
  .citywith__item--inner.pod_vsekategorii{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* 3. Карточки товаров: вертикальная плитка, 2 в ряд (≤560), 3 в ряд (561–900) */
@media (max-width:900px){
  .citywith__item--inner.pod_vsekategorii>.rec__item:not(.itemfor3){display:flex;flex-direction:column;justify-content:flex-start;padding:0 0 12px;overflow:hidden}
  .rec__item:not(.itemfor3) .book__wrapper{width:100%;display:flex;flex-direction:column}
  .rec__item:not(.itemfor3) .rec__item--wrapper{display:block;position:relative;width:100%}
  .rec__item:not(.itemfor3) .rec__item--img--inner{position:relative;width:100%;aspect-ratio:1/1;background:#f6f6f6;display:flex;align-items:center;justify-content:center;overflow:hidden;border-radius:20px 20px 0 0}
  .rec__item:not(.itemfor3) .rec__item--img--inner>a{display:flex;width:100%;height:100%;align-items:center;justify-content:center}
  .rec__item:not(.itemfor3) .rec__item--img{max-width:100%;max-height:100%;width:100%;height:100%;object-fit:contain}
  .rec__item:not(.itemfor3) .rec__item--logo{position:absolute;left:8px;top:8px;width:32px;height:32px;border-radius:50%}
  .rec__item:not(.itemfor3) .rec__item--content{display:flex;flex-direction:column;gap:2px;padding:8px 10px 0}
  .rec__item:not(.itemfor3) .rec__item--sale{position:static;display:inline-block;align-self:flex-start;font-size:15px;padding:4px 10px;border-radius:12px}
  .rec__item:not(.itemfor3) .good_date{margin:0;font-size:12px;line-height:1.3}
  .rec__item:not(.itemfor3) .rec__item--text{padding:6px 10px 0;font-size:14px;line-height:1.3;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
  .rec__item:not(.itemfor3) .rec__item--cart--inner{display:flex;flex-direction:column;align-items:stretch;gap:8px;width:100%;padding:8px 10px 0}
  .rec__item:not(.itemfor3) .rec__item--price--inner{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 8px}
  .rec__item:not(.itemfor3) .rec__item--price{margin:0;font-size:17px}
  .rec__item:not(.itemfor3) .rec__item--price--prev{margin:0;font-size:13px}
  .rec__item:not(.itemfor3) .cart__button{width:100%;min-height:40px;justify-content:center}
}

/* 4. «Города присутствия»: буквы — плитки 40px, города — колонки (без длинной ленты и без горизонтальной прокрутки) */
@media (max-width:900px){
  .city__wrapper{width:100%;max-width:none}
  .city__content{display:block}
  .city__wrapper--content{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-start;width:100%;max-width:none;height:auto;padding:0}
  .city__wrapper--item{flex:0 0 auto;width:auto!important;min-width:40px;height:40px;margin:0;padding:0 6px;display:flex;align-items:center;justify-content:center;font-size:16px;border-radius:10px;background:#f5f7fa;cursor:pointer}
  .city__wrapper--item.active{background:#ee555e;color:#fff}
  .city__values{width:100%}
  .city__item.active{display:block;column-count:2;column-gap:12px}
  .city__value{display:flex;align-items:center;min-height:40px;font-size:16px;line-height:1.25;break-inside:avoid;overflow-wrap:break-word}
}
@media (min-width:561px) and (max-width:900px){.city__item.active{column-count:3}}

/* 5. Мелочи: размеры текста, цели касания, картинки отзывов */
@media (max-width:900px){
  .good_date,.shops-promocode-label,.rec__item--price--prev{font-size:13px}
  span.tag.tag-red{font-size:12px}
  .rv-vote,.rv-dist,.rv-permalink,.rv-anchor__cta,.rv-anchor__score{display:inline-flex;align-items:center;min-height:40px}
  .user__image{object-fit:cover}
  .rec__item--cart--inner>a:first-child{display:block;padding:4px 0}
}

/* 6. «Похожие магазины» (slick-карусель) → сетка: без горизонтального пролистывания, все карточки видны */
.store__content .slick-list{overflow:visible!important;height:auto!important}
.store__content .slick-track{display:grid!important;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:12px;width:auto!important;max-width:100%;transform:none!important;height:auto!important;margin:0!important}
.store__content .slick-slide{width:auto!important;float:none!important;height:auto!important;min-width:0;margin:0!important}
.store__content .store__item,.store__content .store__item--wrapper{width:auto!important;max-width:100%;min-width:0;box-sizing:border-box}
.store__content .store__item--wrapper{margin-left:0!important;margin-right:0!important}
.store__content .slick-track::before,.store__content .slick-track::after{display:none!important;content:none!important}
.store .arrows__inner,.store .cityarrows__inner,.store .store__arrow{display:none!important}
.store__content .slick-cloned,.store__content .slick-arrow,.store__content .slick-dots{display:none!important}
@media (max-width:560px){.store__content .slick-track{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}}

/* 7. Каталоги-листовки на странице магазина в городе: 2–3 в ряд */
@media (max-width:900px){
  .book__content{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-items:start}
  .book__content .book__item{width:auto!important;max-width:none!important;margin:0!important;min-width:0}
  .book__content .book__item{align-self:stretch;padding:12px}
  .book__content .book__img--inner{top:0!important}
  .book__content .book__button--inner{margin-top:12px!important}
  .book__content .book__wrapper{display:flex;flex-direction:column;height:100%}
  .book__content .book__img--inner{display:block;position:relative;aspect-ratio:3/4;overflow:hidden;border-radius:12px}
  .book__content .book__img{width:100%;height:100%;object-fit:cover;display:block}
  .book__content .book__store--inner{font-size:14px;line-height:1.25;margin-top:8px}
  .book__content .book__button{font-size:16px;min-height:40px;display:flex;align-items:center;justify-content:center}
}
@media (max-width:560px){.book__content{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}}

/* 8. Страница адреса: вводный текст и список — нормальный размер и отступы */
@media (max-width:900px){
  .citylist__inner.flex100>.title__inner{margin-bottom:12px}
  .citylist__inner.flex100>p,.citylist__inner.flex100>li{font-size:15px!important;line-height:1.55!important;margin:0 0 8px;list-style:none}
  .citylist__inner.flex100:has(.address__content){font-size:15px;line-height:1.55}
  .address__info--item,.address__review--block{font-size:15px;line-height:1.5}
  .address__map,.address__map ymaps{min-height:280px}
}

/* 9. Страница города /gorod/<город>/: карточки магазинов города — сетка вместо одной колонки */
@media (max-width:900px){
  .promo__content.content{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-items:stretch}
  .promo__content .promo__item{width:auto!important;max-width:none!important;margin:0!important;min-width:0;display:flex;flex-direction:column}
  .promo__content .promo__item--img--inner{aspect-ratio:4/3;overflow:hidden}
  .promo__content .promo__item--img{width:100%;height:100%;object-fit:cover;display:block}
  .promo__content .promo__item--title{font-size:16px;line-height:1.25;margin-top:8px}
  .promo__content .promo__item--text{font-size:13px;margin:4px 0 8px}
  .promo__content .promo__item--button--inner{margin-top:auto}
  .promo__content .promo__item--button{min-height:40px;width:100%}
  .promo__content .promo__item--button--text{font-size:14px;line-height:1.2;margin:0;padding:0}
  .promo__content .promo__item--button--text a{font-size:14px!important;line-height:1.2;display:block;padding:8px 4px}
  .promo__content .promo__item--button{height:auto;padding:0}
}
@media (max-width:560px){.promo__content.content{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}}

/* 10. Главная: новости/статьи сеткой, блок «Наша статистика» плитками */
@media (max-width:900px){
  .container_news{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-items:stretch}
  .container_news>.card{width:auto!important;max-width:none!important;margin:0!important;min-width:0;display:flex;flex-direction:column;height:auto}
  .container_news .card__header{display:block;aspect-ratio:4/3;overflow:hidden}
  .container_news .card__image{width:100%!important;height:100%;object-fit:cover;display:block}
  .container_news .card__body{padding:10px 12px}
  .container_news .card__body>a{font-size:15px;line-height:1.3;display:block;margin:6px 0}
  .container_news .card__body p{font-size:13px;line-height:1.4;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
  .container_news .card__footer{margin-top:auto}
  .container_news .user__image{width:36px;height:36px;object-fit:contain}
  .why__logo--inner{display:none}
  .why__point--inner{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .why__point{display:block;background:#fff;border-radius:14px;padding:12px;width:auto;height:auto}
  .why__point *{font-size:inherit}
}
@media (max-width:560px){.container_news{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}}
@media (max-width:900px){.why__text-inner{margin-top:14px;font-size:15px;line-height:1.5}.why__text-inner *{font-size:inherit}}
@media (max-width:900px){.sub__title{font-size:22px;line-height:1.25}.container_news .card__body p{font-size:14px}}

/* 11. Тач-цели ≥40px: бейджи скидки, цена, хлебные крошки, ссылки футера */
@media (max-width:900px){
  .link__arrow.prev__link{display:inline-block;padding:12px 4px}
  .rec__item--content>a{display:inline-flex;align-items:center;min-height:40px}
  .rec__item--cart--inner>a:first-child{min-height:40px;display:flex;align-items:center}
  .footer__nav--link{display:inline-block;padding:10px 0}
}
.rec__item--img.is-broken{visibility:hidden}
@media (max-width:900px){#line-chart{max-width:100%!important;overflow:hidden}}

.dashicons-controls-forward,.dashicons-controls-back{max-width:100%;overflow:hidden}
span.dashicons{box-sizing:border-box}

/* 12. Тач-цели ≥40px: меню, футер, крошки, ссылки в карточках (глобально для страниц магазинов) */
@media (max-width:900px){
  .footer__nav--link,.footer__item--title,.footer__copy,.modal__nav--link,.header__enter,.breadcrumbs a,
  .promo__item--title,.store__item--text,.citystore__item,.contact__point .point-name,.shops-hub-goods-list a,.shops-vk-links a{display:inline-flex;align-items:center;min-height:44px}
  .promo__item--button--text a{display:flex;align-items:center;justify-content:center;min-height:40px;padding:0 6px!important}
  .rec__item--content .fav__button,.rec__item--content .copy__button{min-height:40px}
}
