:root{
  --bg: #FFFFFF;
  --accent: #4D3E3E; /* основной текст и тёмный цвет */
  --footer: #162897;
  --muted: #7b7676;
  --card-bg: #FFFFFF;
  --max-width: 1200px; /* контейнер */
}

/* Use border-box globally to avoid unexpected overflow from padding/margins */
*, *:before, *:after { box-sizing: border-box; }

/* Локальный шрифт Gantari */
@font-face{
  font-family: "Gantari";
  src: url("assets/fonts/Gantari-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face{
  font-family: "Gantari";
  src: url("assets/fonts/Gantari-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

body{
  margin:0;
  font-family: "Gantari", Arial, sans-serif;
  background: var(--bg);
  color: var(--accent);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height: 1.5;
}

/* Применяем шрифт Gantari ко всем элементам */
*, *:before, *:after {
  font-family: "Gantari", Arial, sans-serif;
}

/* контейнер */
.container{
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* header */
.site-header{
  border-bottom: 1px solid rgba(77,62,62,0.06);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0;
  flex-wrap: wrap;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 300px;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-section img {
  width: 81px;
  height: auto;
  display: block;
}

.company-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.company-name {
  font-size: 29px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--accent);
}

.company-location {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--accent);
}

.header-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 300px;
  text-align: right;
}

.header-contacts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.header-contacts a {
  color: var(--accent);
  text-decoration: none;
}

.header-contacts a:hover {
  text-decoration: underline;
}

/* main */
.main {
  padding: 30px 0 60px;
  min-width: 100%; /* обеспечиваем, что основной контент не будет сжиматься уже ширины экрана */
}

/* Улучшения для мобильных устройств */
@media (max-width: 768px) {
  .main {
    padding: 20px 0 40px;
  }

  .container {
    padding: 0 12px;
  }

  .equipment-section {
    grid-template-columns: 1fr;
  }

  /* Улучшаем читаемость на мобильных */
  .equipment-text ul li,
  .product-text ul li {
    font-size: 14px;
    line-height: 1.5;
  }

  /* Улучшаем кнопки для тач-устройств */
  .toggle-btn {
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
  }

  /* Улучшаем доступность для тач-интерфейса */
  a,
  button,
  .product-image {
    touch-action: manipulation;
  }
}

/* Дополнительные улучшения для маленьких экранов */
@media (max-width: 480px) {
  .main {
    padding: 15px 0 30px;
  }

  .company-name {
    font-size: 18px;
  }

  .company-location {
    font-size: 12px;
  }

  .office-phone,
  .client-phones {
    font-size: 13px;
  }

  .price-table th,
  .price-table td {
    padding: 6px;
    font-size: 12px;
  }
}

/* equipment and orders section */
.equipment-and-orders-section {
  position: relative;
  margin-bottom: 30px;
  overflow: visible; /* обеспечиваем, чтобы псевдо-элемент не обрезался */
}

.equipment-and-orders-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: -90px; /* увеличиваем смещение вниз, чтобы охватить блок заказов */
  background-image: url('assets/building.jpg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  opacity: 0.1;
  z-index: -1;
}

/* equipment section */
.equipment-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-bottom: 30px;
  position: relative;
  z-index: 1;
}

.equipment-left {
  display: flex;
  flex-direction: column;
}

.equipment-text h3 {
  font-size: 18px;
  margin: 0 0 10px;
  color: var(--accent);
}

.equipment-text ul {
  padding-left: 20px;
  margin: 0 0 10px 0;
  color: var(--accent);
  list-style: none;
}

.equipment-text li {
  margin-bottom: 5px;
  line-height: 1.4;
  position: relative;
  padding-left: 20px;
}

.equipment-text li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

.equipment-text p {
  margin: 10px 0;
  color: var(--accent);
}

.equipment-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.building-photo {
  overflow: hidden;
  margin-bottom: 10px;
}

.building-photo img {
  width: 100%;
  height: auto;
  display: block;
}

.location-info h4 {
  margin: 0 0 5px 0;
  font-size: 16px;
  color: var(--accent);
}

.location-info p {
  margin: 0 0 5px 0;
  font-size: 14px;
  color: var(--accent);
  line-height: 1.4;
}

/* orders section */
.orders-section {
  margin: 30px 0;
  padding: 15px;
  background: #f8f8f8;
  border-radius: 6px;
  position: relative;
  z-index: 1;
  word-wrap: break-word; /* обеспечиваем перенос длинных слов */
  overflow-wrap: break-word;
}

.orders-section h3 {
  margin: 0 0 10px 0;
  font-size: 18px;
  color: var(--accent);
}

.orders-section p {
  margin: 0;
  color: var(--accent);
  line-height: 1.5;
  word-break: break-word; /* разбиваем длинные слова при необходимости */
}

/* license section */
.license-section {
  margin: 20px 0;
  padding: 15px;
  border: 2px solid red;
  border-radius: 6px;
}

.license-section p {
  margin: 0;
  color: red;
  font-weight: bold;
  text-align: center;
  line-height: 1.4;
}

/* pricing section */
.pricing-section {
  margin: 30px 0;
}

.toggle-row {
  display: flex;
  justify-content: center;
  margin: 1.25rem 0;
  width: 100%;
  text-align: center;
}

.toggle-btn {
  background: linear-gradient(180deg, #ffffff, #fbfbfb);
  border: 2px solid #4D3E3E;
  color: #4D3E3E;
  font-weight: 800;
  padding: 0.9rem 1.5rem;
  border-radius: 12px;
  cursor: pointer;
  display: block;
  width: 100%;
  font-size: 1.047rem; /* уменьшено на 15%: 1.22 * 0.85 = 1.047 */
  text-align: center;
  transition: transform .12s ease, box-shadow .16s ease;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.toggle-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.12);
}

@media (max-width: 480px) {
  .toggle-btn {
    font-size: 0.93rem; /* уменьшено на 15%: 1.08 * 0.85 = 0.918 ≈ 0.93 */
    padding: 0.95rem 1rem;
  }
}

/* brief attention pulse animation (applied via JS once) */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.035); }
  100% { transform: scale(1); }
}
.toggle-btn.pulse {
  animation: pulse 2s ease-in-out 1;
}

.price-panel {
  margin-top: 12px;
  padding: 16px;
  background: #f8f8f8;
  border-radius: 6px;
}

.price-panel.hidden {
  display: none;
}

.price-warning {
  background: #fff9e6;
  border-left: 4px solid #f57c00;
  padding: 12px;
  margin-bottom: 16px;
  border-radius: 4px;
  font-size: 14px;
  color: #856404;
}

.price-table-wrapper {
  overflow-x: auto;
  max-height: none;
  overflow-y: visible;
}

.price-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  table-layout: auto;
}

.price-table thead {
  background: #e8f0ff;
  border-bottom: 2px solid #90caf9;
}

.price-table thead th {
  padding: 12px;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid #d0d8e0;
}

.price-table tbody tr {
  border-bottom: 1px solid #e0e0e0;
}

.price-table tbody tr:hover {
  background: #f5f5f5;
}

.price-table tbody td {
  padding: 12px;
  font-size: 15px;
  color: var(--accent);
  border: 1px solid #e0e0e0;
}

/* product sections */
.product-section {
  margin: 30px 0;
  page-break-inside: avoid;
  break-inside: avoid;
}

.product-section h2,
.product-section h3 {
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
  margin: 20px 0 10px 0;
}

.product-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

/* Ensure text content doesn't overflow its container */
.product-text {
  min-width: 0; /* Allows flex item to shrink below content size */
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.product-text {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.product-text ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-text li {
  font-size: 16px;
  color: var(--accent);
  line-height: 1.5;
  padding-left: 20px;
  position: relative;
}

.product-text li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: green;
  font-weight: bold;
}

.product-text p {
  font-size: 16px;
  color: var(--accent);
  line-height: 1.6;
  margin: 0 0 10px 0;
}

.product-text h4 {
  margin: 0 0 10px 0;
  font-size: 18px;
  color: var(--accent);
  font-weight: 600;
}

.product-image {
  display: block;
  overflow: hidden;
  border-radius: 6px;
  min-height: 220px;
  max-width: 420px;
  margin: 0 auto;
}

.product-image img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

/* announcement under product image */
.product-image .product-announcement {
  margin-top: 12px;
  padding: 10px 14px;
  background: #f0ebe5;
  border: 1px solid #d4c5b5;
  border-radius: 6px;
  text-align: center;
  font-size: 14px;
  color: var(--accent);
  font-weight: 500;
}

/* gallery for product section */
.product-gallery {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 30px;
  flex-wrap: wrap;
}

.gallery-item {
  flex: 0 1 calc(33.333% - 20px);
  min-width: 200px;
  max-width: 300px;
}

.gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  transition: transform 0.2s;
}

.gallery-item img:hover {
  transform: scale(1.03);
}

/* footer */
.site-footer{
  margin-top: 60px;
  background: #4D3E3E;
  color: #fff;
  padding: 34px 0;
}
.footer-inner{
  display:flex;
  gap:30px;
  align-items:flex-start;
  color:#fff;
}
.footer-left, .footer-right{
  flex:1;
}
.footer-left h4, .footer-right h4{
  margin:0 0 8px;
  font-size:18px;
  font-weight:600;
  color: #fff;
}
.footer-left p, .footer-right p{
  font-size:15px;
  color: #fff;
  opacity:0.95;
  line-height:1.5;
  margin:0;
}
.footer-left p a, .footer-right p a{
  color: #fff;
  text-decoration: none;
  transition: opacity 0.2s;
}
.footer-left p a:hover, .footer-right p a:hover{
  text-decoration: underline;
  opacity: 1;
}
.footer-right .small{
  opacity:0.85;
  font-size:13px;
  margin-top:10px;
}

/* Make <address> in footer non-italic and use the same font weight/style as nearby text */
.site-footer address {
  font-style: normal; /* override browser default italic */
  font-family: inherit;
  font-weight: 400;
  color: #fff;
  opacity: 0.95;
}

/* small screens */
@media (max-width: 980px){
  :root{ --max-width: 920px; }

  .equipment-section {
    grid-template-columns: 1fr;
  }

  .equipment-and-orders-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: -200px; /* увеличиваем смещение вниз для адаптивности */
    background-image: url('assets/building.jpg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    opacity: 0.1;
    z-index: -1;
  }

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

  .product-image {
    max-width: 100%;
  }
}

@media (max-width: 720px){
  :root{ --max-width: 100%; }

  .container{ padding: 0 16px; }

  .header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }

  .header-left, .header-right {
    min-width: auto;
  }

  .equipment-and-orders-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: -250px; /* ещё больше увеличиваем смещение вниз для адаптивности */
    background-image: url('assets/building.jpg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    opacity: 0.1;
    z-index: -1;
  }

  .footer-inner{ flex-direction:column; gap:18px; }

  /* Price toggle full-width on small screens */
  .toggle-row{ display:block; margin-top:12px; }
}

/* Improved small-screen adjustments */
@media (max-width: 480px){
  :root{ --max-width: 100%; }
  .container{ padding: 0 12px; }

  /* Stack header content vertically for small phones */
  .header-inner{
    padding: 12px 0;
  }

  .logo-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .logo-section img {
    width: 60px;
  }

  .company-name {
    font-size: 20px;
  }

  .company-location {
    font-size: 14px;
  }

  /* Price toggle full-width on small screens */
  .toggle-row{ display:block; margin-top:12px; }
  /* Reduce paddings in cards and table for narrow screens */
  .price-table thead th, .price-table tbody td{ padding:8px; font-size:13px; }

  /* Adjust background for small screens */
  .equipment-and-orders-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: -300px; /* больше увеличиваем смещение для очень маленьких экранов */
    background-image: url('assets/building.jpg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    opacity: 0.1;
    z-index: -1;
  }
}

/* SEO & Performance Optimization */
/* Улучшение Core Web Vitals для SEO */

/* Минимизация CLS (Cumulative Layout Shift) */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Оптимизация отрисовки текста */
.site-header,
.main,
.site-footer {
  font-display: swap;
}

/* Быстрая загрузка критического контента */
.equipment-left {
  contain: content;
}

/* Оптимизация производительности для мобильных */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}