/* ===== ШРИФТ =====
   Noto Serif лежит у нас, а не подгружается с серверов Google: так сайт не
   зависит от доступности чужого сервиса и не передаёт туда IP посетителей.
   Лицензия SIL Open Font License 1.1 — использование, в том числе
   коммерческое, и размещение у себя разрешены.
   Наборы символов: кириллица и латиница. Греческий, вьетнамский и
   математические знаки не качаем — на русском сайте они не нужны. */

/* cyrillic-ext */
@font-face {
  font-family: 'Noto Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/noto-serif-cyrillic-ext-400.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* cyrillic */
@font-face {
  font-family: 'Noto Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/noto-serif-cyrillic-400.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* latin-ext */
@font-face {
  font-family: 'Noto Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/noto-serif-latin-ext-400.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Noto Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/noto-serif-latin-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* cyrillic-ext */
@font-face {
  font-family: 'Noto Serif';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/noto-serif-cyrillic-ext-700.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* cyrillic */
@font-face {
  font-family: 'Noto Serif';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/noto-serif-cyrillic-700.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* latin-ext */
@font-face {
  font-family: 'Noto Serif';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/noto-serif-latin-ext-700.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Noto Serif';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/noto-serif-latin-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ===== RESET ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  overflow-wrap: break-word;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #111;
  background: #fff;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ===== CONTAINER ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== HEADER ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  transition: box-shadow 0.4s ease;
}

.header.scrolled {
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.07);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-family: "Noto Serif", Georgia, "Times New Roman", serif;
}

.nav {
  display: flex;
  gap: 32px;
  margin-left: auto;
  margin-right: 24px;
}

.nav a {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  padding: 4px 0;
}

.nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: #111;
  transition: width 0.3s ease;
}

.nav a:hover::after,
.nav a.active::after {
  width: 100%;
}

/* ===== BURGER ===== */
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
}

.burger span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: #111;
  transition: all 0.3s ease;
}

.burger.active span:nth-child(1) {
  transform: rotate(45deg) translate(4.5px, 4.5px);
}

.burger.active span:nth-child(2) {
  opacity: 0;
}

.burger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(4.5px, -4.5px);
}

/* ===== MOBILE NAV ===== */
.mobile-nav {
  display: none;
  position: fixed;
  top: 80px;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

.mobile-nav.active {
  display: flex;
}

.mobile-nav a {
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== MAIN ===== */
.main {
  padding-top: 80px;
  min-height: calc(100vh - 200px);
}

/* ===== HERO ===== */
/* ===== ГЛАВНАЯ: ВСТУПЛЕНИЕ ===== */
/* Узкая полоса в самом верху: название между двумя линиями и строка о том, чем
   мы занимаемся. Логотип-картинку здесь не ставим — он уже есть в шапке, два
   логотипа подряд читались бы как повтор. */
.home-intro {
  padding: 48px 0 40px;
}

.home-intro-mark {
  font-family: "Noto Serif", Georgia, "Times New Roman", serif;
  font-size: clamp(20px, 4.6vw, 64px);
  font-weight: 400;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  letter-spacing: 0.18em;
  /* компенсируем интервал после последней буквы, иначе строка уезжает влево */
  text-indent: 0.18em;
  /* Отступы неравные намеренно. В надписи одни прописные, и под базовой линией
     остаётся пустое место под выносные элементы букв — снизу зазор кажется
     больше при одинаковых значениях. Сверху добавляем, снизу убираем на эту
     же величину: суммарная высота полосы не меняется, а выглядит ровно.
     Задано в em, чтобы поправка росла вместе с кеглем. */
  padding: 0.5em 0 0.31em;
  border-top: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
}

.home-intro-text {
  max-width: 640px;
  margin: 22px auto 0;
  text-align: center;
  font-size: 15px;
  color: #666;
}

@media (max-width: 600px) {
  .home-intro {
    padding: 32px 0 28px;
  }
  /* Отступы у надписи заданы в em и подстраиваются под кегль сами —
     переопределять их на мобильном не нужно. */
  .home-intro-text {
    margin-top: 16px;
    font-size: 14px;
  }
}

.hero {
  padding: 80px 0 60px;
  text-align: center;
}

.hero p {
  font-size: 16px;
  color: #666;
  max-width: 500px;
  margin: 0 auto 40px;
}

/* ===== CATEGORIES ===== */
.categories {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 0 24px 80px;
  width: 100%;
}

@media (max-width: 900px) {
  .categories {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .categories {
    grid-template-columns: 1fr;
  }
}

.category-card {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  cursor: pointer;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.category-card img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1; /* фото в полную силу; приглушаем только под курсором */
  transition: opacity 0.4s ease, transform 0.6s ease;
}

.category-card:hover img {
  opacity: 0.65;
  transform: scale(1.03);
}

.category-label {
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,0.9);
  padding: 16px 44px;
  text-align: center;
}

.cat-name {
  display: block;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #111;
}

.cat-sub {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #666;
}

/* ===== PAGE HEADER ===== */
.page-header {
  padding: 60px 0 40px;
  text-align: center;
}

.page-header h1 {
  font-family: "Noto Serif", Georgia, "Times New Roman", serif;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ===== FILTER ===== */
/* Пять строго равных колонок: ширина не зависит от длины надписи */
.filter-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  gap: 16px;
  margin-bottom: 40px;
}

.filter-bar .filter-group,
.filter-bar .filter-btn {
  min-width: 0;
}

.filter-bar .filter-select,
.filter-bar .price-slider,
.filter-bar .filter-btn {
  width: 100%;
}

.filter-bar .filter-btn {
  white-space: nowrap;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 900px) {
  .filter-bar {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .filter-bar {
    grid-template-columns: 1fr 1fr;
  }
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-group label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
  margin-bottom: 10px;
}

/* Price range */
.price-range-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.price-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.price-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2px;
  background: #ddd;
  outline: none;
  cursor: pointer;
}

.price-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #111;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #ddd;
}

.price-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #111;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #ddd;
}

/* Filter buttons */
.filter-btn {
  padding: 12px 24px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #555;
}

.filter-btn:hover {
  border-color: #111;
  color: #111;
}

.filter-btn.active {
  background: #111;
  color: #fff;
  border-color: #111;
}

/* Stock badge */
.stock-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  padding: 6px 12px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: #fff;
  color: #111;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.filter-select {
  padding: 12px 40px 12px 24px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23111' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  color: #555;
  font-family: inherit;
  transition: all 0.3s ease;
}

.filter-select:focus {
  outline: none;
  border-color: #111;
  color: #111;
}

.filter-select:hover {
  border-color: #111;
  color: #111;
}

/* ===== PRODUCT GRID ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* как в избранном на главной */
  gap: 32px;
  padding-bottom: 80px;
}

.product-card {
  cursor: pointer;
  transition: opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card:hover {
  opacity: 0.85;
}

.product-card.hidden {
  display: none;
}

.product-image-wrap {
  position: relative;
  aspect-ratio: 1;
  background: #f8f8f8;
  overflow: hidden;
  margin-bottom: 16px;
}

.product-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.product-image-wrap img.active {
  opacity: 1;
}

/* Carousel dots */
.carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}

.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: background 0.3s ease;
}

.carousel-dot.active {
  background: #fff;
}

/* Carousel arrows */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.8);
  cursor: pointer;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.3s ease;
  font-size: 14px;
  user-select: none;
}

.product-image-wrap:hover .carousel-arrow {
  opacity: 1;
}

.carousel-arrow.prev { left: 8px; }
.carousel-arrow.next { right: 8px; }

.product-brand {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
  margin-bottom: 4px;
}

.product-name {
  font-family: "Noto Serif", Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 400;
  margin-bottom: 6px;
  line-height: 1.35;
}

.product-price {
  font-size: 15px;
  color: #111;
  letter-spacing: 0.3px;
  margin-bottom: 14px;
}

/* Цена в евро рядом с рублёвой: техника привозная, рубли считаются по курсу */
.price-eur {
  margin-left: 8px;
  font-size: 0.82em;
  color: #999;
  white-space: nowrap;
}

/* ===== PRODUCT PAGE ===== */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  padding-bottom: 80px;
}

.product-gallery {
  position: relative;
}

.product-gallery-main {
  position: relative;
  aspect-ratio: 1;
  background: #f8f8f8;
  overflow: hidden;
}

.product-gallery-main img {
  width: 100%;
  height: 100%;
  /* Показываем кадр целиком: при обрезке по квадрату у широких снимков
     срезало края, и диван на карточке выглядел обрезанным. */
  object-fit: contain;
  cursor: zoom-in;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.product-gallery-main img.active {
  opacity: 1;
}

/* Раньше показ целиком включался только коврам; теперь так у всех товаров,
   класс оставлен для совместимости. */
.product-gallery-main.fit-contain img {
  object-fit: contain;
}

.product-gallery-thumbs {
  display: flex;
  flex-wrap: wrap; /* без переноса 20+ миниатюр уезжают на соседнюю колонку */
  gap: 8px;
  margin-top: 12px;
}

/* display:flex выше перебивает атрибут hidden — гасим явно */
.product-gallery-thumbs[hidden] {
  display: none;
}

.product-gallery-thumbs img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.6;
  transition: all 0.3s ease;
}

.product-gallery-thumbs img:hover,
.product-gallery-thumbs img.active {
  border-color: #111;
  opacity: 1;
}

.product-info h1 {
  font-family: "Noto Serif", Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 8px;
}

.product-info .brand {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #888;
  margin-bottom: 24px;
}

.product-info .price {
  font-family: "Noto Serif", Georgia, "Times New Roman", serif;
  font-size: 24px;
  margin-bottom: 32px;
}

.product-info .price .price-eur {
  font-family: inherit;
  font-size: 0.6em;
}

/* Плашка наличия на странице товара — в одном стиле с каталогом */
/* Плашку показываем только для товаров в наличии. Без этого правила атрибут
   hidden не сработает: display ниже перебивает скрытие от браузера, и на
   странице остаётся пустой прямоугольник с рамкой. */
.stock-info[hidden] {
  display: none;
}

.stock-info {
  display: inline-block;
  margin-bottom: 24px;
  padding: 8px 16px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: #fff;
  color: #111;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.product-info h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  font-weight: 500;
}

.product-info p {
  color: #555;
  margin-bottom: 24px;
  line-height: 1.7;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
}

.specs-table td {
  padding: 10px 0;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}

.specs-table td:first-child {
  color: #888;
  width: 40%;
}

.back-link {
  display: inline-block;
  margin-top: 40px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid #111;
  padding-bottom: 2px;
}

.back-link:hover {
  opacity: 0.6;
}

/* ===== TEXT PAGE ===== */
.text-content {
  max-width: 700px;
  margin: 0 auto;
  padding-bottom: 80px;
}

.text-content h2 {
  font-size: 22px;
  font-weight: 400;
  margin: 40px 0 16px;
}

.text-content h2:first-child {
  margin-top: 0;
}

.text-content p {
  color: #555;
  line-height: 1.8;
  margin-bottom: 16px;
}

.text-content ul {
  margin-left: 20px;
  color: #555;
  line-height: 1.8;
}

.text-content li {
  margin-bottom: 8px;
}

/* ===== CONTACTS ===== */
.contacts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  padding-bottom: 80px;
}

.contact-block h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #888;
  margin-bottom: 12px;
}

.contact-block p {
  font-size: 16px;
  line-height: 1.8;
}

.contact-block a:hover {
  border-bottom: 1px solid #111;
}

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid #eee;
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-left {
  font-size: 13px;
  color: #888;
}

.footer-right {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  font-size: 13px;
  color: #888;
}

.footer-right a:hover {
  color: #111;
}

/* ===== RESPONSIVE ===== */
/* На ноутбуках поуже четыре карточки в ряд уже тесноваты — отдаём три */
@media (max-width: 1200px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .product-detail {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .categories {
    grid-template-columns: 1fr;
  }

  .contacts-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

@media (max-width: 600px) {
  .nav {
    display: none;
  }

  .burger {
    display: flex;
  }

  .page-header h1 {
    font-size: 24px;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  /* Контакты в столбик: строкой они не помещаются в ширину телефона,
     а почта — неразрывный кусок и ужаться не может. Из-за этого страница
     получала горизонтальную прокрутку и уезжала вбок. */
  .footer-right {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .product-info h1 {
    font-size: 22px;
  }
}

/* ===== CATALOG COUNT ===== */
.catalog-count {
  text-align: center;
  margin-bottom: 24px;
  font-size: 13px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  background: #fff;
  color: #111;
  border: 1px solid #ddd;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: #f5f5f5;
}

/* ===== 404 PAGE ===== */
.error-page {
  text-align: center;
  padding: 120px 24px;
}

.error-page h1 {
  font-size: 120px;
  font-weight: 300;
  letter-spacing: 8px;
  margin-bottom: 16px;
  line-height: 1;
}

.error-page p {
  font-size: 16px;
  color: #888;
  margin-bottom: 40px;
}

.error-page a {
  display: inline-block;
  padding: 14px 40px;
  background: #111;
  color: #fff;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.error-page a:hover {
  opacity: 0.85;
}


/* ===== PRODUCT PAGE PADDING ===== */
main.product-page {
  padding-top: 120px;
}

@media (max-width: 600px) {
  main.product-page {
    padding-top: 104px;
  }
}

/* ===== SEARCH ===== */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.search-toggle:hover {
  opacity: 0.6;
}

.search-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  width: 320px;
  background: #fff;
  border: 1px solid #eee;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.3s ease;
  z-index: 1001;
}

.search-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.search-input {
  width: 100%;
  padding: 14px 18px;
  font-size: 14px;
  border: none;
  border-bottom: 1px solid #eee;
  outline: none;
  font-family: inherit;
}

.search-input::placeholder {
  color: #aaa;
}

.search-results {
  max-height: 360px;
  overflow-y: auto;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid #f5f5f5;
  text-decoration: none;
  color: inherit;
}

.search-result-item:hover {
  background: #f8f8f8;
}

.search-result-item img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  flex-shrink: 0;
}

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-brand {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
  margin-bottom: 2px;
}

.search-result-name {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Артикул в выдаче поиска — по нему часто и ищут */
.search-result-sku {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}

.search-result-price {
  font-size: 13px;
  color: #555;
  margin-top: 2px;
}

.search-no-results {
  padding: 20px;
  text-align: center;
  font-size: 14px;
  color: #888;
}

.search-highlight {
  background: #ffeb3b;
  padding: 0 2px;
}

@media (max-width: 600px) {
  .search-dropdown {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    width: 100%;
    margin-top: 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  }
}

.hero-logo {
  display: block;
  margin: 0 auto 24px;
  max-width: 280px;
  filter: drop-shadow(0 12px 32px rgba(0,0,0,0.12));
  transition: filter 0.4s ease;
}

.hero-logo:hover {
  filter: drop-shadow(0 16px 40px rgba(0,0,0,0.18));
}

@media (max-width: 600px) {
  .hero-logo {
    max-width: 200px;
  }
}

.catalog-error {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #888;
}

/* ===== АРТИКУЛ ===== */
.product-info .sku {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #999;
  margin-bottom: 18px;
}

/* ===== КНОПКИ ЗАПРОСА ===== */
.order-actions {
  margin-bottom: 8px;
}

.cta-main {
  display: block;
  width: 100%;
  text-align: center;
  padding: 17px 24px;
  background: #111;
  color: #fff;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
  transition: opacity 0.3s ease;
}

.cta-main:hover {
  opacity: 0.85;
}

.cta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cta-alt {
  display: block;
  text-align: center;
  padding: 15px 20px;
  border: 1px solid #ddd;
  color: #333;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: border-color 0.3s ease;
}

.cta-alt:hover {
  border-color: #111;
}

.cta-hint {
  font-size: 12px;
  color: #999;
  text-align: center;
  margin-top: 12px;
}

/* ===== ПОХОЖИЕ ТОВАРЫ ===== */
.similar {
  border-top: 1px solid #eee;
  padding: 56px 0 80px;
}

.similar h2 {
  font-family: "Noto Serif", Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 32px;
}

.similar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

@media (max-width: 900px) {
  .similar-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .similar-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== ГЛАВНАЯ: HERO ===== */
.hero .hero-lead {
  font-size: 18px;
  color: #444;
  max-width: 580px;
  margin: 0 auto 12px;
}

.hero .hero-sub {
  font-size: 14px;
  color: #999;
  max-width: 540px;
  margin: 0 auto 36px;
}

.hero-cta {
  display: inline-block;
  padding: 16px 44px;
  background: #111;
  color: #fff;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  transition: opacity 0.3s ease;
}

.hero-cta:hover {
  opacity: 0.85;
}

/* ===== ГЛАВНАЯ: ПОЛОСА ДОВЕРИЯ ===== */
.home-trust {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  /* Колонок столько, сколько пунктов: раньше их было четыре, сейчас три.
     auto-fit подстроится и дальше, если пункты будут добавляться или убираться. */
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  padding: 48px 24px;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  margin-bottom: 64px;
}

.trust-item {
  text-align: center;
}

.trust-item h3 {
  font-family: "Noto Serif", Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.trust-item p {
  font-size: 13px;
  color: #888;
  line-height: 1.5;
  max-width: 240px;
  margin: 0 auto;
}

@media (max-width: 700px) {
  .home-trust {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px 24px;
  }
}

/* ===== ГЛАВНАЯ: ИЗБРАННОЕ ===== */
.featured {
  padding-top: 8px;
}

/* Когда «Избранное» — первый блок страницы, нужен воздух под шапкой */
.featured-top {
  padding-top: 56px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.section-head h2 {
  font-family: "Noto Serif", Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.section-head a {
  font-size: 13px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
  border-bottom: 1px solid #ccc;
  padding-bottom: 2px;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.section-head a:hover {
  color: #111;
  border-color: #111;
}

/* Избранное: 4 карточки в ряд + листание по 8 */
.featured-grid {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 900px) {
  .featured-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .featured-grid {
    grid-template-columns: 1fr;
  }
}

.featured-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.featured-arrow {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ddd;
  background: #fff;
  color: #111;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, opacity 0.2s ease;
}

.featured-arrow:hover:not(:disabled) {
  border-color: #111;
}

.featured-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

.featured-page {
  font-size: 13px;
  color: #888;
  min-width: 40px;
  text-align: center;
}

.featured-all {
  font-size: 13px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
  border-bottom: 1px solid #ccc;
  padding-bottom: 2px;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.featured-all:hover {
  color: #111;
  border-color: #111;
}

@media (max-width: 600px) {
  .featured-all {
    display: none;
  }
}

/* Вводный абзац под заголовком страницы (по центру) */
.page-lead {
  max-width: 680px;
  margin: 0 auto 40px;
  text-align: center;
  color: #666;
  font-size: 16px;
  line-height: 1.7;
}

/* ===== СТРАНИЦА БРЕНДОВ ===== */
.brands-intro {
  max-width: 640px;
  margin: 0 auto 48px;
  text-align: center;
  color: #666;
  font-size: 15px;
  line-height: 1.6;
}

.brands-intro a {
  color: #111;
  border-bottom: 1px solid #ccc;
}

.brands-featured {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 72px;
}

.brand-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  aspect-ratio: 3 / 2;
  padding: 16px;
  background: #f8f8f8;
  border: 1px solid #eee;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.brand-tile:hover {
  background: #fff;
  border-color: #111;
}

.brand-tile-name {
  font-family: "Noto Serif", Georgia, "Times New Roman", serif;
  font-size: 22px;
  letter-spacing: 1px;
  color: #111;
}

.brand-tile-meta {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #999;
}

.brands-list-title {
  text-align: center;
  font-family: "Noto Serif", Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 32px;
}

/* Алфавитный указатель: группы перетекают вниз по колонке, затем в следующую
   (чтение по столбцам). Многоколоночная раскладка сама подстроится под рост числа брендов. */
.brands-index {
  max-width: 900px;
  margin: 0 auto;
  padding-bottom: 80px;
  column-count: 4;
  column-gap: 40px;
}

.brands-group {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin-bottom: 28px;
}

.brands-letter {
  font-family: "Noto Serif", Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 400;
  color: #111;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.brand-link {
  display: block;
  font-size: 15px;
  color: #333;
  padding: 6px 0;
  transition: color 0.2s ease;
}

.brand-link:hover {
  color: #111;
}

@media (max-width: 900px) {
  .brands-featured {
    grid-template-columns: repeat(2, 1fr);
  }
  .brands-index {
    column-count: 3;
  }
}

@media (max-width: 600px) {
  .brands-index {
    column-count: 2;
  }
}

/* Пустой результат в каталоге */
.catalog-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #666;
  font-size: 15px;
  line-height: 1.7;
  max-width: 560px;
  margin: 0 auto;
  padding: 48px 0 80px;
}

.catalog-empty a {
  color: #111;
  border-bottom: 1px solid #ccc;
}

/* ===== КОРЗИНА: ИКОНКА В ШАПКЕ ===== */
.cart-link {
  position: relative;
  display: flex;
  align-items: center;
  color: #111;
  margin-left: 6px;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -10px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  box-sizing: border-box;
  border-radius: 8px;
  background: #111;
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  display: none;
}

.cart-count.has-items {
  display: block;
}

/* ===== КНОПКА «В КОРЗИНУ» НА КАРТОЧКЕ ===== */
.card-add {
  display: block;
  width: 100%;
  margin-top: auto;
  padding: 10px;
  background: #fff;
  border: 1px solid #ddd;
  color: #111;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.card-add:hover {
  border-color: #111;
}

.card-add.added {
  background: #111;
  color: #fff;
  border-color: #111;
}

/* Кнопка «В корзину» на странице товара */
.cta-cart {
  display: block;
  width: 100%;
  text-align: center;
  padding: 17px 24px;
  background: #111;
  color: #fff;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border: none;
  margin-bottom: 12px;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.cta-cart:hover {
  opacity: 0.85;
}

/* ===== СТРАНИЦА КОРЗИНЫ ===== */
.cart-shared-banner {
  background: #f8f8f8;
  border: 1px solid #eee;
  padding: 16px 20px;
  margin-bottom: 32px;
  font-size: 14px;
  color: #333;
  text-align: center;
}

.cart-import {
  border: none;
  background: #111;
  color: #fff;
  padding: 8px 16px;
  margin-left: 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.cart-import:hover {
  opacity: 0.85;
}

.cart-list {
  margin-bottom: 32px;
}

.cart-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid #eee;
}

.cart-row-img {
  display: block;
  width: 80px;
  height: 80px;
  background: #f8f8f8;
  overflow: hidden;
}

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

.cart-row-brand {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
  margin-bottom: 4px;
}

.cart-row-name {
  display: block;
  font-size: 15px;
  color: #111;
  margin-bottom: 6px;
}

.cart-row-name:hover {
  text-decoration: underline;
}

.cart-row-price {
  font-size: 13px;
  color: #888;
}

.cart-row-controls {
  display: flex;
  align-items: center;
  gap: 24px;
}

.cart-qty {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
}

.cart-qty-btn {
  width: 30px;
  height: 32px;
  border: none;
  background: #fff;
  font-size: 16px;
  line-height: 1;
  color: #111;
  cursor: pointer;
  transition: background 0.2s ease;
}

.cart-qty-btn:hover {
  background: #f2f2f2;
}

.cart-qty-val {
  min-width: 28px;
  text-align: center;
  font-size: 14px;
}

.cart-qty-static {
  font-size: 14px;
  color: #555;
}

.cart-row-sum {
  min-width: 90px;
  text-align: right;
  font-size: 15px;
  color: #111;
}

.cart-remove {
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: #bbb;
  cursor: pointer;
  transition: color 0.2s ease;
}

.cart-remove:hover {
  color: #111;
}

.cart-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
  padding-bottom: 80px;
}

.cart-total {
  font-size: 18px;
}

.cart-total strong {
  font-weight: 700;
}

.cart-actions {
  width: 100%;
  max-width: 360px;
}

.cart-share-link {
  margin-top: 12px;
}

.cart-share-note {
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
}

.cart-share-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  font-size: 13px;
  color: #333;
}

.cart-empty {
  text-align: center;
  padding: 40px 0 80px;
}

.cart-empty p {
  color: #666;
  font-size: 16px;
  margin-bottom: 24px;
}

.cart-empty-btn {
  display: inline-block;
  width: auto;
  padding: 16px 44px;
}

@media (max-width: 600px) {
  .cart-row {
    grid-template-columns: 64px 1fr;
    gap: 14px;
  }
  .cart-row-img {
    width: 64px;
    height: 64px;
  }
  .cart-row-controls {
    grid-column: 1 / -1;
    justify-content: space-between;
    gap: 12px;
  }
  .cart-actions {
    max-width: 100%;
  }
}

/* ===== ВЫБОР ОТДЕЛКИ (ВАРИАНТЫ) ===== */
.variant-selector:empty {
  display: none;
}

.variant-selector {
  margin: 20px 0 12px;
}

.variant-label {
  font-size: 13px;
  color: #555;
  margin-bottom: 10px;
}

.variant-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.variant-btn {
  padding: 9px 16px;
  border: 1px solid #ddd;
  background: #fff;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.variant-btn:hover {
  border-color: #111;
}

.variant-btn.active {
  border-color: #111;
  color: #111;
  box-shadow: inset 0 0 0 1px #111;
}

/* Много отделок (у ковров до 21 цвета) — списком слов это занимает пол-экрана.
   Показываем сами образцы: квадрат с фото, название — в подписи над рядом. */
.variant-swatches {
  gap: 10px;
}

.variant-swatch {
  width: 52px;
  height: 52px;
  padding: 0;
  overflow: hidden;
  line-height: 0;
  box-shadow: none;
}

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

.variant-swatch.active {
  box-shadow: none;
  outline: 1px solid #111;
  outline-offset: 2px;
}

.cart-total-note {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #888;
}

.cart-row-variant {
  font-size: 12px;
  color: #888;
  margin-bottom: 6px;
}

/* ===== ПАГИНАЦИЯ КАТАЛОГА ===== */
.catalog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 8px 0 80px;
}

.catalog-pagination:empty {
  display: none;
}

.page-arrow {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ddd;
  background: #fff;
  color: #111;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, opacity 0.2s ease;
}

.page-arrow:hover:not(:disabled) {
  border-color: #111;
}

.page-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

.page-info {
  font-size: 14px;
  color: #555;
  letter-spacing: 0.5px;
  min-width: 150px;
  text-align: center;
}


/* ===== ФОТО ВО ВЕСЬ ЭКРАН ===== */
/* Клик по главному фото открывает снимок целиком: в карточке он вписан
   в квадрат и мелкие детали не разглядеть. */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(255,255,255,0.98);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: 94vw;
  max-height: 88vh;
  object-fit: contain;
  cursor: zoom-out;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: none;
  border: none;
  color: #111;
  cursor: pointer;
  padding: 12px;
  line-height: 0;
  opacity: 0.55;
  transition: opacity 0.2s ease;
}

.lightbox-close:hover,
.lightbox-nav:hover { opacity: 1; }

.lightbox-close { top: 18px; right: 20px; }
.lightbox-nav.prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox-nav.next { right: 12px; top: 50%; transform: translateY(-50%); }

.lightbox-count {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: 1px;
  color: #888;
}

@media (max-width: 600px) {
  .lightbox img { max-width: 100vw; max-height: 80vh; }
  .lightbox-nav { padding: 8px; }
}
