/* КомодМск - раздел «Мебель на заказ». Самодостаточный CSS, без внешних ресурсов. */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f2ee;
  --ink: #2b2723;
  --muted: #6d655c;
  --line: #e4ddd3;
  --accent: #a9743f;      /* тёплый орех */
  --accent-dark: #8a5c2f;
  --graphite: #33302c;
  --radius: 14px;
  --maxw: 1180px;
  --shadow: 0 2px 10px rgba(43, 39, 35, .06);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
}

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

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; color: var(--graphite); }
h1 { font-size: clamp(1.6rem, 4vw, 2.5rem); margin: .2em 0 .4em; }
h2 { font-size: clamp(1.25rem, 2.6vw, 1.7rem); margin: 1.6em 0 .6em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* chrome header (шапка КомодМск) */
.logo { font-weight: 800; font-size: 1.4rem; color: var(--graphite); letter-spacing: -.02em; }
.logo span { color: var(--accent); }
.logo:hover { text-decoration: none; }

.chrome { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 20; }
.chrome-top { border-bottom: 1px solid var(--line); background: var(--bg); }
.chrome-top-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 20px; flex-wrap: wrap; }
.chrome-logo { font-weight: 800; font-size: 1.5rem; color: var(--graphite); letter-spacing: -.02em; }
.chrome-logo span { color: var(--accent); }
.chrome-logo:hover { text-decoration: none; }

.chrome-contacts, .footer-contacts { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; }
.chrome-phone { font-weight: 800; font-size: 1.1rem; color: var(--graphite); white-space: nowrap; }
.chrome-phone:hover { color: var(--accent-dark); }
.chrome-ic { font-weight: 600; font-size: .95rem; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.chrome-ic::before { content: ""; width: 18px; height: 18px; border-radius: 50%; display: inline-block; }
.chrome-ic-tg::before { background: #29a9eb; }
.chrome-ic-wa::before { background: #25d366; }
.chrome-ic:hover { color: var(--accent-dark); }
.chrome-cb { padding: 10px 18px; font-size: .95rem; }

.chrome-nav { background: var(--graphite); }
.chrome-nav > .wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chrome-nav ul { display: flex; align-items: center; gap: 2px 4px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.chrome-nav li { flex: 0 0 auto; }
.chrome-nav a { display: block; color: #e7e0d6; font-weight: 600; font-size: .95rem; padding: 12px 12px; white-space: nowrap; }
.chrome-nav a:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.chrome-nav li.active a { color: #fff; background: var(--accent); }
.chrome-nav li.active a:hover { background: var(--accent-dark); }

/* breadcrumbs */
.breadcrumbs { margin: 18px 0 4px; font-size: .86rem; color: var(--muted); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs [aria-current] span { color: var(--ink); }

.content { padding-bottom: 40px; }
/* интро в том же контейнере и той же ширины, что и сетка карточек (не уже) */
.intro { font-size: 1.1rem; color: #4b453d; max-width: none; }

/* текст в уровень с блоками фото: те же левый/правый края, что у галереи и карточек */
.text-block p { max-width: none; }

/* cards grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}
.card {
  display: block; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(43,39,35,.12); text-decoration: none; }
.card-media { aspect-ratio: 4 / 3; background: var(--bg-alt); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
/* карточка без фото: нейтральный плейсхолдер с названием (без битого <img>) */
.card-media-empty {
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 12px; background: linear-gradient(135deg, var(--bg-alt), #ece6dd);
  border-bottom: 1px solid var(--line);
}
.card-media-empty span { font-weight: 600; color: var(--muted); font-size: .95rem; line-height: 1.3; }
.card-title { padding: 12px 14px; font-weight: 600; color: var(--graphite); }

/* gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.gallery-item { margin: 0; border-radius: 12px; overflow: hidden; background: var(--bg-alt); box-shadow: var(--shadow); }
.gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* steps */
.steps-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.step { display: flex; gap: 14px; background: var(--bg-alt); border-radius: 12px; padding: 16px; }
.step-num { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; display: grid; place-items: center; }
.step p { margin: 4px 0 0; font-size: .95rem; color: var(--muted); }

/* materials */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 12px 0; }
.chips li { background: var(--bg-alt); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: .9rem; font-weight: 600; }
.link-more { font-weight: 700; }

/* usp */
.usp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.usp-list li { background: var(--bg); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.usp-list strong { color: var(--graphite); }
.usp-list span { color: var(--muted); font-size: .95rem; }
.usp-list li.usp-link { padding: 0; }
.usp-list li.usp-link a { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; height: 100%; color: inherit; }
.usp-list li.usp-link a:hover { text-decoration: none; background: var(--bg-alt); }
.usp-list li.usp-link a:hover strong { color: var(--accent-dark); }

/* серийные модели */
.serial { background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 22px 0; }
.serial p { margin: 0 0 12px; max-width: 820px; }
.btn-outline { background: transparent; border: 2px solid var(--accent); color: var(--accent-dark); padding: 11px 22px; }
.btn-outline:hover { background: var(--accent); color: #fff; text-decoration: none; }

/* палитра */
.palette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.pal-item { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg); box-shadow: var(--shadow); }
.pal-item .zoom { display: block; width: 100%; padding: 0; border: 0; background: var(--bg-alt); cursor: zoom-in; }
.pal-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.pal-item figcaption { padding: 10px 12px; font-weight: 600; font-size: .92rem; color: var(--graphite); }

/* footer contacts */
.footer-contacts { margin-top: 14px; }
.footer-contacts .chrome-phone { color: #fff; }
.footer-contacts .chrome-ic { color: #d8d1c7; }
.footer-contacts .chrome-ic:hover { color: #fff; }

/* lightbox */
.gallery-item .zoom { display: block; width: 100%; padding: 0; border: 0; background: var(--bg-alt); cursor: zoom-in; }
.gallery-item .zoom img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.lightbox { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; background: rgba(20,17,14,.9); padding: 24px; }
.lightbox.open { display: flex; }
.lightbox .lb-img { max-width: 96vw; max-height: 90vh; width: auto; height: auto; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.lb-close { position: absolute; top: 16px; right: 20px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer; }
.lb-close:hover { background: rgba(255,255,255,.3); }

/* reviews */
.reviews-empty { background: var(--bg-alt); border: 1px dashed var(--line); border-radius: 12px; padding: 18px; color: var(--muted); }

/* constructor cta */
.constructor-cta {
  background: linear-gradient(135deg, #33302c, #4a4038);
  color: #fff; border-radius: var(--radius); padding: 28px; margin-top: 24px;
}
.constructor-cta h2 { color: #fff; margin-top: 0; }
.constructor-cta p { color: #e9e2d8; max-width: 760px; }

/* buttons */
.btn { display: inline-block; border: 0; border-radius: 10px; padding: 13px 26px; font-size: 1rem; font-weight: 700; cursor: pointer; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); text-decoration: none; }

/* faq */
.faq-item { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: var(--bg); overflow: hidden; }
.faq-item summary { cursor: pointer; padding: 14px 18px; font-weight: 600; color: var(--graphite); list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; float: right; color: var(--accent); font-weight: 700; }
.faq-item[open] summary::after { content: "–"; }
.faq-answer { padding: 0 18px 14px; }
.faq-answer p { margin: 0; color: #4b453d; }

/* related - пилюли «Смотрите также» (не должны наезжать друг на друга) */
.related-list { list-style: none; display: flex; flex-wrap: wrap; gap: 12px; padding: 0; margin: 0; align-items: flex-start; }
.related-list li { display: inline-flex; }
.related-list a { display: inline-block; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: .92rem; line-height: 1.3; color: var(--ink); }
.related-list a:hover { border-color: var(--accent); color: var(--accent-dark); text-decoration: none; }

/* полоса «Все разделы мебели на заказ» - полная перелинковка */
.all-sections { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.all-sections h2 { font-size: 1.05rem; margin: 0 0 12px; }
.all-sections-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 10px; padding: 0; margin: 0; }
.all-sections-list li { display: inline-flex; }
.all-sections-list a, .all-sections-list span {
  display: inline-block; padding: 6px 12px; border-radius: 999px; font-size: .88rem; line-height: 1.3;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
.all-sections-list a:hover { border-color: var(--accent); color: var(--accent-dark); text-decoration: none; }
.all-sections-list [aria-current="page"] span { background: var(--bg-alt); color: var(--muted); font-weight: 600; }

/* lead form */
.lead { background: var(--bg-alt); border-radius: var(--radius); padding: 24px; margin-top: 26px; }
.lead-form { display: grid; gap: 8px; max-width: 460px; }
.lead-form label { font-weight: 600; font-size: .92rem; }
.lead-form input[type="text"], .lead-form input[type="tel"] {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 1rem; background: #fff; width: 100%;
}
.lead-form input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.consent { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; font-size: .9rem; color: var(--muted); margin: 6px 0; }
.consent input { margin-top: 3px; }
.lead-form .btn { justify-self: start; margin-top: 6px; }
.form-note { font-size: .82rem; color: var(--muted); margin: 6px 0 0; }
.form-note--ok { color: #2e7d32; font-weight: 600; }
.form-note--err { color: #c62828; font-weight: 600; }
.field-hint { font-size: .82rem; color: var(--muted); margin: 4px 0 10px; }
.lead-form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; color: inherit; background: #fff; resize: vertical; min-height: 76px;
}
.lead-form input[type="file"] { font: inherit; font-size: .92rem; padding: 6px 0; }

/* Ловушка для ботов: поле должно быть недостижимо для человека, но не выглядеть
   для поисковика скрытым текстом. Поэтому не display:none, а вынос за экран. */
.lead-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* footer */
.site-footer { background: var(--graphite); color: #d8d1c7; margin-top: 50px; padding: 34px 0 24px; }
.site-footer .logo { color: #fff; }
.footer-cols { display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; }
.footer-note { color: #b7afa4; max-width: 420px; font-size: .95rem; }
.footer-nav { list-style: none; display: grid; gap: 8px; padding: 0; margin: 0; }
.footer-nav a { color: #d8d1c7; }
.footer-nav a:hover { color: #fff; }
.copyright { border-top: 1px solid #4a4038; margin-top: 24px; padding-top: 16px; font-size: .84rem; color: #a79f94; }

@media (max-width: 760px) {
  .chrome-top-inner { gap: 10px 14px; }
  /* меню в один ряд с горизонтальным скроллом на мобиле */
  .chrome-nav ul { flex-wrap: nowrap; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .chrome-contacts { gap: 8px 12px; }
  .chrome-phone { font-size: 1rem; }
  .constructor-cta, .lead { padding: 20px; }
}

/* отступ под фиксированную шапку основного сайта (navbar 50-51px) */
main.wrap { padding-top: 62px; }

/* Роман: шрифт раздела оставить исходным (системный). CSS основного сайта
   перебивал его на контенте - возвращаем на всё внутри main.wrap.
   Шапка/футер (вне main.wrap) остаются в шрифте основного сайта. */
main.wrap, main.wrap * {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif !important;
}

/* Роман: размер шрифта контента вернуть исходным. CSS основного сайта ставит
   html{font-size:10px}, а раздел рисовался при базе 16px - rem-размеры сжались.
   html НЕ трогаем (сломает навбар основного сайта - он на базе 10px), а размеры
   контента внутри main.wrap восстанавливаем, домножая rem на 1.6 (16/10). */
main.wrap h1 { font-size: clamp(2.56rem, 4vw, 4rem) !important; }
main.wrap h2 { font-size: clamp(2rem, 2.6vw, 2.72rem) !important; }
main.wrap h3 { font-size: 1.76rem !important; }
main.wrap .intro { font-size: 1.76rem !important; }
main.wrap .breadcrumbs { font-size: 1.38rem !important; }
main.wrap .card-media-empty span,
main.wrap .step p,
main.wrap .usp-list span { font-size: 1.52rem !important; }
main.wrap .chips li { font-size: 1.44rem !important; }
main.wrap .pal-item figcaption { font-size: 1.47rem !important; }
main.wrap .btn { font-size: 1.6rem !important; }
main.wrap .related-list a { font-size: 1.47rem !important; }
main.wrap .all-sections h2 { font-size: 1.68rem !important; }
main.wrap .all-sections a { font-size: 1.41rem !important; }
main.wrap .lead-form label { font-size: 1.47rem !important; }
main.wrap .lead-form input,
main.wrap .lead-form textarea,
main.wrap .lead-form select { font-size: 1.6rem !important; }
main.wrap .lead-form input[type="file"] { font-size: 1.47rem !important; }
main.wrap .consent { font-size: 1.44rem !important; }
main.wrap .form-note,
main.wrap .field-hint { font-size: 1.31rem !important; }
