/* ============================================
   СИСТЕМА-ІНВЕСТ — Сторінка «Картонна упаковка»
   Секційні стилі (базові токени/хедер/футер/кнопки/FAQ/hero — у css/style.css).
   Кольори звірені з Figma (iQN4JV3ZDildnnsMdI7Qeu, node 2:8).
   ============================================ */

:root {
  --navy-tile: #022c56;   /* світліша плашка в шаховій сітці */
  --blue-hover: #033e7a;  /* hover-стан плашки технологій */
}

/* ---------- Загальні заголовки сторінки ---------- */
.kt-h2 {                       /* H2 — секційний заголовок: Gilroy 700 · 54px */
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  color: var(--color-navy);
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.15;
  letter-spacing: 0.3px;
}
.kt-h2 .accent { color: var(--color-teal); }
.kt-sub {                      /* ⚠️ theme-only [bugfix 21]: Inter Medium 16 (було Gilroy 600 20) */
  text-align: center;
  max-width: 820px;
  margin: 18px auto 0;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  color: var(--color-navy);
  line-height: 1.5;
}
.kt-label {                    /* H3-подібна мітка: Gilroy 700 · 24px */
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-navy);
  font-size: clamp(20px, 2vw, 24px);
  letter-spacing: 0.3px;
  margin-bottom: 32px;
}

/* Вужчий центрований контент (≈980px) для текстових секцій: tech / result / process / production / cta */
.container-narrow { max-width: 1024px; }

/* ---------- Hero inner-сторінок (Картонна/Фарма — менший, без бейджів) ----------
   ⚠️ Скоуп body:not(.home) — бо kartonna.css вантажиться глобально; без скоупу це
   правило перекривало Hero Головної (padding-top/min-height зі style.css не діяли). */
body:not(.home) .hero-inner {
  min-height: 580px;
  padding-top: 100px;
  padding-bottom: 40px;
  justify-content: center;
}

/* ---------- Хлібні крихти (окрема смуга під hero) ---------- */
.breadcrumb-bar { background: var(--color-bg); padding: 18px 0 0; }
/* Сторінки без Херо: перша секція одразу під крихтами — менший верхній відступ (30 замість 60). */
.si-no-hero .breadcrumb-bar + .section { padding-top: 30px; }
.breadcrumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  font-size: 14px; color: rgba(0,35,67,0.6);
}
.breadcrumbs a { color: rgba(0,35,67,0.6); transition: color var(--transition); }
.breadcrumbs a:hover { color: var(--color-teal); }
.breadcrumbs .sep { color: var(--color-teal); display: inline-flex; }
.breadcrumbs [aria-current] { color: var(--color-teal); }

/* Блок «Якість/ISO» стилізується у style.css (.quality*) — однаковий на всіх сторінках. */

/* ---------- Види картонних упаковок ---------- */
/* ⚠️ theme-only [bugfix 8]: компактніша шапка карток, без min-height підпису;
   відступ між колонками 80px (по Figma), рядковий 40px на випадок переносу */
.types-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px 80px; margin-top: 48px; }
.types-card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition);
}
.types-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card-hover); }
.types-head {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 28px 28px 0;   /* [bugfix 1-повтор]: більший відступ зверху над назвою */
}
.types-card h3 {
  color: var(--color-navy);
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.2;
}
.types-arrow {
  flex-shrink: 0;
  width: 35px; height: 35px; border-radius: var(--radius-sm);
  background: var(--color-teal); color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), transform var(--transition);
}
.types-arrow:hover { background: #017885; transform: translateX(2px); }
/* праве поле 72px резервує колонку стрілки (35px + 28px паддінг) — текст не заходить під стрілку.
   min-height = 2 рядки (2·1.45em) + верт. паддінги (4+8) → плашка-шапка однакова навіть при
   1-рядковому підзаголовку, тож фото обох карток починаються на одній висоті (border-box). */
.types-card p {
  padding: 4px 72px 8px 28px;
  min-height: calc(2.9em + 12px);
  font-size: 16px; color: rgba(0,35,67,0.75); line-height: 1.45;
}
.types-media { aspect-ratio: 550/367; }
.types-media img { width: 100%; height: 100%; object-fit: cover; }
/* Клікабельні фото + назва (посилання на btnUrl). ⚠️ ДОДАНО В ТЕМІ понад статику. */
.types-card h3 a { color: inherit; text-decoration: none; transition: opacity var(--transition); }
.types-card h3 a:hover { opacity: 0.72; }
.types-media a { display: block; width: 100%; height: 100%; }

/* ---------- Технології виробництва ---------- */
.tech-grid { display: grid; grid-template-columns: 379px 1fr; gap: 72px; align-items: start; margin-top: 48px; }
.tech-media { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 379/699; }
.tech-media img { width: 100%; height: 100%; object-fit: cover; }
.tech-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.tech-card {
  border-radius: var(--radius-md);
  padding: 24px 28px;
  min-height: 134px;
  display: flex;
  align-items: center;
  color: #fff;
  font-family: var(--font-body);   /* ⚠️ theme-only [bugfix 9]: Inter SemiBold 16 (було Gilroy 800) */
  font-weight: 600;
  text-transform: uppercase;
  font-size: 16px;
  line-height: 1.3;
  background: var(--color-navy);
  transition: background var(--transition), transform var(--transition);
}
/* Шахова заливка: (рядок+колонка) парні — темна, непарні — світліша */
.tech-card:nth-child(4n+2),
.tech-card:nth-child(4n+3) { background: var(--navy-tile); }
.tech-card:hover { background: var(--blue-hover); transform: translateY(-2px); }

/* ---------- Результат для замовника ---------- */
/* gap між блоком плашок і фото = gap між плашками (20px). ⚠️ ЗМІНЕНО В ТЕМІ проти статики (40px) — перенести в css/kartonna.css верстки. */
.result-layout { display: grid; grid-template-columns: 1fr 200px; gap: 20px; align-items: start; }
.result-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.result-card {
  background: var(--color-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 22px 24px;
  min-height: 100px;
  display: flex; align-items: center; gap: 18px;
}
.result-card .result-icon { flex-shrink: 0; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; }
.result-icon img { width: 100%; height: 100%; object-fit: contain; }
.result-card span:last-child { font-size: 16px; color: var(--color-navy); line-height: 1.35; }   /* ⚠️ theme-only [bugfix 15] */
.result-visual { border-radius: var(--radius-md); overflow: hidden; }
.result-visual img { width: 100%; height: auto; display: block; }

/* ---------- Як ми виробляємо упаковку (flip-картки) ----------
   Лице: світла картка з номером-кружечком + назва кроку.
   Наведення / фокус / тап → переворот, бірюзова сторона з детальним текстом.
   Стійкість до довгого тексту: фіксована висота + overflow-y:auto на звороті. */
.process-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 27px; }
.flip-card { height: 229px; perspective: 1200px; cursor: pointer; }
.flip-card:focus-visible { outline: 2px solid var(--color-teal); outline-offset: 3px; border-radius: var(--radius-md); }
.flip-inner {
  position: relative; width: 100%; height: 100%;
  transition: transform 0.5s ease; transform-style: preserve-3d;
}
.flip-card:hover .flip-inner,
.flip-card:focus-within .flip-inner,
.flip-card.is-flipped .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: var(--radius-md);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 26px 22px; overflow: hidden;
}
/* Цифри всіх карток на одній лінії: фіксований відступ зверху замість центрування
   (при center різна висота підписів зсувала кружечки по вертикалі) */
.flip-front { background: var(--color-card); box-shadow: var(--shadow-card); gap: 22px; justify-content: flex-start; padding-top: 44px; }
.flip-back { background: var(--color-teal); color: #fff; transform: rotateY(180deg); padding: 20px 18px; }
.process-num {
  width: 56px; height: 56px; border-radius: 50%;
  border: 2px solid var(--color-teal); color: var(--color-teal);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-body); font-weight: 400; font-size: 32px; flex-shrink: 0;   /* ⚠️ theme-only [bugfix 10]: Inter Regular 32 (було Gilroy 700 20) */
}
.flip-front h3 {
  font-family: var(--font-body); font-weight: 600; font-size: 16px;   /* ⚠️ theme-only [bugfix 10][15]: Inter 600 16 (було Gilroy 800 15) */
  text-transform: uppercase; line-height: 1.35; color: var(--color-navy);
}
.flip-back p {
  font-size: 16px; line-height: 1.5; max-height: 100%; overflow-y: auto; padding-right: 6px;   /* ⚠️ theme-only [bugfix 11]: 16 (було 14) */
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.7) transparent;
}
.flip-back p::-webkit-scrollbar { width: 4px; }
.flip-back p::-webkit-scrollbar-track { background: transparent; }
.flip-back p::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.55); border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { .flip-inner { transition: none; } }

/* ---------- Метрика компанії (темна плашка на всю ширину) ---------- */
.metrics {
  background: linear-gradient(115deg, #012344 0%, #022c56 45%, #03407e 100%);
  color: #fff;
  padding: 72px 0 88px;
}
.metrics-head { margin-bottom: 56px; }
.metrics-head h2 {
  font-family: var(--font-display); font-weight: 700;   /* H2 = 700 */
  text-transform: uppercase; font-size: clamp(30px, 4vw, 54px);
  margin-bottom: 14px; color: #fff;
}
.metrics-head p {   /* ⚠️ theme-only [bugfix 21]: Inter Medium 16 — той самий тір, що .kt-sub */
  font-family: var(--font-body); font-weight: 500;
  font-size: 16px; color: rgba(255,255,255,0.85);
}
/* ⚠️ theme-only [bugfix 12]: цифри 54, підписи 24, більший відступ між рядами */
.metrics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 64px 32px; }
.metric { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.metric-num { font-family: var(--font-display); font-weight: 600; font-size: clamp(38px, 4vw, 54px); color: var(--color-teal); line-height: 1; }
.metric-label { font-family: var(--font-display); font-weight: 600; font-size: clamp(18px, 2vw, 24px); text-transform: uppercase; color: #fff; letter-spacing: 0.3px; }

/* ---------- Виробництво картонної упаковки ---------- */
.production .kt-sub {
  text-transform: uppercase;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-navy);
  font-size: clamp(17px, 1.8vw, 20px);
  letter-spacing: 0.3px;
}
/* Одне текстове поле; опція 1/2 колонки в налаштуваннях блоку. 2 кол. = CSS multi-column
   (текст рівномірно балансується). ⚠️ ЗМІНЕНО В ТЕМІ проти статики (там .production-col grid). */
.production-body { margin-top: 40px; }
.production-body.cols-2 { columns: 2; column-gap: 88px; }
.production-body p { font-size: 16px; color: rgba(0,35,67,0.8); line-height: 1.5; margin: 0 0 14px; }   /* ⚠️ theme-only [bugfix 13]: 16px + щільніший інтерліньяж (було 15/1.7) */
.production-body p:last-child { margin-bottom: 0; }

/* ---------- CTA ---------- */
.contact-cta-copy h2 {
  font-family: var(--font-display); font-weight: 700;   /* H2 = 700 */
  text-transform: uppercase; font-size: clamp(30px, 4vw, 54px);
  line-height: 1.15; margin-bottom: 20px; color: var(--color-navy);
}
.contact-cta-copy h2 { max-width: 682px; }
.contact-cta-copy h2 .accent { color: var(--color-teal); }
.contact-cta-copy p { color: rgba(0,35,67,0.8); font-size: 16px; margin-bottom: 32px; max-width: 780px; }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1100px) {
  .tech-grid { grid-template-columns: 320px 1fr; gap: 40px; }
  .result-layout { grid-template-columns: 1fr; }
  .result-visual { display: none; }        /* декоративне фото ховаємо на планшеті */
  .production-body.cols-2 { column-gap: 48px; }
}

@media (max-width: 960px) {
  .tech-grid { grid-template-columns: 1fr; gap: 32px; }
  .tech-media { aspect-ratio: 16/10; }
  .process-grid { grid-template-columns: repeat(2, 1fr); }
  .metrics-grid { grid-template-columns: repeat(3, 1fr); gap: 36px 20px; }
}

@media (max-width: 640px) {
  .hero-inner { min-height: 0; padding-top: 120px; padding-bottom: 40px; }
  .types-grid { grid-template-columns: 1fr; }
  .tech-cards { grid-template-columns: 1fr; }
  .result-cards { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 32px 20px; }
  .production-body.cols-2 { columns: 1; }
}

@media (max-width: 400px) {
  .process-grid { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: 1fr; }
}
