/*
 * SWEB Market — витринные модули: слайдер, баннеры, бренды, категории в сайдбаре.
 */

.sw-home {
    padding-block: 16px 32px;
}

/* -------------------------------------------------------------- Слайдер -- */

.sw-slideshow {
    position: relative;
    border-radius: var(--sw-radius-lg);
    overflow: hidden;
}

.sw-slideshow .swiper-slide img {
    display: block;
    width: 100%;
    height: auto;
}

/* Точки Swiper перекрашиваем токенами вместо его синего по умолчанию. */
.sw-slideshow .swiper-pagination-bullet {
    width: 24px;
    height: 4px;
    border-radius: 2px;
    background: #fff;
    opacity: .5;
}

.sw-slideshow .swiper-pagination-bullet-active {
    opacity: 1;
    background: var(--sw-primary);
}

.sw-slideshow__nav {
    position: absolute;
    top: 50%;
    z-index: 5;
    display: none;
    width: 40px;
    height: 40px;
    transform: translateY(-50%);
    border: 0;
    border-radius: var(--sw-radius-pill);
    background: rgba(255, 255, 255, .85);
    color: var(--sw-ink);
    font-size: 1.125rem;
    line-height: 1;
    cursor: pointer;
}

.sw-slideshow__nav--prev { left: 12px; }
.sw-slideshow__nav--next { right: 12px; }

/* На телефоне листают пальцем, стрелки только закрывают картинку. */
@media (min-width: 768px) {
    .sw-slideshow__nav {
        display: block;
    }
}

/* -------------------------------------------------------------- Баннеры -- */

.sw-banners {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-block: var(--sw-section-gap);
}

.sw-banners__item {
    display: block;
    border-radius: var(--sw-radius-lg);
    overflow: hidden;
}

.sw-banners__item img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform var(--sw-transition);
}

.sw-banners__item:hover img {
    transform: scale(1.03);
}

/* --------------------------------------------------------------- Бренды -- */

.sw-brands {
    align-items: center;
    gap: 16px;
    margin-block: var(--sw-section-gap);
    padding: 12px 0;
}

.sw-brands__item {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 140px;
    height: 64px;
    padding: 8px;
    border: 1px solid var(--sw-border);
    border-radius: var(--sw-radius);
    background: var(--sw-surface);
}

.sw-brands__item img {
    max-height: 100%;
    width: auto;
    object-fit: contain;
    /* Логотипы приходят разноцветными и рябят в ряду. Обесцвечиваем
       до наведения — так ряд читается как единый блок. */
    filter: grayscale(1);
    opacity: .7;
    transition: filter var(--sw-transition-fast), opacity var(--sw-transition-fast);
}

.sw-brands__item:hover img {
    filter: none;
    opacity: 1;
}

/* ------------------------------------ Каталог категорий в боковой колонке -- */

/* Отдельный блок, а не модификатор .sw-sidecat: у простых списков в колонке
   (магазины, рубрики блога) нет ни аккордеона, ни разделителей, и общие
   правила пришлось бы половину времени отменять. */
.sw-catmenu {
    overflow: hidden;
    border-radius: var(--sw-radius-lg);
    background: var(--sw-surface);
}

.sw-catmenu__title {
    padding: 12px 20px;
    background: var(--sw-grey-light);
    color: var(--sw-ink);
    font-size: .9375rem;
    font-weight: 700;
}

:root[data-sw-theme="dark"] .sw-catmenu__title {
    background: var(--sw-border);
}

.sw-catmenu__list,
.sw-catmenu__children {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sw-catmenu__item {
    padding: 12px 12px 12px 20px;
    transition: background-color var(--sw-transition);
}

.sw-catmenu__item + .sw-catmenu__item {
    border-top: 1px solid var(--sw-grey-light);
}

/* Раскрытая ветка подсвечивается фоном — иначе на длинном списке не видно,
   где кончаются подкатегории одного раздела и начинается следующий. */
.sw-catmenu__item.is-open {
    background: var(--sw-bg);
}

.sw-catmenu__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sw-catmenu__link {
    color: var(--sw-ink);
    font-size: .875rem;
    font-weight: 500;
    line-height: 1.25;
}

.sw-catmenu__link:hover,
.sw-catmenu__link.is-active {
    color: var(--sw-primary);
}

.sw-catmenu__link.is-active {
    font-weight: 700;
}

.sw-catmenu__toggle {
    display: grid;
    flex: none;
    place-items: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: var(--sw-radius-sm);
    background: none;
    color: var(--sw-ink);
    cursor: pointer;
    transition: background-color var(--sw-transition-fast);
}

.sw-catmenu__item:hover .sw-catmenu__toggle {
    background: var(--sw-surface);
}

.sw-catmenu__toggle .sw-icon {
    width: 12px;
    height: 12px;
    transition: transform var(--sw-transition);
}

.sw-catmenu__toggle[aria-expanded="true"] .sw-icon {
    transform: rotate(90deg);
}

.sw-catmenu__sub {
    margin-top: 12px;
}

.sw-catmenu__children li + li {
    margin-top: 8px;
}

.sw-catmenu__children--deep {
    margin-top: 8px;
    padding: 4px 0 4px 12px;
    border-left: 1px solid var(--sw-border-strong);
}

.sw-catmenu__child {
    display: block;
    color: var(--sw-text-dim);
    font-size: .875rem;
    font-weight: 500;
    line-height: 1.3;
}

.sw-catmenu__child:hover,
.sw-catmenu__child.is-active {
    color: var(--sw-primary);
}

.sw-catmenu__child.is-active {
    font-weight: 700;
}

/* --------------------------------------------- Категории в боковой колонке -- */

.sw-sidecat {
    padding: 16px;
    border-radius: var(--sw-radius-lg);
    background: var(--sw-surface);
}

.sw-sidecat__lead {
    margin: 0 0 12px;
    color: var(--sw-text-muted);
    font-size: .8125rem;
}

.sw-sidecat__title {
    margin: 0 0 12px;
    font-size: 1rem;
}

.sw-sidecat__list,
.sw-sidecat__children {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sw-sidecat__children {
    margin: 4px 0 8px 12px;
    padding-left: 8px;
    border-left: 1px solid var(--sw-border);
}

.sw-sidecat__link {
    display: block;
    padding: 7px 0;
    color: var(--sw-text-dim);
    font-size: .875rem;
}

.sw-sidecat__link:hover {
    color: var(--sw-primary);
}

.sw-sidecat__link.is-active {
    color: var(--sw-primary);
    font-weight: 600;
}

/* --------------------------------------------------- Преимущества магазина -- */

.sw-advantages {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-block: var(--sw-section-gap);
}

@media (min-width: 768px) {
    .sw-advantages {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .sw-advantages {
        grid-template-columns: repeat(var(--sw-advantages-columns, 6), 1fr);
    }
}

.sw-advantages__item {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    border-radius: var(--sw-radius-lg);
    background: var(--sw-surface);
}

/* Иконка в плашке, а не голая: без подложки она теряется рядом с текстом
   и весь ряд выглядит как список, а не как набор карточек. */
.sw-advantages__icon {
    flex: none;
    width: 44px;
    height: 44px;
    padding: 10px;
    border-radius: var(--sw-radius);
    background: var(--sw-bg);
    color: var(--sw-ink);
    stroke-width: 1.5;
}

.sw-advantages__title {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
}

.sw-advantages__text {
    margin: 0;
    color: var(--sw-text-muted);
    font-size: .875rem;
    line-height: 1.45;
}

/* ------------------------------------------------------- Баннерное меню -- */

.sw-tiles {
    display: flex;
    gap: 12px;
    margin-block: var(--sw-section-gap);
    /* Лента, а не сетка: плиток бывает восемь и больше, и в сетке они
       уезжают на вторую строку, отодвигая товарные блоки за первый экран. */
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}

.sw-tiles::-webkit-scrollbar {
    display: none;
}

.sw-tiles__item {
    position: relative;
    flex: 0 0 auto;
    width: 168px;
    min-height: 190px;
    padding: 16px;
    border-radius: var(--sw-radius-lg);
    background: var(--sw-tile-bg, var(--sw-surface));
    overflow: hidden;
    scroll-snap-align: start;
}

@media (min-width: 768px) {
    .sw-tiles__item {
        width: 215px;
        min-height: 215px;
    }
}

/* Цвет плитки выбирает владелец магазина и рассчитывает на светлую
   подложку, поэтому текст фиксируем тёмным в обеих темах. */
.sw-tiles__item,
:root[data-sw-theme="dark"] .sw-tiles__item {
    color: #121715;
}

.sw-tiles__text {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sw-tiles__title {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.2;
}

.sw-tiles__subtitle {
    font-size: 1rem;
    font-weight: 500;
    opacity: .8;
}

.sw-tiles__image {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    width: 100%;
    /* Почти во всю плитку, как в референсе: картинка квадратная, и её ширину
       задаёт высота полосы — на половине высоты товар вставал столбиком
       посреди плитки. Сверху оставляем строку заголовка: у нас она крупнее
       референсной и на всю высоту товар заезжал под текст. */
    height: 80%;
    object-fit: contain;
    object-position: center bottom;
    transition: transform var(--sw-transition);
}

a.sw-tiles__item:hover .sw-tiles__image {
    transform: scale(1.05);
}

/* -------------------------------------------------------- Промо-баннеры -- */

.sw-promo {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin-block: var(--sw-section-gap);
}

@media (min-width: 768px) {
    .sw-promo {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.sw-promo__item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    min-height: 240px;
    padding: 24px;
    border-radius: var(--sw-radius-lg);
    /* Блик поверх заливки: плоский цвет на плитке в 600 пикселей выглядит
       залипшим, а мягкая подсветка под товаром собирает на нём взгляд. */
    background:
        radial-gradient(50% 50% at 80% 70%, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0)),
        var(--sw-promo-bg, #4a00a9);
    overflow: hidden;
}

/* Цвет плитки выбирает владелец магазина и берёт тёмный, поэтому текст
   фиксируем белым в обеих темах — как у баннерного меню, только наоборот. */
.sw-promo__item,
:root[data-sw-theme="dark"] .sw-promo__item {
    color: #fff;
}

.sw-promo__title {
    position: relative;
    z-index: 2;
    /* Ограничение по ширине, чтобы длинный заголовок не наезжал на товар. */
    max-width: 62%;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.25;
}

.sw-promo__cta {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: var(--sw-radius-pill);
    background: rgba(255, 255, 255, .12);
    font-size: .875rem;
    font-weight: 600;
    transition: background var(--sw-transition-fast);
}

a.sw-promo__item:hover .sw-promo__cta {
    background: rgba(255, 255, 255, .22);
}

/* Стрелка в кружке: отдельной иконки под это в спрайте нет, круг рисуем
   рамкой — так он остаётся одной толщины со штрихом самой стрелки. */
.sw-promo__cta-icon {
    width: 18px;
    height: 18px;
    padding: 3px;
    border: 1.5px solid currentColor;
    border-radius: var(--sw-radius-pill);
}

.sw-promo__image {
    position: absolute;
    right: 0;
    /* Ныряет за нижнюю кромку — плитка обрезает её своим overflow. */
    bottom: -48px;
    z-index: 1;
    width: 145px;
    height: auto;
    object-fit: contain;
    transition: transform var(--sw-transition);
}

a.sw-promo__item:hover .sw-promo__image {
    transform: scale(1.05);
}

/* -------------------------------------------------------- Главный слайдер -- */

.sw-hero {
    margin-block: 0 var(--sw-section-gap);
}

.sw-hero__swiper {
    position: relative;
    /* Обрезаем по контейнеру. С overflow: visible при включённом loop слайд
       выглядывает и слева тоже — активный перестаёт быть прижат к левому краю,
       и блок читается как съехавший, а не как листаемая лента. */
    overflow: hidden;
}

.sw-hero__slide {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 240px;
    padding: 24px;
    border-radius: var(--sw-radius-lg);
    background: var(--sw-hero-bg, #0b1425);
    color: #fff;
    overflow: hidden;
    height: auto;
}

@media (min-width: 768px) {
    .sw-hero__slide {
        min-height: 333px;
        padding: 40px;
    }
}

.sw-hero__text {
    position: relative;
    z-index: 2;
    max-width: 58%;
}

.sw-hero__title {
    margin: 0 0 12px;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .sw-hero__title {
        font-size: 1.5rem;
    }
}

.sw-hero__subtitle {
    margin: 0 0 24px;
    color: rgba(255, 255, 255, .72);
    font-size: 1rem;
}

@media (min-width: 768px) {
    .sw-hero__subtitle {
        margin-bottom: 32px;
        font-size: 1.25rem;
    }
}

.sw-hero__cta {
    position: relative;
    z-index: 3;
    min-width: 140px;
}

/* Слайд без кнопки кликается целиком. */
.sw-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.sw-hero__image {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 1;
    width: 42%;
    max-width: 220px;
    height: auto;
    object-fit: contain;
    object-position: right bottom;
}

@media (min-width: 768px) {
    .sw-hero__image {
        right: 40px;
        bottom: 50%;
        transform: translateY(50%);
    }
}

/* Точки внутри слайда слева снизу, как в референсе. */
.sw-hero__dots.swiper-pagination {
    position: absolute;
    left: 24px;
    bottom: 20px;
    width: auto;
    z-index: 4;
    display: flex;
    gap: 6px;
}

@media (min-width: 768px) {
    .sw-hero__dots.swiper-pagination {
        left: 40px;
        bottom: 32px;
    }
}

.sw-hero__dots .swiper-pagination-bullet {
    width: 18px;
    height: 4px;
    margin: 0;
    border-radius: 2px;
    background: rgba(255, 255, 255, .35);
    opacity: 1;
}

.sw-hero__dots .swiper-pagination-bullet-active {
    background: #fff;
}

.sw-hero__nav {
    position: absolute;
    top: 50%;
    z-index: 5;
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    transform: translateY(-50%);
    border: 0;
    border-radius: var(--sw-radius-pill);
    background: rgba(255, 255, 255, .16);
    color: #fff;
    cursor: pointer;
    transition: background-color var(--sw-transition-fast);
}

.sw-hero__nav:hover {
    background: rgba(255, 255, 255, .3);
}

.sw-hero__nav--prev {
    left: 24px;
    transform: translateY(-50%) rotate(180deg);
}

.sw-hero__nav--next {
    right: 24px;
}

@media (min-width: 768px) {
    .sw-hero__nav {
        display: flex;
    }
}

/* ------------------------------------------------ Первый экран главной -- */

.sw-home__hero {
    display: grid;
    /* minmax(0, 1fr), а не 1fr: у грид-элемента минимум по умолчанию —
       min-content, и лента плиток растягивала колонку до своей полной ширины.
       На телефоне главная уезжала вбок на 2800px. */
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    margin-bottom: var(--sw-section-gap);
}

@media (min-width: 992px) {
    .sw-home__hero {
        grid-template-columns: 330px minmax(0, 1fr);
        align-items: start;
    }
}

/* Панель каталога скрыта на узких экранах: там её роль выполняет бургер,
   а вертикальный список из десяти пунктов отодвинул бы слайдер за экран. */
.sw-catalog-panel {
    display: none;
    padding: 8px;
    border-radius: var(--sw-radius-lg);
    background: var(--sw-surface);
}

@media (min-width: 992px) {
    .sw-catalog-panel {
        display: block;
    }
}

.sw-catalog-panel__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sw-catalog-panel__item {
    position: relative;
}

.sw-catalog-panel__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    border-radius: var(--sw-radius);
    color: var(--sw-ink);
    font-size: .9375rem;
}

.sw-catalog-panel__item:hover > .sw-catalog-panel__link {
    background: var(--sw-bg);
    color: var(--sw-primary);
}

.sw-catalog-panel__link .sw-icon {
    width: 16px;
    height: 16px;
    opacity: .45;
}

/* Подменю выезжает поверх слайдера. Показываем по hover на всём пункте,
   а не на ссылке: между ссылкой и панелью есть зазор, и по ссылке одной
   меню закрывалось бы при попытке до него дотянуться. */
.sw-catalog-panel__flyout {
    position: absolute;
    top: 0;
    left: 100%;
    z-index: 20;
    display: none;
    min-width: 280px;
    max-height: 420px;
    padding: 12px;
    border-radius: var(--sw-radius-lg);
    background: var(--sw-surface);
    box-shadow: var(--sw-shadow-lg);
    overflow-y: auto;
}

.sw-catalog-panel__item:hover .sw-catalog-panel__flyout {
    display: block;
}

.sw-catalog-panel__flyout ul {
    margin: 0;
    padding: 0;
    list-style: none;
    columns: 2;
    column-gap: 20px;
}

.sw-catalog-panel__flyout a {
    display: block;
    padding: 6px 0;
    color: var(--sw-text-dim);
    font-size: .875rem;
    break-inside: avoid;
}

.sw-catalog-panel__flyout a:hover {
    color: var(--sw-primary);
}

/* Слайдер и плитки внутри правой колонки идут без внешних отступов сверху. */
.sw-home__stage > .sw-hero {
    margin-top: 0;
}

/* -------------------------------------------------------- Стена категорий -- */

.sw-catwall__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 768px) {
    .sw-catwall__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .sw-catwall__grid {
        grid-template-columns: repeat(var(--sw-catwall-columns, 4), 1fr);
    }
}

.sw-catwall__item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border-radius: var(--sw-radius-lg);
    background: var(--sw-surface);
    color: var(--sw-ink);
    text-align: center;
}

.sw-catwall__item:hover {
    color: var(--sw-primary);
}

.sw-catwall__image {
    width: 100%;
    /* Восемь разделов в ряд, как в референсе: карточка ужимается до ~150px,
       и картинка на 120px не оставляла места под название в две строки. */
    height: 80px;
    object-fit: contain;
    transition: transform var(--sw-transition);
}

.sw-catwall__item:hover .sw-catwall__image {
    transform: scale(1.05);
}

.sw-catwall__name {
    font-size: .9375rem;
    font-weight: 600;
    line-height: 1.3;
}

/* ------------------------------------------------ Товарные блоки с вкладками -- */

.sw-prodtabs__head {
    flex-wrap: wrap;
    gap: 12px 24px;
}

.sw-prodtabs__nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.sw-prodtabs__nav::-webkit-scrollbar {
    display: none;
}

.sw-prodtabs__tab {
    flex: none;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--sw-radius-pill);
    background: none;
    color: var(--sw-text-dim);
    font-size: .875rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--sw-transition-fast), color var(--sw-transition-fast);
}

.sw-prodtabs__tab:hover {
    color: var(--sw-primary);
}

.sw-prodtabs__tab.is-active {
    background: var(--sw-primary);
    color: #fff;
}

.sw-prodtabs__panel {
    display: none;
}

.sw-prodtabs__panel.is-active {
    display: block;
}

.sw-prodtabs__more {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.sw-prodtabs__more .sw-btn {
    min-width: 200px;
}

/* ------------------------------------------------------ Новости магазина -- */

.sw-news__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 768px) {
    .sw-news__grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
}

/* В боковой колонке (модули «Рекомендовані»/«Популярні статті») сетка на
   четыре колонки схлопывает карточки до нечитаемых столбиков: на неё есть
   260px. Там колонка одна. То же и для товарных модулей. */
.sw-column .sw-news__grid,
.sw-column .sw-grid {
    grid-template-columns: 1fr;
    gap: 12px;
}

/* Заголовок модуля в боковой колонке — подпись к списку, а не заголовок
   секции главной страницы; в исходном размере он перебивает H1 страницы. */
.sw-column .sw-section__title {
    font-size: 1rem;
}

.sw-column .sw-section {
    margin: 0;
}

.sw-news__item {
    display: flex;
    flex-direction: column;
    border-radius: var(--sw-radius-lg);
    background: var(--sw-surface);
    overflow: hidden;
}

.sw-news__image {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.sw-news__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--sw-transition);
}

.sw-news__item:hover .sw-news__image img {
    transform: scale(1.04);
}

.sw-news__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px 16px;
}

.sw-news__title {
    margin: 0;
    font-size: .9375rem;
    font-weight: 600;
    line-height: 1.35;
}

.sw-news__title a {
    color: var(--sw-ink);
}

.sw-news__title a:hover {
    color: var(--sw-primary);
}

.sw-news__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: auto;
    color: var(--sw-text-muted);
    font-size: .75rem;
}

/* ---------------------------------------------------------- О магазине -- */

.sw-about__box {
    position: relative;
    max-height: var(--sw-about-height, 220px);
    overflow: hidden;
    transition: max-height var(--sw-transition);
}

.sw-about__box.is-open {
    max-height: none;
}

.sw-about__text {
    max-width: none;
}

/* Затухание вместо резкого обреза: обрезанная на полуслове строка читается
   как баг вёрстки, а градиент — как «здесь есть продолжение». */
.sw-about__fade {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 80px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0), var(--sw-bg));
    pointer-events: none;
}

.sw-about__box.is-open .sw-about__fade {
    display: none;
}

.sw-about__toggle {
    margin-top: 12px;
}

/* ------------------------------------------------------------- Подписка -- */

.sw-subscribe {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: center;
    margin-block: var(--sw-section-gap);
    padding: 24px;
    border-radius: var(--sw-radius-lg);
    background: var(--sw-surface);
}

@media (min-width: 992px) {
    .sw-subscribe {
        grid-template-columns: 1fr minmax(360px, 480px);
        gap: 40px;
        padding: 32px 40px;
    }
}

.sw-subscribe__title {
    margin: 0 0 6px;
    font-size: 1.25rem;
}

.sw-subscribe__lead {
    margin: 0;
    color: var(--sw-text-muted);
    font-size: .9375rem;
}

.sw-subscribe__row {
    display: flex;
    gap: 8px;
}

.sw-subscribe__input {
    flex: 1;
    min-width: 0;
}

.sw-subscribe__agree {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    color: var(--sw-text-muted);
    font-size: .75rem;
    line-height: 1.4;
    cursor: pointer;
}

.sw-subscribe__agree input {
    margin-top: 2px;
    flex: none;
}

/* --------------------------------------------------- Отзывы о магазине -- */

.sw-storerev .sw-section__head {
    flex-wrap: wrap;
    gap: 12px 24px;
    align-items: center;
}

.sw-storerev__summary {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.sw-storerev__avg-label,
.sw-storerev__count {
    color: var(--sw-text-muted);
    font-size: .8125rem;
}

.sw-storerev__avg {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

/* Средние по критериям — одной строкой над лентой, как в референсе. */
.sw-storerev__criteria {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 24px;
    margin: 0 0 16px;
    padding: 16px 20px;
    border-radius: var(--sw-radius-lg);
    background: var(--sw-surface);
}

.sw-storerev__criterion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: .8125rem;
}

.sw-storerev__criterion dt {
    color: var(--sw-text-dim);
    font-weight: 400;
}

.sw-storerev__criterion dd {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.sw-storerev__bar {
    display: block;
    width: 60px;
    height: 4px;
    border-radius: 2px;
    background: var(--sw-border-strong);
    overflow: hidden;
}

.sw-storerev__bar > span {
    display: block;
    height: 100%;
    background: var(--sw-warning);
}

/* ------------------------------------------------------------ Раскладка -- */

.sw-storerev__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 1200px) {
    .sw-storerev__grid {
        /* 8/12 и 4/12, как на референсе. */
        grid-template-columns: 2fr 1fr;
        align-items: start;
    }
}

.sw-storerev__items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sw-storerev__item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: var(--sw-radius-lg);
    background: var(--sw-surface);
}

@media (min-width: 1200px) {
    .sw-storerev__item {
        padding: 24px;
    }
}

.sw-storerev__item-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Балл кружком слева от имени — это первое, что считывают в отзыве. */
.sw-storerev__score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: none;
    border-radius: var(--sw-radius-pill);
    background: var(--sw-warning);
    color: #121715;
    font-size: .9375rem;
    font-weight: 700;
}

.sw-storerev__author {
    font-weight: 600;
}

.sw-storerev__date {
    margin-left: auto;
    color: var(--sw-text-muted);
    font-size: .8125rem;
}

.sw-storerev__item-criteria {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: .8125rem;
}

.sw-storerev__item-criteria span {
    color: var(--sw-text-muted);
}

.sw-storerev__text {
    margin: 0;
    color: var(--sw-text-dim);
    font-size: .9375rem;
    line-height: 1.55;
}

/* Ответ администратора отбиваем полосой: без неё он читается как часть
   отзыва покупателя, и смысл переворачивается. */
.sw-storerev__reply {
    padding-left: 14px;
    border-left: 3px solid var(--sw-primary);
    color: var(--sw-text-dim);
    font-size: .875rem;
}

.sw-storerev__reply-title {
    display: block;
    margin-bottom: 4px;
    color: var(--sw-ink);
    font-weight: 600;
}

.sw-storerev__reply p {
    margin: 0;
}

/* --------------------------------------------------------------- Форма -- */

.sw-storerev__form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: var(--sw-radius-lg);
    background: var(--sw-surface);
}

@media (min-width: 1200px) {
    .sw-storerev__form {
        position: sticky;
        /* Отступ под липкую шапку, иначе форма уезжает под неё. */
        top: 92px;
        padding: 24px;
    }
}

.sw-storerev__form-title {
    margin: 0 0 4px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--sw-border);
    font-size: 1.0625rem;
}

.sw-storerev__form-hint,
.sw-storerev__form-note {
    margin: 0;
    color: var(--sw-text-muted);
    font-size: .75rem;
}

.sw-storerev__form-criterion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: .875rem;
}

/* --------------------------------------------------------- Звёзды формы -- */

.sw-stars {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: 2px;
}

.sw-stars input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.sw-stars label {
    cursor: pointer;
    color: var(--sw-grey);
    line-height: 0;
}

.sw-stars label .sw-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
}

/* Порядок в разметке обратный (5→1), поэтому «выбранная и все левее»
   выражается как «текущая и все последующие в документе». */
.sw-stars input:checked ~ label,
.sw-stars label:hover,
.sw-stars label:hover ~ label {
    color: var(--sw-warning);
}

.sw-stars input:checked + label .sw-icon,
.sw-stars input:checked ~ label .sw-icon,
.sw-stars label:hover .sw-icon,
.sw-stars label:hover ~ label .sw-icon {
    fill: var(--sw-warning);
}

.sw-stars input:focus-visible + label {
    outline: 2px solid var(--sw-primary);
    outline-offset: 2px;
}
