/* ==========
   1. Главная страница
   ========== */

body.home-page {
  background: radial-gradient(circle at top, #ecfdf3 0, #f9fafb 45%, #f1f5f9 100%);
}

.home-hero {
  padding: 28px 0 18px;
}

.home-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 26px;
  align-items: center;
}

.home-hero__title {
  font-size: 2.1rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.home-hero__subtitle {
  margin-top: 10px;
  font-size: 0.98rem;
  color: var(--sg-color-text-muted);
}

.home-hero__bullets {
  margin-top: 14px;
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
}

.home-hero__bullet {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.home-hero__bullet-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #ecfdf3;
  color: #15803d;
  font-size: 0.9rem;
}

.home-hero__aside {
  align-self: stretch;
}

.home-hero__card {
  background-color: #ffffff;
  border-radius: 18px;
  padding: 14px 14px 12px;
  box-shadow: var(--sg-shadow-soft);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.home-hero__card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.home-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #166534;
  font-size: 0.8rem;
}

.home-hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--sg-color-text-muted);
}

.home-hero__note {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--sg-color-text-muted);
}

/* Блок категорий на главной */

.home-categories {
  margin-top: 26px;
}

.home-categories__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.home-categories__title {
  font-size: 1.1rem;
  font-weight: 600;
}

.home-categories__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.home-categories__tab {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background-color: #ffffff;
  font-size: 0.8rem;
  color: var(--sg-color-text-muted);
}

.home-categories__tab--active {
  border-color: #22c55e;
  background-color: #ecfdf3;
  color: #166534;
}

/* ==========
   2. Листинг категории
   ========== */

body.listing-page {
  background-color: #f9fafb;
}

.listing-header {
  margin-bottom: 14px;
}

.listing-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.listing-title h1 {
  font-size: 1.6rem;
  font-weight: 700;
}

.listing-title__count {
  font-size: 0.85rem;
  color: var(--sg-color-text-muted);
}

.listing-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  justify-content: space-between;
  align-items: center;
}

.listing-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.listing-sort {
  font-size: 0.85rem;
  color: var(--sg-color-text-muted);
}

/* Верхний/нижний SEO-текст */

.listing-text {
  margin: 18px 0;
  font-size: 0.92rem;
  color: var(--sg-color-text);
}

.listing-text p + p {
  margin-top: 8px;
}

/* Пагинация */

.pagination {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  gap: 6px;
  font-size: 0.85rem;
}

.pagination__link {
  min-width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--sg-color-border);
  background-color: #ffffff;
}

.pagination__link--active {
  border-color: #16a34a;
  background-color: #ecfdf3;
  color: #166534;
  font-weight: 600;
}

/* ==========
   3. Карточка товара
   ========== */

body.product-page {
  background-color: #f9fafb;
}

.product-page .product__title {
  margin-bottom: 6px;
}

.product__rating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--sg-color-text-muted);
}

.product__rating-stars {
  display: inline-flex;
  gap: 2px;
  font-size: 0.9rem;
}

.product__price {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-size: 1.4rem;
  font-weight: 700;
}

.product__short-desc {
  font-size: 0.95rem;
  color: var(--sg-color-text-muted);
  margin-top: 6px;
}

/* Галерея на карточке */

.gallery__main {
  border-radius: 14px;
  overflow: hidden;
  background: radial-gradient(circle at 20% 0, #f1f5f9 0, #e5e7eb 40%, #d1d5db 100%);
  box-shadow: var(--sg-shadow-sm);
}

.gallery__image {
  width: 100%;
  height: 360px;
  object-fit: cover;
}

/* Дополнительные изображения (если будут) */

.gallery__thumbs {
  margin-top: 8px;
  display: flex;
  gap: 6px;
}

.gallery__thumb {
  flex: 0 0 60px;
  height: 60px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid transparent;
  cursor: pointer;
  opacity: 0.65;
}

.gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery__thumb--active {
  border-color: #22c55e;
  opacity: 1;
}

/* Блок «Преимущества» */

.product__highlights {
  margin-top: 10px;
}

.highlights__title {
  font-size: 1rem;
  margin-bottom: 8px;
}

.highlights__list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.highlight__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
}

/* Контент табов */

.product__full-desc {
  font-size: 0.95rem;
  color: var(--sg-color-text);
}

.product__full-desc h2 {
  font-size: 1.15rem;
  margin: 14px 0 6px;
}

.product__full-desc p + p {
  margin-top: 8px;
}

/* Блок отзывов */

.reviews__summary {
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.reviews__empty {
  padding: 10px 12px;
  border-radius: 10px;
  background-color: #f9fafb;
  border: 1px dashed rgba(226, 232, 240, 0.9);
  font-size: 0.9rem;
  color: var(--sg-color-text-muted);
}

/* Блок доставки */

.delivery-block {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
}

.delivery-block__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ==========
   4. Адаптив
   ========== */

@media (max-width: 960px) {
  .home-hero__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-hero__aside {
    order: -1;
  }
}

@media (max-width: 640px) {
  .home-hero {
    padding-top: 18px;
  }

  .home-hero__title {
    font-size: 1.7rem;
  }

  .gallery__image {
    height: 260px;
  }
}


/* ===== Gallery (radio) fix: CSS-only переключение ===== */

/* Прячем radio, но оставляем управление через label[for] */
.gallery__radio{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

/* По умолчанию прячем все изображения в стеке */
.gallery__images .gallery__image{
  display:none;
}

/* Показываем картинку, которая стоит сразу после выбранного radio */
.gallery__images .gallery__radio:checked + .gallery__image{
  display:block;
}

/* Подсветка активной миниатюры (если используете .thumb__label как label) */
.gallery__thumbs .thumb__label{
  flex: 0 0 60px;
  height: 60px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid transparent;
  cursor: pointer;
  opacity: .65;
  display: block;
}

.gallery__thumbs .thumb__label img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display:block;
}

/* Активная миниатюра: nth-child совпадает с порядком label */
.gallery__images .gallery__radio:nth-of-type(1):checked ~ .gallery__thumbs .thumb__label:nth-child(1),
.gallery__images .gallery__radio:nth-of-type(2):checked ~ .gallery__thumbs .thumb__label:nth-child(2),
.gallery__images .gallery__radio:nth-of-type(3):checked ~ .gallery__thumbs .thumb__label:nth-child(3),
.gallery__images .gallery__radio:nth-of-type(4):checked ~ .gallery__thumbs .thumb__label:nth-child(4),
.gallery__images .gallery__radio:nth-of-type(5):checked ~ .gallery__thumbs .thumb__label:nth-child(5),
.gallery__images .gallery__radio:nth-of-type(6):checked ~ .gallery__thumbs .thumb__label:nth-child(6){
  border-color:#22c55e;
  opacity:1;
}
