/*
  Страницы модели и раздела каталога.
  Отрисовываются на сервере, поэтому у них своя лёгкая вёрстка:
  тяжёлый catalog.css тянуть сюда незачем. Цвета и шрифты — из tokens.css.
*/

html, body{
  margin:0 !important;
  padding:0 !important;
  background:var(--vech-antique) !important;
  overflow-x:hidden;
}

.vm-wrap{
  background:var(--bg);
  color:var(--text);
  font-family:var(--font-text);
  min-height:100vh;
  /* Шапка теперь в потоке (sticky), а не плавает поверх — запас
     сверху больше не нужен, иначе она уезжает вниз на свою высоту. */
}

.vm-wrap,
.vm-wrap *{
  box-sizing:border-box;
}

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

.vm-shell{
  /* Ширина контента как в макете: кадр 1440 с полями по 50 —
     раньше здесь было 1180, и вся страница выходила уже макета. */
  max-width:1440px;
  margin:0 auto;
  padding:0 clamp(16px, 3.47vw, 50px);
}

.vm-main{
  padding:clamp(20px, 3vw, 34px) 0 clamp(48px, 7vw, 84px);
}

/* ---------- хлебные крошки ---------- */

.vm-crumbs{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
  font-size:14px;
  color:var(--muted);
  margin-bottom:18px;
}

.vm-crumbs a{
  color:inherit;
  text-decoration:none;
}

.vm-crumbs a:hover{
  text-decoration:underline;
  text-underline-offset:.2em;
}

/* ---------- заголовки ---------- */

.vm-title{
  font-family:var(--font-display);
  letter-spacing:var(--display-tracking);
  font-size:clamp(24px, 3vw, 34px);
  line-height:1.14;
  margin:0 0 10px;
  color:var(--text);
}

.vm-kicker{
  font-family:var(--font-display);
  letter-spacing:.14em;
  text-transform:uppercase;
  font-size:12px;
  color:var(--muted);
  margin-bottom:6px;
}

/* ---------- карточка модели ---------- */

.vm-card{
  display:grid;
  grid-template-columns:minmax(0,1.05fr) minmax(320px,.95fr);
  gap:clamp(16px, 2.4vw, 28px);
  align-items:start;
}

.vm-media__main{
  margin:0;
  border-radius:var(--r-lg);
  border:1px solid var(--line);
  background:var(--stage);
  overflow:hidden;
}

.vm-media__main img{
  width:100%;
  height:auto;
}

.vm-media__thumbs{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:10px;
  margin-top:10px;
}

.vm-media__thumb{
  margin:0;
  border-radius:14px;
  border:1px solid var(--line2);
  background:var(--stage);
  overflow:hidden;
}

.vm-media__thumb.is-active{
  border-color:var(--accent);
}

.vm-tags{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:0 0 16px;
  padding:0;
  list-style:none;
}

.vm-tags li{
  font-size:13px;
  padding:6px 12px;
  border-radius:999px;
  background:var(--vech-brown-light);
  color:var(--vech-antique);
}

.vm-specs{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(120px,1fr));
  gap:0;
  margin:0 0 18px;
  border:1px solid var(--line2);
  border-radius:16px;
  overflow:hidden;
  background:var(--panel-2);
}

.vm-spec{
  padding:12px 14px;
  border-right:1px solid var(--line2);
}

.vm-spec:last-child{
  border-right:0;
}

.vm-spec dt{
  font-family:var(--font-display);
  font-size:11px;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--muted);
  margin-bottom:4px;
}

.vm-spec dd{
  margin:0;
  font-size:15px;
  color:var(--text);
}

.vm-text{
  color:var(--muted);
  font-size:16px;
  line-height:1.78;
  max-width:64ch;
  hyphens:auto;
  -webkit-hyphens:auto;
}

.vm-text p{
  margin:0 0 14px;
}

.vm-text p:last-child{
  margin-bottom:0;
}

.vm-extra{
  max-width:64ch;
  margin:18px 0 0;
  padding-top:14px;
  border-top:1px solid var(--line2);
  font-size:13.5px;
  line-height:1.68;
  color:color-mix(in srgb, var(--muted) 80%, transparent);
}

/* ---------- кнопки ---------- */

.vm-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:22px;
}

.vm-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:46px;
  padding:12px 18px;
  border-radius:14px;
  border:1px solid var(--line);
  background:color-mix(in srgb, var(--text) 5%, transparent);
  color:var(--text);
  font-size:15px;
  font-weight:600;
  text-decoration:none;
  transition:background 220ms var(--ease), border-color 220ms var(--ease);
}

.vm-btn:hover{
  background:color-mix(in srgb, var(--text) 9%, transparent);
}

.vm-btn--primary{
  background:var(--accent);
  color:var(--on-accent);
  border-color:transparent;
}

.vm-btn--primary:hover{
  filter:brightness(.93);
  background:var(--accent);
}

.vm-note{
  margin:16px 0 0;
  font-size:14px;
  color:var(--muted);
}

/* ---------- соседние модели ---------- */

.vm-more{
  margin-top:clamp(36px, 5vw, 56px);
}

.vm-more__title{
  font-family:var(--font-display);
  letter-spacing:var(--display-tracking);
  font-size:clamp(19px, 2.2vw, 24px);
  margin:0 0 16px;
}

.vm-more__grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(180px,1fr));
  gap:14px;
}

.vm-more__item{
  display:block;
  padding:10px;
  border-radius:16px;
  border:1px solid var(--line2);
  background:var(--panel);
  color:var(--text);
  text-decoration:none;
  transition:border-color 220ms var(--ease), transform 220ms var(--ease);
}

.vm-more__item:hover{
  border-color:var(--accent);
  transform:translateY(-2px);
}

.vm-more__item img{
  width:100%;
  height:auto;
  border-radius:10px;
  background:var(--stage);
  margin-bottom:8px;
}

.vm-more__item span{
  font-size:14px;
}

/* ---------- страница раздела ---------- */

.vm-head{
  margin-bottom:22px;
}

.vm-head__text{
  color:var(--muted);
  font-size:16px;
  line-height:1.75;
  max-width:68ch;
  margin:0 0 8px;
}

.vm-head__count{
  color:var(--muted);
  font-size:14px;
  margin:0;
}

/* Обложка посадочной страницы */
.vm-cover{
  margin:0 0 26px;
  border-radius:22px;
  overflow:hidden;
  border:1px solid var(--line);
}

.vm-cover img{
  display:block;
  width:100%;
  height:auto;
}

/* Текст под выдачей: под сеткой ему не мешает ширина карточек,
   поэтому он читается как обычная статья. */
.vm-longread{
  margin-top:34px;
  max-width:68ch;
  font-size:16px;
  line-height:1.75;
}

.vm-longread h2,
.vm-longread h3{
  margin:26px 0 10px;
  line-height:1.2;
  letter-spacing:var(--display-tracking);
}

.vm-longread h2{ font-size:26px; }
.vm-longread h3{ font-size:20px; }

.vm-longread p{ margin:0 0 14px; }

.vm-longread ul,
.vm-longread ol{
  margin:0 0 14px;
  padding-left:20px;
}

.vm-longread li{ margin-bottom:6px; }

.vm-subnav{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:24px;
}

.vm-subnav a{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:9px 14px;
  border-radius:999px;
  border:1px solid var(--line);
  color:var(--text);
  text-decoration:none;
  font-size:14px;
}

.vm-subnav a:hover{
  border-color:var(--accent);
}

.vm-subnav span{
  color:var(--muted);
  font-size:12px;
}

.vm-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(240px,1fr));
  gap:16px;
}

.vm-item__link{
  display:block;
  height:100%;
  padding:12px;
  border-radius:18px;
  border:1px solid var(--line);
  background:var(--panel);
  color:var(--text);
  text-decoration:none;
  transition:border-color 220ms var(--ease), transform 220ms var(--ease);
}

.vm-item__link:hover{
  border-color:var(--accent);
  transform:translateY(-2px);
}

.vm-item__media img{
  width:100%;
  height:auto;
  border-radius:12px;
  background:var(--stage);
  margin-bottom:10px;
}

.vm-item__title{
  font-family:var(--font-display);
  letter-spacing:var(--display-tracking);
  font-size:19px;
  margin:0 0 6px;
}

.vm-item__text{
  color:var(--muted);
  font-size:14px;
  line-height:1.6;
  margin:0 0 10px;
  display:-webkit-box;
  -webkit-line-clamp:3;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.vm-item__more{
  font-size:14px;
  font-weight:600;
}

.vm-pagination{
  margin-top:26px;
  display:flex;
  justify-content:center;
}

.vm-pagination .page-numbers{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:40px;
  min-height:40px;
  padding:0 10px;
  margin:0 3px;
  border-radius:10px;
  border:1px solid var(--line);
  color:var(--text);
  text-decoration:none;
  font-size:14px;
}

.vm-pagination .page-numbers.current{
  background:var(--accent);
  color:var(--on-accent);
  border-color:transparent;
}

.vm-backlink{
  margin-top:28px;
  font-size:15px;
}

.vm-backlink a{
  color:var(--muted);
  text-decoration:none;
}

.vm-backlink a:hover{
  text-decoration:underline;
  text-underline-offset:.2em;
}

/* ---------- мобильный ---------- */

@media (max-width:900px){
  .vm-card{
    grid-template-columns:minmax(0,1fr);
  }
}

@media (max-width:1140px){
  .vm-wrap{
    padding-top:64px;
  }
}

/* ============================================================
   Карточка товара по версии макета от 21.08 (кадр 2010:773).
   Слева заголовок, текст, характеристики плашками и кнопка,
   справа галерея в коричневой панели. Числа из макета:
   колонки 690 и 600, плашки 335×102 и 690×102, скругление 10.
   ============================================================ */

.vm-card{
  display:grid;
  grid-template-columns:minmax(0, 690fr) minmax(0, 600fr);
  gap:clamp(24px, 3.5vw, 50px);
  align-items:start;
  margin-bottom:44px;
}

.vm-card .vm-title{
  margin:0 0 20px;
  font-weight:700;
  font-size:clamp(28px, 3.2vw, 46px);
  line-height:1;
}

.vm-card .vm-text{
  margin-bottom:40px;
  font-size:clamp(15px, 1.3vw, 18px);
  line-height:1.36;
  color:var(--muted);
}

.vm-card .vm-text p{ margin:0 0 12px; }
.vm-card .vm-text p:last-child{ margin-bottom:0; }

/* --- характеристики плашками --- */

.vm-props{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:20px;
  margin:0 0 22px;
}

.vm-prop{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:102px;
  padding:18px 20px;
  border:1px solid var(--muted);
  border-radius:10px;
  background:var(--panel);
  text-align:center;
}

/* «Размер» и «Цена» в макете во всю ширину колонки */
.vm-prop--wide{ grid-column:1 / -1; }

.vm-prop dt{
  margin:0;
  font-family:var(--font-display);
  font-weight:700;
  font-size:clamp(18px, 1.8vw, 25px);
  line-height:1;
  letter-spacing:var(--display-tracking);
  text-transform:uppercase;
  color:var(--muted);
}

.vm-prop dd{
  margin:0;
  font-size:clamp(15px, 1.4vw, 20px);
  line-height:1.2;
  color:var(--muted);
}

/* --- главная кнопка --- */

.vm-cta{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:67px;
  padding:14px 24px;
  border:1px solid var(--vech-antique);
  border-radius:10px;
  background:var(--muted);
  color:var(--vech-antique);
  font-family:var(--font-text);
  font-weight:600;
  font-size:clamp(15px, 1.3vw, 18px);
  cursor:pointer;
  transition:transform .2s var(--ease);
}

.vm-cta:hover{ transform:translateY(-1px); }

.vm-card .vm-actions{ margin-top:14px; }

/* --- галерея в панели --- */

.vm-stage{
  position:relative;
  display:flex;
  flex-direction:column;
  border-radius:10px;
  background:var(--vech-brown-light);
  overflow:hidden;
}

.vm-stage__viewport{
  position:relative;
  aspect-ratio:600 / 470;
}

.vm-stage__slide{
  position:absolute;
  inset:0;
  margin:0;
  opacity:0;
  visibility:hidden;
  transition:opacity .3s var(--ease);
}

.vm-stage__slide.is-active{
  opacity:1;
  visibility:visible;
}

.vm-stage__slide img{
  width:100%;
  height:100%;
  object-fit:contain;
}

.vm-stage__nav{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  display:flex;
  align-items:center;
  justify-content:center;
  width:44px;
  height:44px;
  border:0;
  border-radius:50%;
  background:transparent;
  color:var(--vech-antique);
  font-size:34px;
  line-height:1;
  cursor:pointer;
  transition:background .2s var(--ease);
}

.vm-stage__nav:hover{ background:rgba(255,255,255,.14); }
.vm-stage__nav--prev{ left:10px; }
.vm-stage__nav--next{ right:10px; }

.vm-stage__dots{
  position:absolute;
  left:50%;
  bottom:14px;
  transform:translateX(-50%);
  display:flex;
  gap:8px;
}

.vm-stage__dot{
  width:10px;
  height:10px;
  padding:0;
  border:0;
  border-radius:50%;
  background:rgba(255,255,255,.45);
  cursor:pointer;
}

.vm-stage__dot.is-active{ background:var(--vech-antique); }

.vm-stage__model{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:16px;
  margin:0 auto 22px;
  min-height:43px;
  padding:10px 24px;
  border-radius:10px;
  background:var(--muted);
  color:var(--vech-antique);
  font-weight:600;
  font-size:clamp(14px, 1.3vw, 18px);
  text-decoration:none !important;
  transition:transform .2s var(--ease);
}

.vm-stage__model:hover{ transform:translateY(-1px); }
.vm-stage__model-icon{ font-size:15px; }

/* --- отзывы --- */

.vm-reviews{
  padding:60px 0;
  background:var(--vech-brown-light);
}

.vm-reviews__title{
  margin:0 0 42px;
  font-family:var(--font-text);
  font-weight:700;
  font-size:clamp(26px, 3.2vw, 46px);
  line-height:1;
  color:var(--vech-antique);
}

.vm-reviews__grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(280px, 1fr));
  gap:24px;
}

.vm-review{
  padding:20px;
  border-radius:10px;
  background:var(--panel);
  color:var(--muted);
}

.vm-review__stars{
  display:flex;
  gap:4px;
  margin:0 0 14px;
  font-size:19px;
  line-height:1;
}

.vm-review__star{ opacity:.28; }
.vm-review__star.is-on{ opacity:1; }

.vm-review__author{
  margin:0 0 10px;
  font-size:clamp(15px, 1.3vw, 18px);
  font-weight:700;
  line-height:1.2;
}

.vm-review__text{
  font-size:clamp(14px, 1.3vw, 18px);
  line-height:1.42;
  font-weight:500;
}

.vm-review__text p{ margin:0 0 10px; }
.vm-review__text p:last-child{ margin-bottom:0; }

/* --- похожие товары: рейтинг и цена --- */

.vm-more__media{
  position:relative;
  display:block;
  aspect-ratio:4 / 3;
  overflow:hidden;
  background:var(--vech-brown-light);
}

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

.vm-more__rating{
  position:absolute;
  left:14px;
  top:14px;
  z-index:2;
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 10px;
  border-radius:999px;
  background:rgba(33,33,33,.45);
  color:#fff;
  font-size:14px;
  font-weight:600;
  backdrop-filter:blur(6px);
}

.vm-more__body{
  display:flex;
  flex-direction:column;
  gap:4px;
  padding:14px 16px 16px;
}

.vm-more__name{
  font-size:clamp(15px, 1.3vw, 18px);
  font-weight:700;
  line-height:1.2;
}

.vm-more__price{
  font-size:15px;
  color:var(--muted);
}

@media (max-width: 900px){
  .vm-card{
    grid-template-columns:minmax(0, 1fr);
    gap:22px;
  }

  /* В мобильном макете сначала заголовок и текст, потом фото,
     и только затем плашки с кнопкой. */
  .vm-card .vm-info{ display:contents; }
  .vm-card .vm-title{ order:1; }
  .vm-card .vm-text{ order:2; margin-bottom:0; }
  .vm-stage{ order:3; }
  .vm-props{ order:4; }
  .vm-tags{ order:5; }
  .vm-extra{ order:6; }
  .vm-cta{ order:7; }
  .vm-card .vm-actions{ order:8; }

  .vm-props{ gap:12px; }
  .vm-prop{ min-height:80px; padding:14px; }

  .vm-reviews{ padding:36px 0; }
  .vm-reviews__title{ margin-bottom:24px; }
}

/* Старые правила блока «похожие» рассчитаны на другую карточку:
   отступ вокруг картинки и один размер для всех span. Перебиваем
   их здесь, иначе картинка отходит от края, а название мельчает. */
.vm-more__item{
  padding:0;
  overflow:hidden;
}

.vm-more__item .vm-more__media img{
  margin:0;
  border-radius:0;
}

.vm-more__item .vm-more__name{
  font-size:clamp(15px, 1.3vw, 18px);
  font-weight:700;
}

.vm-more__item .vm-more__price{ font-size:15px; }

/* Цвета карточки по темам.
   Готовые --muted и --accent не подходят: в тёмной теме --muted это
   капучино, и надпись антиком по нему почти не читается. Пара токенов
   на страницу решает это разом. */
.vm-wrap{
  --vm-ink: var(--vech-brown);
  --vm-fill: var(--vech-brown);
  --vm-fill-ink: var(--vech-antique);
}

.vm-wrap[data-theme='dark']{
  --vm-ink: var(--vech-antique);
  --vm-fill: var(--vech-antique);
  --vm-fill-ink: var(--vech-black);
}

.vm-card .vm-text,
.vm-prop dt,
.vm-prop dd{ color:var(--vm-ink); }

.vm-prop{ border-color:var(--vm-ink); }

.vm-cta{
  background:var(--vm-fill);
  border-color:var(--vm-fill);
  color:var(--vm-fill-ink);
}

.vm-stage__model{
  background:var(--vm-fill);
  color:var(--vm-fill-ink);
}

/* Полоса отзывов коричневая в обеих темах, поэтому карточки на ней
   всегда светлые — иначе в тёмной теме они сливались бы с полосой. */
.vm-review{
  background:var(--vech-antique);
  color:var(--vech-brown);
}

.vm-reviews__title{ color:var(--vech-antique); }
