:root {
  --bg-main: #FBFBF9;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F3F4F0;
  --border-light: #E4E7E1;
  --border-active: #C8CEC2;

  --text-main: #1D231F;
  --text-muted: #5E6960;
  --text-dim: #8B968D;

  --brand-green: #2B7A4B;
  --brand-green-hover: #22633C;
  --brand-green-light: #EBF5EE;

  --wood-warm: #A06D44;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 12px 32px rgba(29, 35, 31, 0.07);

  --header-height: 84px;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  max-width: 100%;
  *overflow-x: hidden;
  position: relative;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

p, span, strong, h1, h2, h3, h4, a, li {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container-wide {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------------- ШАПКА ---------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 251, 249, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
}

.header-wrap {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.brand img {
  height: 64px;
  width: auto;
  object-fit: contain;
}

.nav-menu {
  display: flex;
  gap: 24px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--brand-green);
}

.header-contacts {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.header-phone {
  color: var(--text-main);
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.header-phone:hover {
  color: var(--brand-green);
}

.btn-cta {
  background: var(--brand-green);
  color: #FFFFFF;
  text-decoration: none;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn-cta:hover {
  background: var(--brand-green-hover);
  transform: translateY(-1px);
}

/* ---------------- HERO ---------------- */
.hero {
  position: relative;
  padding: 100px 0 90px;
  background-color: var(--bg-main);
  background-image: 
    linear-gradient(90deg, 
      rgba(251, 251, 249, 0.98) 0%, 
      rgba(251, 251, 249, 0.92) 42%, 
      rgba(251, 251, 249, 0.65) 65%, 
      rgba(251, 251, 249, 0.15) 85%, 
      rgba(251, 251, 249, 0) 100%),
    url('../image/hero.jpg');
  background-position: right center;
  background-repeat: no-repeat;
  background-size: cover;
  border-bottom: 1px solid var(--border-light);
  z-index: 1;
}

.hero-content {
  max-width: 640px;
  position: relative; 
  z-index: 2;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  background: var(--brand-green-light);
  color: var(--brand-green);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 6px 14px;
  border-radius: 30px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: 46px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.8px;
  margin-bottom: 18px;
  color: var(--text-main);
}

.hero p {
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 34px;
  line-height: 1.6;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px 28px;
  padding-top: 28px;
  border-top: 1px solid var(--border-light);
}

.stat-item span {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--brand-green);
  line-height: 1.1;
}

.stat-item small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

/* ---------------- КАТАЛОГ ---------------- */
.catalog-section {
  padding: 90px 0;
  *overflow: hidden;
}

.section-head {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 36px;
  background: rgba(251, 251, 249, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 28px 20px;
  box-shadow: var(--shadow-sm);
}

.section-head h2 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.section-head p {
  font-size: 16px;
  color: var(--text-muted);
  margin: 0;
}

/* Фильтры */
.filter-bar {
  position: sticky;
  top: var(--header-height);
  z-index: 40;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 12px 0 16px;
  margin-bottom: 30px;
  background: rgba(251, 251, 249, 0.98);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-light);
  width: 100%;
}

.filter-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.filter-btn.active, .filter-btn:hover {
  background: var(--brand-green);
  color: #FFFFFF;
  border-color: var(--brand-green);
}

/* Карточки проектов */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 36px;
  width: 100%;
}

.project-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
  width: 100%;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.project-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-active);
}

.media-col,
.info-col {
  min-width: 0; /* Исключает горизонтальный распор сетки */
}

/* Медиа-колонка */
.media-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.main-view-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--bg-subtle);
}

.main-view-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.main-view-wrap:hover img {
  transform: scale(1.02);
}

.view-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--brand-green);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.zoom-hint {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  pointer-events: none;
}

.thumb-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}

.thumb {
  width: 76px;
  height: 54px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  flex-shrink: 0;
  opacity: 0.75;
  transition: opacity 0.2s, border-color 0.2s;
}

.thumb.active,
.thumb:hover {
  border-color: var(--brand-green);
  opacity: 1;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Колонка с информацией */
.info-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.project-meta-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  gap: 8px;
}

.project-category {
  color: var(--wood-warm);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.project-timeline {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.project-title {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.4px;
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: var(--bg-subtle);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
}

.spec-cell span {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

.spec-cell strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
}

.project-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

.features-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  margin-bottom: 16px;
}

.features-list li {
  font-size: 13px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.features-list li::before {
  content: "✔";
  color: var(--brand-green);
  font-weight: 800;
  font-size: 12px;
}

/* Нижняя панель с линейкой цен и кнопкой */
.project-bottom {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.price-tier-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
  max-width: 270px;
}

.price-tier-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
}

.tier-size {
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.tier-dots {
  flex-grow: 1;
  border-bottom: 1px dotted var(--border-active);
  min-width: 10px;
  position: relative;
  top: -3px;
}

.tier-val {
  color: var(--text-main);
  font-weight: 800;
  font-size: 15px;
  white-space: nowrap;
}

.price-tier-item:first-child .tier-val {
  color: var(--brand-green);
}
/* ---------------- ПРЕИМУЩЕСТВА ---------------- */
.benefits-section {
  position: relative;
  padding: 90px 0;
  background-color: var(--bg-main);
  background-image: url('../image/firm.jpg');
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border-bottom: 1px solid var(--border-light);
  z-index: 1; 
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

.benefit-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 28px 24px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.benefit-num {
  font-size: 13px;
  font-weight: 800;
  color: var(--brand-green);
  margin-bottom: 10px;
}

.benefit-card h3 {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 8px;
}

.benefit-card p {
  font-size: 14px;
  color: var(--text-muted);
}

.banks-box {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.banks-info h3 {
  font-size: 20px;
  margin-bottom: 4px;
}

.banks-info p {
  color: var(--text-muted);
  font-size: 14px;
}

.banks-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.bank-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1;
}

.bank-tag img {
  height: 18px;
  width: auto;
  object-fit: contain;
}

/* ---------------- FAQ ---------------- */
.faq-section {
  padding: 90px 0;
}

.faq-list {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 18px 22px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  gap: 12px;
}

.faq-icon {
  font-size: 20px;
  color: var(--brand-green);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 22px;
  color: var(--text-muted);
  font-size: 15px;
}

.faq-item.active .faq-answer {
  padding-bottom: 20px;
}

/* ---------------- КОНТАКТЫ ---------------- */
.contacts-section {
  padding: 80px 0;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-light);
}

.contacts-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 32px;
  background: var(--bg-surface);
  border-radius: 16px;
  border: 1px solid var(--border-light);
  padding: 36px;
}

.contacts-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.contacts-title {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 6px;
}

.contacts-subtitle {
  color: var(--text-muted);
  font-size: 15px;
}

.contact-block span {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
}

.contact-block strong, .contact-block a {
  display: block;
  color: var(--text-main);
  text-decoration: none;
  margin-top: 4px;
}

.contact-block .adr {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.contact-block .tlf {
  font-size: 30px;
  font-weight: 800;
  color: var(--brand-green);
}

.contact-block a:hover {
  color: var(--brand-green-hover);
}

.contacts-map-wrap {
  width: 100%;
  max-width: 100%;
  min-height: 340px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-light);
}

/* ---------------- ПОДВАЛ ---------------- */
.footer {
  background: #181E1A;
  color: #929D95;
  padding: 30px 0;
  font-size: 14px;
}

.footer-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.footer a {
  color: #D3DDD6;
  text-decoration: none;
  font-weight: 600;
}

.footer a:hover {
  color: #FFFFFF;
}

/* ---------------- LIGHTBOX ---------------- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 20, 18, 0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 94vw;
  max-height: 90vh;
}

.lightbox-content img {
  width: auto;
  max-width: 100%;
  max-height: 88vh;
  border-radius: 8px;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: -42px;
  right: 0;
  color: #fff;
  font-size: 34px;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
}

/* =======================================================
   АДАПТИВ ДЛЯ ПЛАНШЕТОВ (до 1024px)
   ======================================================= */
@media (max-width: 1024px) {
  :root {
    --header-height: 72px;
  }

  .container-wide {
    padding: 0 20px;
  }

  .project-item {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .benefits-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .banks-box {
    flex-direction: column;
    align-items: flex-start;
  }

  .contacts-grid {
    grid-template-columns: 1fr;
  }

  .benefits-section {
    background-attachment: scroll;
  }
}

/* =======================================================
   АДАПТИВ ДЛЯ СМАРТФОНОВ (до 768px и ниже)
   ======================================================= */
@media (max-width: 768px) {
  :root {
    --header-height: 60px;
  }

  .container-wide {
    padding: 0 12px;
    width: 100%;
    max-width: 100%;
  }

  /* Шапка */
  .brand img {
    height: 40px;
  }

  .nav-menu {
    display: none;
  }

  .header-contacts {
    gap: 8px;
  }

  .header-phone {
    font-size: 13px;
  }

  .btn-cta {
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 6px;
  }

  /* Hero */
  .hero {
    padding: 40px 0 35px;
    background-image: 
      linear-gradient(180deg, 
        rgba(251, 251, 249, 0.96) 0%, 
        rgba(251, 251, 249, 0.90) 100%),
      url('../image/hero.jpg');
    background-position: center;
  }

  .hero h1 {
    font-size: 26px;
    line-height: 1.25;
  }

  .hero p {
    font-size: 14px;
    margin-bottom: 24px;
  }

  .hero-stats {
    grid-template-columns: 1fr;
    gap: 14px;
    padding-top: 18px;
  }

  .stat-item span {
    font-size: 22px;
  }

  /* Исправление панели фильтров */
  .filter-bar {
    top: var(--header-height);
    justify-content: flex-start;
    padding: 10px 4px 14px;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .filter-bar::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    padding: 8px 14px;
    font-size: 13px;
    flex-shrink: 0;
  }

  /* Карточки */
  .project-item {
    display: flex;
    flex-direction: column;
    padding: 14px;
    border-radius: 12px;
    gap: 16px;
    width: 100%;
    max-width: 100%;
  }

  .media-col, .info-col {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .main-view-wrap {
    aspect-ratio: 16 / 11;
  }

  .thumb {
    width: 64px;
    height: 48px;
  }

  .project-title {
    font-size: 22px;
    margin-bottom: 12px;
  }

  .specs-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
    width: 100%;
  }

  .project-desc {
    font-size: 14px;
    line-height: 1.5;
  }

  .features-list {
    grid-template-columns: 1fr;
    gap: 6px;
    width: 100%;
  }

  .project-bottom {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: 100%;
  }

  .project-bottom .btn-cta {
    width: 100%;
    padding: 12px;
    font-size: 14px;
  }

  /* Преимущества и банки */
  .benefit-card, .banks-box {
    padding: 20px 14px;
  }

  .banks-tags {
    gap: 6px;
  }

  .bank-tag {
    padding: 6px 10px;
    font-size: 12px;
  }

  /* FAQ */
  .faq-question {
    padding: 14px 16px;
    font-size: 15px;
  }

  .faq-answer {
    padding: 0 16px;
    font-size: 14px;
  }

  /* Контакты */
  .contacts-grid {
    padding: 20px 14px;
    gap: 20px;
  }

  .contacts-title {
    font-size: 24px;
  }

  .contact-block .adr {
    font-size: 14px;
  }

  .contact-block .tlf {
    font-size: 20px !important;
  }

  .contacts-map-wrap {
    min-height: 250px;
  }

  .footer-wrap {
    flex-direction: column;
    text-align: center;
    gap: 8px;
    font-size: 12px;
  }
}

/* =======================================================
   ДЛЯ ОЧЕНЬ УЗКИХ ЭКРАНОВ (iPhone SE, Galaxy Fold 320-375px)
   ======================================================= */
@media (max-width: 380px) {
  .brand img {
    height: 32px;
  }

  .header-contacts .btn-cta {
    display: none; /* скрываем кнопку в шапке, чтобы не ломать строку */
  }

  .header-phone {
    font-size: 14px;
  }

  .hero h1 {
    font-size: 21px;
  }

  .price-box strong {
    font-size: 20px;
  }
}