:root {
  --bg: #ffffff;
  --bg-alt: #f2f2f2;
  --ink: #141414;
  --ink-soft: #656565;
  --line: #e2e2e2;
  --accent: #57616b;
  --dark: #0e0e0e;
  --dark-soft: #a8a8a8;
  --radius: 2px;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Manrope', Arial, sans-serif;
  --container: 1440px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
  font-weight: 600;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 34px;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn-light {
  background: var(--bg);
  color: var(--ink);
}
.btn-light:hover { background: #fff; }
.btn-dark {
  background: var(--dark);
  color: #fff;
}
.btn-dark:hover { background: var(--accent); }
.btn-outline {
  border: 1px solid var(--ink);
  color: var(--ink);
}
.btn-outline:hover { background: var(--ink); color: #fff; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 84px;
}
.logo img { height: 40px; width: auto; }
.nav {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-left: 8px;
  flex: 1;
}
.nav a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  position: relative;
  padding: 4px 0;
}
.nav a:hover { color: var(--accent); }
.nav-cta {
  margin-left: auto;
  padding: 10px 22px;
  font-size: 0.86rem;
  white-space: nowrap;
}
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}
.burger span { width: 22px; height: 2px; background: var(--ink); display: block; border-radius: 1px; }

/* Hero (десктоп: фото справа, текст по центру своей колонки слева) */
.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  min-height: 560px;
  box-shadow: 0 20px 32px -20px rgba(14, 14, 14, 0.35);
}
.hero-content {
  order: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px 48px;
  margin: 0 auto;
  max-width: 480px;
}
.hero-media {
  order: 2;
  position: relative;
  overflow: hidden;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  display: block;
}
.hero h1 {
  font-size: clamp(1.7rem, 2.6vw, 2.4rem);
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 18px;
}
.hero-text {
  font-size: 1rem;
  color: var(--ink-soft);
  margin-bottom: 28px;
}

/* Section heading */
.section-heading {
  max-width: 620px;
  margin: 0 0 48px;
}
.section-heading h2 {
  font-size: clamp(1.7rem, 2.6vw, 2.3rem);
}

/* Catalog */
.catalog { padding: 120px 0; }
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 48px;
}
.filter-pill {
  padding: 10px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: all 0.2s ease;
}
.filter-pill:hover { border-color: var(--accent); color: var(--accent); }
.filter-pill.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px 24px;
}
.grid-loading, .grid-empty {
  grid-column: 1 / -1;
  color: var(--ink-soft);
  padding: 40px 0;
}

/* Карточка товара: фото сверху, название и категория — подписью под фото */
.product-card {
  cursor: pointer;
  border: none;
  background: none;
  text-align: left;
  text-decoration: none;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.product-card-media {
  position: relative;
  aspect-ratio: 8 / 5;
  background: var(--bg-alt);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 18px 40px -20px rgba(14,14,14,0.35);
}
.product-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}
.product-card:hover img { transform: scale(1.06); }
.product-card-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(10,10,10,0.55) 0%, rgba(10,10,10,0) 45%);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.product-card:hover .product-card-scrim { opacity: 1; }
.product-card-cta {
  position: absolute;
  top: 20px; right: 20px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 999px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.product-card:hover .product-card-cta { opacity: 1; transform: translateY(0); }
.product-card-info {
  padding: 14px 2px 0;
}
.product-card-category {
  font-size: 0.72rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 4px;
}
.product-card-name {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

/* About (текст слева, фото справа, преимущества — карточки-чипы в ряд) */
.about { padding: 120px 0; background: var(--bg-alt); }
.about-inner {
  display: grid;
  grid-template-columns: 1fr 0.95fr;
  gap: 56px;
  align-items: center;
  margin-bottom: 56px;
}
.about-media img {
  width: 100%;
  border-radius: var(--radius);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.about-content h2 { margin-bottom: 18px; font-size: clamp(1.6rem, 2.4vw, 2.1rem); }
.about-text { color: var(--ink-soft); max-width: 480px; }

.advantages { display: flex; gap: 16px; flex-wrap: wrap; }
.advantage {
  flex: 1 1 220px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px 24px;
  transition: border-color 0.2s ease;
}
.advantage:hover { border-color: var(--accent); }
.advantage-num {
  display: block;
  font-family: var(--font-serif);
  color: var(--accent);
  font-size: 1rem;
  margin-bottom: 8px;
}
.advantage h3 {
  font-size: 0.96rem;
  font-weight: 700;
  font-family: var(--font-sans);
  margin-bottom: 6px;
}
.advantage p { color: var(--ink-soft); font-size: 0.88rem; }

/* Footer */
.site-footer { background: var(--dark); color: #cfcfcf; padding-top: 88px; }
.footer-inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 64px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-logo { height: 32px; margin-bottom: 16px; }
.footer-brand p { font-size: 0.9rem; color: var(--dark-soft); max-width: 260px; }
.footer-col h4 {
  font-family: var(--font-sans);
  color: #fff;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 18px;
}
.footer-col p, .footer-col a { font-size: 0.9rem; color: var(--dark-soft); margin-bottom: 10px; display: block; }
.footer-col a:hover { color: #fff; }
.footer-links { display: flex; flex-direction: column; }
.footer-bottom { padding: 24px 0; }
.footer-bottom p { font-size: 0.8rem; color: #6f6f6f; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal.is-open { display: flex; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 15, 0.6);
}
.modal-panel {
  position: relative;
  background: var(--bg);
  max-width: 1080px;
  width: 100%;
  max-height: 88vh;
  overflow: hidden;
  border-radius: var(--radius);
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  font-size: 1.4rem;
  line-height: 1;
  color: var(--ink);
}
/* Модалка общей заявки (кнопка в хэдере) */
.contact-modal-panel { max-width: 460px; }
.contact-modal-body { padding: 44px; }
.contact-modal-body h3 { font-size: 1.4rem; margin-bottom: 10px; }
.contact-modal-body .modal-form-hint { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 26px; }
.contact-modal-body .modal-form { border-top: none; padding-top: 0; }

/* Карточка товара в старой модалке (используется витриной-прототипом /photofit-showroom.html,
   на основном сайте больше не используется — товар открывается отдельной страницей) */
.modal-body {
  max-height: 88vh;
  overflow-y: auto;
}
.modal-hero {
  width: 100%;
  aspect-ratio: 21 / 9;
  overflow: hidden;
  background: var(--bg-alt);
}
.modal-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.modal-hero-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px;
  background: var(--bg-alt);
}
.modal-hero-thumb {
  width: 68px;
  height: 51px;
  padding: 0;
  box-sizing: border-box;
  background: none;
  border: 1.5px solid transparent;
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.modal-hero-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.modal-hero-thumb.is-active { border-color: var(--accent); }
.modal-body-cols {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 56px;
  padding: 48px;
}
.modal-form-col { border-left: 1px solid var(--line); padding-left: 56px; }
.modal-form-col .modal-form { border-top: none; padding-top: 0; }
.modal-category {
  font-size: 0.76rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.modal-specs h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}
.modal-dimensions {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.modal-description {
  color: var(--ink-soft);
  font-size: 0.94rem;
  margin-bottom: 0;
  white-space: pre-line;
}

/* Страница товара: фото слева, описание и заявка справа (десктоп) */
.product-page { padding: 48px 0 100px; }
.product-breadcrumb {
  margin-bottom: 28px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.product-breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.product-breadcrumb a:hover { color: var(--ink); }
.product-page-layout {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 64px;
  align-items: start;
}
.product-page-media { position: sticky; top: 100px; }
.product-page-hero {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-alt);
}
.product-page-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease-out;
}
.product-page-hero { cursor: zoom-in; }
/* Увеличение лупой при наведении — только на устройствах с мышью (см. product.js) */
.product-page-hero.has-zoom:hover img { cursor: zoom-in; }

.product-page-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.product-page-thumb {
  width: 76px;
  height: 58px;
  padding: 0;
  box-sizing: border-box;
  background: none;
  border: 1.5px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.product-page-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-page-thumb.is-active { border-color: var(--accent); }
.product-page-category {
  font-size: 0.78rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.product-page-info h1 {
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  margin-bottom: 12px;
}
.product-page-dimensions-label {
  font-size: 0.72rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.product-page-dimensions {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-bottom: 22px;
}
.product-page-description {
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.6;
  margin-bottom: 32px;
  white-space: pre-line;
}

/* Полноэкранный просмотр фото товара (открывается тапом/кликом по фото) */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox.is-open { display: flex; }
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.92);
}
.lightbox img {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.9);
  font-size: 1.4rem;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
}

.modal-form { border-top: 1px solid var(--line); padding-top: 24px; }
.modal-form h4 {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.modal-form-hint { color: var(--ink-soft); font-size: 0.85rem; margin-bottom: 18px; }
.form-row { margin-bottom: 14px; }
.form-row label {
  display: block;
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.form-row input, .form-row textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.92rem;
  background: #fff;
  color: var(--ink);
}
.form-row input:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-row textarea { resize: vertical; min-height: 72px; }
.form-submit { width: 100%; margin-top: 4px; }
.form-status {
  margin-top: 14px;
  font-size: 0.88rem;
}
.form-status.success { color: #3d7a4f; }
.form-status.error { color: #b3453b; }

/* Всплывающее уведомление об успешной отправке заявки */
.toast-host {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  max-width: 320px;
  box-shadow: 0 14px 32px -12px rgba(14,14,14,0.4);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast-success { background: #3d7a4f; }
.toast-error { background: #b3453b; }

/* Responsive */
@media (max-width: 980px) {
  /* Мобильный баннер: фото на весь экран, подпись поверх снизу слева */
  .hero { display: block; position: relative; min-height: 0; }
  .hero-media { order: 0; }
  .hero-media img { width: 100%; height: 78vh; min-height: 440px; object-position: center; }
  .hero-content {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    align-items: flex-start;
    text-align: left;
    max-width: 480px;
    margin: 0;
    padding: 32px 24px;
    padding-top: 110px;
    background: linear-gradient(0deg, rgba(14,14,14,0.55) 0%, rgba(14,14,14,0) 100%);
    color: #fff;
  }
  .hero-content .eyebrow { color: #fff; opacity: 0.85; }
  .hero h1 { color: #fff; }
  .hero-text { color: rgba(255,255,255,0.85); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .about-inner { grid-template-columns: 1fr; gap: 32px; }
  .about-media { order: -1; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .product-page-layout { grid-template-columns: 1fr; gap: 36px; }
  .product-page-media { position: static; }
  .modal-body-cols { grid-template-columns: 1fr; gap: 32px; padding: 32px 24px; }
  .modal-form-col { border-left: none; padding-left: 0; border-top: 1px solid var(--line); padding-top: 32px; }
  .modal-hero { aspect-ratio: 16 / 10; }
}

@media (max-width: 640px) {
  .container { padding: 0 20px; }
  .product-page { padding: 28px 0 60px; }
  .product-page-layout { gap: 28px; }
  .modal-body-cols { padding: 24px 20px; }
  .toast-host { left: 16px; right: 16px; bottom: 16px; }
  .toast { max-width: none; }
  .nav {
    position: fixed;
    top: 84px;
    left: 0;
    right: 0;
    /* сбрасываем десктопный отступ, иначе панель не доходит до левого края */
    margin-left: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 24px 20px;
    /* панель встаёт вплотную под шапку и перекрывает её нижнюю границу,
       поэтому рисуем разделитель на самой панели */
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    gap: 18px;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease, visibility 0s linear 0.25s;
  }
  .nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.25s ease, opacity 0.25s ease, visibility 0s linear 0s;
  }
  .burger { display: flex; margin-left: auto; }
  .nav-cta { margin-left: 0; margin-top: 4px; text-align: center; }
  .product-grid { grid-template-columns: 1fr; gap: 22px; }
  .catalog, .about { padding: 72px 0; }
  .advantage { flex: 1 1 100%; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .contact-modal-body { padding: 32px 22px; }
  .hero-media img { height: 64vh; min-height: 380px; }
  .hero-content { padding: 24px 20px; padding-top: 80px; }
  .hero .eyebrow { font-size: 0.68rem; margin-bottom: 8px; }
  .hero h1 { font-size: 1.4rem; line-height: 1.25; margin-bottom: 10px; }
  .hero-text { font-size: 0.9rem; line-height: 1.45; margin-bottom: 0; }
  /* CTA скрыта на мобильной: каталог идёт сразу следующим блоком */
  .hero-content .btn { display: none; }
}
