/* ==========================================================================
   1. ЗМІННІ ТА БАЗОВІ СТИЛІ (:root, reset)
   ========================================================================== */
:root {
  --blue: #005BBB;
  --blue-rgb: 0, 91, 187;
  --dark: #222120;
  --orange: #FF8A00;
  --light: #f5f7fa;
  --text: #020101;
  --radius: 18px;
  --shadow: 0 12px 30px rgba(0,0,0,.12);
  --speed: .3s;
  --header-height: 78px;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  max-width: 100% !important;
  overflow-x: hidden !important;
  position: relative;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  font-family: 'Open Sans', sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.7;
}

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

.container {
  width: min(92%, 1200px);
  margin-inline: auto;
}

.section {
  padding: 90px 0;
}

.light { background: var(--light); }
.dark { background: var(--dark); color: #fff; }

.section-title {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 800;
  text-align: center;
  margin-bottom: 12px;
  line-height: 1.2;
}

.section-subtitle {
  text-align: center;
  color: #666;
  max-width: 600px;
  margin: 0 auto 50px;
  font-size: clamp(14px, 2vw, 16px);
}

.dark .section-subtitle { color: #aaa; }

/* ==========================================================================
   2. КНОПКИ (.btn)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 700;
  border-radius: 50px;
  text-decoration: none;
  transition: all var(--speed) ease;
  cursor: pointer;
  border: none;
}

.btn.primary {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 6px 20px rgba(255,138,0,.3);
}
.btn.primary:hover {
  background: #e07b00;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255,138,0,.4);
}

.btn.secondary {
  background: rgba(255,255,255,.15);
  color: #fff;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255,255,255,.3);
}
.btn.secondary:hover {
  background: #fff;
  color: var(--dark);
  transform: translateY(-2px);
}

/* ==========================================================================
   3. ШАПКА САЙТУ (.header)
   ========================================================================== */
.header {
  position: fixed;
  top: 0; left: 0; width: 100%;
  height: var(--header-height);
  background: rgba(255,255,255,.95);
  box-shadow: 0 2px 20px rgba(0,0,0,.05);
  z-index: 1000;
  transition: all var(--speed) ease;
  display: flex;
  align-items: center;
}

.header-scrolled {
  height: 68px;
  background: #fff;
  box-shadow: 0 4px 25px rgba(0,0,0,.08);
}

.header-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--dark);
}
.logo img {
  height: 48px;
  width: auto;
  transition: height var(--speed) ease;
}
.header-scrolled .logo img { height: 42px; }

.logo-text { display: flex; flex-direction: column; }
.brand-name {
  font-family: 'Montserrat', sans-serif;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
}
.brand-name .accent { color: var(--orange); }
.brand-desc {
  font-size: 11px;
  color: #666;
  letter-spacing: .5px;
}

.nav { display: flex; gap: 30px; }
.nav a {
  text-decoration: none;
  color: var(--dark);
  font-weight: 600;
  font-size: 15px;
  transition: color var(--speed) ease;
  position: relative;
}
.nav a::after {
  content: '';
  position: absolute;
  bottom: -6px; left: 0; width: 0; height: 2px;
  background: var(--orange);
  transition: width var(--speed) ease;
}
.nav a:hover { color: var(--orange); }
.nav a:hover::after { width: 100%; }

.header-contacts { display: flex; align-items: center; gap: 20px; }
.header-phone {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--dark);
  font-weight: 700;
  font-size: 15px;
}
.phone-icon { width: 18px; height: 18px; fill: var(--orange); }

.btn-callback {
  padding: 10px 20px;
  border: 2px solid var(--orange);
  color: var(--orange);
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  transition: all var(--speed) ease;
}
.btn-callback:hover {
  background: var(--orange);
  color: #fff;
}

.burger {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1100;
}
.burger span {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--dark);
  border-radius: 3px;
  transition: all var(--speed) ease;
}

/* ==========================================================================
   4. ГОЛОВНИЙ БАНЕР (.hero)
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  padding-top: calc(var(--header-height) + 50px);
  padding-bottom: 70px;
  background: url('image/%D0%B2%D0%BE%D1%80%D0%BE%D1%82%D0%B0%20%D1%84%D0%BE%D1%82%D0%BE%20%D0%B3%D0%BE%D0%BB%D0%BE%D0%B2%D0%BD%D0%B0%202%20%D0%B2%D0%B0%D1%80%D1%96%D0%B0%D0%BD%D1%82.jpeg') center/cover no-repeat;
  display: flex;
  align-items: center;
  color: #fff;
}

.hero-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(90deg, rgba(34, 33, 32, 0.75) 0%, rgba(34, 33, 32, 0.2) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 650px;
}

.badge {
  display: inline-block;
  background: rgba(255, 138, 0, 0.2);
  color: var(--orange);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 138, 0, 0.4);
  backdrop-filter: blur(4px);
}

.hero h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hero p {
  font-size: clamp(16px, 2vw, 18px);
  color: #f0f0f0;
  margin-bottom: 35px;
  line-height: 1.6;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}

.hero-buttons { 
  display: flex; 
  gap: 20px; 
  flex-wrap: wrap; 
}

/* ==========================================================================
   5. ОНОВЛЕНИЙ КОНСТРУКТОР КВІЗУ
   ========================================================================== */
.gate-constructor {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
  border: 1px solid #ced4da;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  box-shadow: inset 0 4px 10px rgba(0,0,0,0.05);
  padding: 20px;
  position: sticky;
  top: 20px;
  --gate-color: #FFFFFF;
}

.gate-frame {
  width: 100%;
  height: 100%;
  border: 10px solid #212529;
  border-radius: 4px;
  background: #111;
  position: relative;
  box-shadow: 0 12px 24px rgba(0,0,0,0.15), inset 0 2px 5px rgba(0,0,0,0.5);
  overflow: hidden;
}

#gate-filling {
  width: 100%;
  height: 100%;
  background: var(--gate-color) !important;
  transition: background 0.4s ease, background-color 0.4s ease;
  position: relative;
  z-index: 1;
}

.texture-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: 5;
  background-image: linear-gradient(to bottom, 
      rgba(0,0,0,0.25) 0px, transparent 3px, 
      transparent calc(25% - 3px), rgba(0,0,0,0.3) 25%, rgba(255,255,255,0.08) calc(25% + 2px),
      transparent calc(50% - 3px), rgba(0,0,0,0.3) 50%, rgba(255,255,255,0.08) calc(50% + 2px),
      transparent calc(75% - 3px), rgba(0,0,0,0.3) 75%, rgba(255,255,255,0.08) calc(75% + 2px)
  );
  box-shadow: inset 0 15px 30px rgba(0,0,0,0.15), inset 0 -15px 30px rgba(0,0,0,0.15);
}

.panel-toprib #gate-filling::before {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;
  background: linear-gradient(to bottom, transparent calc(12.5% - 2px), rgba(0,0,0,0.4) 12.5%, rgba(255,255,255,0.1) calc(12.5% + 1px), transparent calc(12.5% + 3px));
  background-size: 100% 25%;
}
.panel-midrib #gate-filling::before {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;
  background: linear-gradient(to bottom, transparent calc(50% - 2px), rgba(0,0,0,0.4) 50%, rgba(255,255,255,0.1) calc(50% + 1px), transparent calc(50% + 3px));
  background-size: 100% 25%;
}
.panel-rib #gate-filling::before {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;
  background: linear-gradient(to bottom, rgba(0,0,0,0.15) 1px, transparent 2px);
  background-size: 100% 12px;
}
.panel-macrorib #gate-filling::before {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;
  background: linear-gradient(90deg, rgba(0,0,0,0.04) 50%, transparent 50%), linear-gradient(to bottom, rgba(0,0,0,0.12) 50%, transparent 50%);
  background-size: 20px 100%, 100% 16px;
}
.panel-microrib #gate-filling::before {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;
  background: linear-gradient(to bottom, rgba(0,0,0,0.1) 50%, transparent 50%);
  background-size: 100% 4px;
}
.panel-cassette #gate-filling::before {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;
  background-image: linear-gradient(to right, rgba(0,0,0,0.3) 2px, transparent 3px, transparent calc(33.3% - 3px), rgba(0,0,0,0.3) calc(33.3% - 1px)),
                     linear-gradient(to bottom, rgba(0,0,0,0.3) 2px, transparent 3px, transparent calc(50% - 3px), rgba(0,0,0,0.3) calc(50% - 1px));
  background-size: 33.3% 25%;
}

.texture-stucco #gate-filling::after {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0.12; pointer-events: none; z-index: 2;
  background-image: radial-gradient(#000 25%, transparent 26%), radial-gradient(#000 25%, transparent 26%);
  background-size: 3px 3px; background-position: 0 0, 1.5px 1.5px;
}
.texture-woodgrain #gate-filling::after {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0.07; pointer-events: none; z-index: 2;
  background: repeating-linear-gradient(10deg, #000, #000 2px, transparent 2px, transparent 15px),
              repeating-linear-gradient(-5deg, transparent, transparent 5px, rgba(0,0,0,0.5) 5px, rgba(0,0,0,0.5) 7px);
}

/* ==========================================
   ДИНАМІЧНІ ТИПИ ВОРІТ ТА МЕХАНІЗМИ
   ========================================== */

/* Стулки воріт */
.gate-leaf {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.leaf-left { left: 0; }
.leaf-right { right: 0; }

/* Приховуємо всі механізми за замовчуванням */
.mechanism {
    display: none;
    position: absolute;
    pointer-events: none;
    z-index: 10;
}

/* ------------------------------------------
   1. ГАРАЖНІ СЕКЦІЙНІ ТА ПРОМИСЛОВІ
   ------------------------------------------ */
/* Торсійний вал з пружиною зверху */
.type-garage .section-spring,
.type-industrial .section-spring {
    display: block;
    top: -6px;
    left: 10%;
    width: 80%;
    height: 8px;
    background: linear-gradient(90deg, #333, #777, #333, #777, #333);
    border-radius: 4px;
    border: 1px solid #111;
}

/* Напрямні шини по боках */
.type-garage .section-tracks,
.type-industrial .section-tracks {
    display: block;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-left: 3px solid #ffcc00;
    border-right: 3px solid #ffcc00;
    box-sizing: border-box;
}

.type-garage .leaf-left, .type-garage .leaf-right,
.type-industrial .leaf-left, .type-industrial .leaf-right {
    display: none;
}

/* ------------------------------------------
   2. В'ЇЗНІ ВІДКАТНІ
   ------------------------------------------ */
.type-entrance .leaf-left,
.type-entrance .leaf-right {
    display: none;
}

/* Нижній консольний рельс та зубчаста рейка */
.type-entrance .gate-rail {
    display: block;
    bottom: -8px;
    left: -25%;
    width: 150%;
    height: 8px;
    background: #444;
    border-top: 2px dashed #ffcc00; /* Зубчаста рейка */
}

/* Привід (двигун) відкатних воріт знизу праворуч */
.type-entrance .sliding-motor {
    display: block;
    bottom: 2px;
    right: -14px;
    width: 14px;
    height: 22px;
    background: #222;
    border: 1px solid #ffcc00;
    border-radius: 3px 3px 0 0;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

/* ------------------------------------------
   3. В'ЇЗНІ РОЗПАШНІ
   ------------------------------------------ */
.type-swing .leaf-left {
    display: block;
    border-right: 3px solid #111;
    box-shadow: inset -2px 0 5px rgba(0,0,0,0.3);
}

.type-swing .leaf-right {
    display: block;
    border-left: 1px solid rgba(255,255,255,0.2);
}

/* Бокові завіси (петлі) */
.type-swing .gate-frame::before,
.type-swing .gate-frame::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 16px;
    background: #ffcc00;
    left: -10px;
    border-radius: 2px;
    z-index: 15;
}
.type-swing .gate-frame::before { top: 20%; }
.type-swing .gate-frame::after { bottom: 20%; }

/* Лінійні автоматичні приводи (автоматика на стулках) */
.type-swing .swing-arm {
    display: block;
    top: 50%;
    width: 60%;
    height: 5px;
    background: #222;
    border: 1px solid #ffcc00;
    border-radius: 3px;
    transform: translateY(-50%);
}

.type-swing .arm-left { left: 5px; }
.type-swing .arm-right { right: 5px; }

/* ==========================================================================
   6. ЕТАПИ РОБОТИ (.workflow-section)
   ========================================================================== */
.section-header { text-align: center; margin-bottom: 60px; }
.section-header h2 { font-family: 'Montserrat', sans-serif; font-size: 32px; font-weight: 800; margin-bottom: 15px; }
.section-header p { color: #666; font-size: 16px; }

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 25px;
}

.workflow-card {
  background: #fff;
  padding: 30px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  transition: transform var(--speed) ease;
  border: 1px solid #f0f0f0;
}
.workflow-card:hover { transform: translateY(-5px); }

.workflow-number {
  position: absolute;
  top: 15px; right: 20px;
  font-family: 'Montserrat', sans-serif;
  font-size: 36px;
  font-weight: 800;
  color: rgba(255,138,0,.1);
}

.workflow-icon { font-size: 32px; margin-bottom: 15px; }
.workflow-card h3 { font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.workflow-card p { font-size: 14px; color: #555; line-height: 1.5; }

/* ==========================================================================
   7. КАРТКИ ПОСЛУГ (.cards)
   ========================================================================== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 25px;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--speed) ease;
  border: 1px solid #eef1f5;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-5px); }

.card-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #eaedf2;
}

.card-main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-badge {
  position: absolute;
  top: 15px; left: 15px;
  background: #2ECC71;
  color: #fff;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 700;
  z-index: 5;
}

.card-body { padding: 25px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { font-family: 'Montserrat', sans-serif; font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.card-body p { color: #555; font-size: 14px; margin-bottom: 20px; line-height: 1.6; }

.card-features { list-style: none; margin-bottom: 25px; margin-top: auto; }
.card-features li { font-size: 13.5px; color: #444; margin-bottom: 8px; font-weight: 600; }

.card-btn { background: #f0f3f7; color: var(--dark); width: 100%; }
.card-btn:hover { background: var(--orange); color: #fff; }

/* ==========================================================================
   8. ПЕРЕВАГИ (.about-grid)
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.about-item { display: flex; flex-direction: column; align-items: center; text-align: center; }

.about-icon-box {
  width: 70px; height: 70px;
  background: #fff;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0,0,0,.04);
  margin-bottom: 20px;
  border: 1px solid #eef1f5;
}

.about-icon { width: 32px; height: 32px; fill: var(--orange); }
.about-item h3 { font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.about-item p { color: #666; font-size: 14px; max-width: 280px; }

/* ==========================================================================
   9. ГАЛЕРЕЯ ПРОЄКТІВ (.projects-grid)
   ========================================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
}

.projects-more-grid {
  display: none;
  margin-top: 30px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.projects-more-grid.active {
  display: grid;
  opacity: 1;
  transform: translateY(0);
}

.project-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--speed) ease;
  cursor: pointer;
}

.project-card:hover {
  transform: translateY(-5px);
}

.project-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #eaedf2;
}

.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-badge {
  position: absolute;
  top: 15px; right: 15px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(4px);
  z-index: 5;
}

.project-location {
  position: absolute;
  bottom: 15px; left: 15px;
  background: rgba(0,0,0,.7);
  color: #fff;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  backdrop-filter: blur(4px);
  z-index: 5;
}

.project-info { padding: 25px; }
.project-info h3 { font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.project-meta { font-size: 13px; color: #666; font-weight: 600; }

.btn-open-gallery {
  margin-top: 15px;
  width: 100%;
  padding: 10px;
  background: #f1f3f5;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--dark);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-open-gallery:hover {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}

.projects-more-wrap {
  text-align: center;
  margin-top: 40px;
}

.projects-more-btn {
  background: #fff;
  color: var(--dark);
  border: 2px solid var(--orange);
  padding: 14px 32px;
  font-weight: 700;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.projects-more-btn:hover {
  background: var(--orange);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255, 138, 0, 0.3);
}

.more-btn-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  transition: transform 0.3s ease;
}

.projects-more-btn.active .more-btn-icon {
  transform: rotate(180deg);
}

/* МОДАЛЬНЕ ВІКНО ГАЛЕРЕЇ */
.gallery-modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.gallery-modal.active {
  opacity: 1;
  visibility: visible;
}

.gallery-modal-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
}

.gallery-modal-content {
  position: relative;
  z-index: 2;
  width: min(90%, 900px);
  background: #181716;
  border-radius: 16px;
  padding: 25px;
  color: #fff;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.gallery-modal-close {
  position: absolute;
  top: 15px; right: 20px;
  background: none; border: none;
  color: #fff; font-size: 32px;
  cursor: pointer; line-height: 1;
}

.gallery-modal-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 20px;
  margin-bottom: 20px;
  padding-right: 40px;
}

.gallery-media-view {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-media-view img {
  width: 100%; height: 100%;
  object-fit: contain;
}

.gallery-media-view iframe,
.gallery-media-view video {
  width: 100%; height: 100%;
  border: none;
}

.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
}

.gallery-prev-btn, .gallery-next-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff; border: none;
  padding: 10px 20px; border-radius: 30px;
  font-size: 18px; cursor: pointer;
  transition: background 0.2s;
}

.gallery-prev-btn:hover, .gallery-next-btn:hover {
  background: var(--orange);
}

.gallery-counter {
  font-weight: 700;
  font-size: 14px;
}

/* ==========================================================================
   10. ВІДГУКИ КЛІЄНТІВ (.reviews-grid)
   ========================================================================== */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
}

.review-card {
  background: #ffffff;
  border-radius: var(--radius, 18px);
  padding: 28px;
  box-shadow: var(--shadow, 0 12px 30px rgba(0,0,0,.12));
  border: 1px solid #eef1f5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform var(--speed, 0.3s) ease;
}

.review-card:hover {
  transform: translateY(-4px);
}

.review-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.review-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--orange, #FF8A00);
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.review-author h4 {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--dark, #222120);
  margin-bottom: 2px;
}

.review-city {
  font-size: 12px;
  color: #777777;
  display: block;
}

.review-rating {
  margin-left: auto;
  color: #FFC107;
  font-size: 16px;
  letter-spacing: 2px;
}

.review-text {
  font-size: 14px;
  color: #444444;
  line-height: 1.6;
  margin-bottom: 20px;
  font-style: italic;
}

.review-date {
  font-size: 12px;
  color: #999999;
  font-weight: 600;
}

/* ==========================================================================
   11. ЧАСТІ ЗАПИТАННЯ - FAQ (.faq-accordion)
   ========================================================================== */
.faq-accordion {
  max-width: 850px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.faq-item {
  border: 1px solid #eef1f5;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 15px rgba(0,0,0,0.02);
  transition: border-color var(--speed) ease;
}

.faq-item.active {
  border-color: var(--orange);
}

.faq-question {
  width: 100%;
  padding: 20px 24px;
  background: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  cursor: pointer;
  transition: background var(--speed) ease;
}

.faq-question:hover {
  background: #fafafa;
}

.faq-icon {
  font-size: 22px;
  font-weight: 700;
  color: var(--orange);
  transition: transform var(--speed) ease;
  line-height: 1;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  background: #fff;
}

.faq-item.active .faq-answer {
  max-height: 300px;
  padding: 0 24px 20px 24px;
}

.faq-answer p {
  color: #555;
  font-size: 14.5px;
  line-height: 1.6;
}

/* ==========================================================================
   12. СЕКЦІЯ КОНТАКТІВ ТА СОЦМЕРЕЖІ
   ========================================================================== */
.contacts-wrapper {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 50px;
  align-items: start;
}

.contacts-info h2 { font-family: 'Montserrat', sans-serif; font-size: 32px; font-weight: 800; margin-bottom: 30px; }
.contacts-block { margin-bottom: 25px; }
.contacts-block h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: #888; margin-bottom: 8px; }
.contacts-block p a { color: #fff; text-decoration: none; font-size: 18px; font-weight: 700; }
.contacts-block p a:hover { color: var(--orange); }

.social-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 15px;
  max-width: 460px;
  width: 100%;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 18px;
  height: 44px;
  border-radius: 50px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform var(--speed) ease, box-shadow var(--speed) ease, background-color var(--speed) ease;
  width: 100%;
}

.social-btn svg {
  width: 20px !important;
  height: 20px !important;
  margin-right: 8px;
  fill: #ffffff !important;
  flex-shrink: 0;
  display: inline-block;
}

.social-btn span { color: #ffffff !important; line-height: 1; }

.social-btn.telegram { background-color: #26A5E4; }
.social-btn.telegram:hover { background-color: #1e87c4; }
.social-btn.viber { background-color: #7360F2; }
.social-btn.viber:hover { background-color: #5b4bc4; }
.social-btn.instagram { background-color: #E1306C; }
.social-btn.instagram:hover { background-color: #b82354; }
.social-btn.facebook { background-color: #1877F2; }
.social-btn.facebook:hover { background-color: #115cc4; }

.social-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.contacts-form-wrapper { background: #1a1918; padding: 40px; border-radius: var(--radius); }
.contacts-form-wrapper h3 { font-family: 'Montserrat', sans-serif; font-size: 22px; margin-bottom: 25px; }

.contact-form .form-group { margin-bottom: 20px; }
.contact-form input, .contact-form textarea {
  width: 100%; background: #2a2928; border: 1px solid #3a3938;
  padding: 14px 20px; color: #fff; border-radius: 8px; font-size: 15px;
}
.contact-form textarea { height: 120px; resize: none; }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--orange); outline: none; }
.contact-form .btn { width: 100%; }

/* ==========================================================================
   13. ФУТЕР САЙТУ
   ========================================================================== */
.footer { background: #181716; color: #aaa; padding: 70px 0 30px; font-size: 14px; border-top: 1px solid #282726; }
.footer-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 40px; margin-bottom: 50px; }

.footer-col h3 { font-family: 'Montserrat', sans-serif; color: #fff; font-size: 16px; margin-bottom: 20px; font-weight: 700; }
.footer-logo { font-family: 'Montserrat', sans-serif; color: #fff; font-size: 22px; font-weight: 800; display: block; margin-bottom: 15px; }
.footer-schedule { margin-top: 15px; color: #666; font-weight: 600; line-height: 1.5; }

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 12px; }
.footer-links a { color: #aaa; text-decoration: none; transition: color var(--speed) ease; }
.footer-links a:hover { color: #fff; }

.footer-contacts-list { list-style: none; }
.footer-contacts-list li { margin-bottom: 15px; }

.footer-icon, 
.footer-contacts-list svg {
  width: 18px !important;
  height: 18px !important;
  fill: var(--orange) !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
  vertical-align: middle;
  margin: 0 !important;
}

.footer-contact-link {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  color: #aaa;
  text-decoration: none;
}
.footer-contact-link:hover { color: #fff; }

#footer-address-item,
#footer-address-item::before,
#footer-address-item::after {
  background: none !important;
  content: none !important;
  display: block !important;
  padding-left: 0 !important;
}

.address-link {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  text-decoration: none !important;
  color: #ffffff !important;
  line-height: 1.4 !important;
  transition: opacity var(--speed) ease;
}

.address-link span { color: #ffffff !important; display: inline-block !important; }
.address-link:hover { opacity: 0.85; }

.footer-form input { width: 100%; padding: 12px 15px; background: #282726; border: 1px solid #383736; border-radius: 6px; color: #fff; margin-bottom: 10px; }
.footer-form .btn { width: 100%; padding: 12px; font-size: 14px; }

.footer-bottom { border-top: 1px solid #282726; padding-top: 30px; text-align: center; color: #555; font-size: 13px; }

/* Стилі для соцмереж у підвалі сайту */
.footer-social-links {
    display: flex;
    gap: 10px;
    align-items: center;
}

.footer-social-links a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #282726;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 1px solid #383736;
}

.footer-social-links a svg {
    width: 18px !important;
    height: 18px !important;
    fill: #ffffff !important;
    transition: fill 0.3s ease;
}

.footer-social-links a:hover {
    background: var(--orange);
    border-color: var(--orange);
    transform: translateY(-3px);
}

/* ==========================================================================
   14. ПЛАВАЮЧИЙ ВІДЖЕТ ЗВ'ЯЗКУ (FAB)
   ========================================================================== */
.fab-container {
  position: fixed; bottom: 30px; right: 30px; z-index: 2000;
  display: flex; flex-direction: column; align-items: flex-end;
}

.fab-main {
  width: 60px; height: 60px; border-radius: 50%; background-color: var(--orange);
  border: none; cursor: pointer; box-shadow: 0 4px 15px rgba(255, 138, 0, 0.4);
  position: relative; display: flex; align-items: center; justify-content: center;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.fab-main::after {
  content: ''; position: absolute; width: 100%; height: 100%; border-radius: 50%;
  background-color: var(--orange); opacity: 0.4; top: 0; left: 0; z-index: -1;
  animation: fab-pulse 2s infinite;
}

@keyframes fab-pulse {
  0% { transform: scale(1); opacity: 0.4; }
  100% { transform: scale(1.6); opacity: 0; }
}

.fab-main:hover { transform: scale(1.05); background-color: #e05a00; }
.fab-main svg { width: 28px; height: 28px; fill: #ffffff; position: absolute; transition: transform 0.3s ease, opacity 0.3s ease; }
.fab-main .icon-close { opacity: 0; transform: rotate(-180deg); }

.fab-buttons {
  display: flex; flex-direction: column; gap: 12px; margin-bottom: 15px;
  opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(20px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.fab-item { display: flex; align-items: center; text-decoration: none; position: relative; }
.fab-item .fab-icon { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(0,0,0,0.2); transition: transform 0.2s ease; }
.fab-item:hover .fab-icon { transform: scale(1.1); }
.fab-item .fab-icon svg { width: 22px; height: 22px; fill: #ffffff; display: block; }

.fab-item.telegram .fab-icon { background-color: #26A5E4; }
.fab-item.viber .fab-icon { background-color: #7360F2; }
.fab-item.phone .fab-icon { background-color: #2ECC71; }

.fab-label {
  position: absolute; right: 60px; background: #181c24; color: white;
  padding: 5px 10px; border-radius: 4px; font-size: 12px; white-space: nowrap;
  opacity: 0; visibility: hidden; transition: opacity 0.2s; pointer-events: none;
}
.fab-item:hover .fab-label { opacity: 1; visibility: visible; }

.fab-container.active .fab-buttons { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
.fab-container.active .fab-main { transform: rotate(135deg); background-color: #181c24; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); }
.fab-container.active .fab-main .icon-msg { opacity: 0; transform: rotate(180deg); }
.fab-container.active .fab-main .icon-close { opacity: 1; transform: rotate(0deg); }

/* ==========================================================================
   15. АЛЕРТИ КВІЗУ
   ========================================================================== */
.quiz-bonus-alert {
  display: flex; align-items: center; gap: 15px; background: linear-gradient(135deg, #FFF9E6 0%, #FFF2CC 100%);
  border: 1px dashed var(--orange); border-radius: 12px; padding: 16px 20px; margin-bottom: 25px;
  box-shadow: 0 4px 15px rgba(255, 138, 0, 0.05); animation: pulse-border 2s infinite ease-in-out;
}
.quiz-bonus-alert .bonus-icon { font-size: 28px; line-height: 1; animation: bounce-gift 2s infinite ease-in-out; }
.quiz-bonus-alert .bonus-text { color: #333; font-size: 14px; line-height: 1.5; }
.quiz-bonus-alert .bonus-text strong { color: var(--orange); font-weight: 700; display: inline-block; }
.quiz-bonus-alert .bonus-text b { background: var(--orange); color: #fff; padding: 2px 6px; border-radius: 4px; font-weight: 700; }

@keyframes bounce-gift {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.08); }
}

@keyframes pulse-border {
  0%, 100% { border-color: rgba(255, 138, 0, 0.6); }
  50% { border-color: rgba(255, 138, 0, 1); box-shadow: 0 4px 20px rgba(255, 138, 0, 0.12); }
}

.quiz-notice-alert {
  display: flex; align-items: center; gap: 15px; background: #f1f3f5; border-left: 4px solid var(--orange);
  border-radius: 8px; padding: 14px 18px; margin-bottom: 25px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}
.quiz-notice-alert .notice-icon { font-size: 24px; line-height: 1; }
.quiz-notice-alert .notice-text { color: #444; font-size: 13.5px; line-height: 1.5; }
.quiz-notice-alert .notice-text b { color: var(--dark); font-weight: 700; }

/* ==========================================================================
   16. АДАПТИВНІСТЬ (Responsive Breakpoints)
   ========================================================================== */
@media (max-width: 1200px) {
  .workflow-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 992px) {
  .footer-top { grid-template-columns: repeat(2, 1fr); gap: 30px; }
  .btn-callback { display: none; }
}

@media (max-width: 900px) {
  .nav { display: none; }
  .burger { display: flex; }
  .contacts-wrapper { grid-template-columns: 1fr; gap: 40px; }
  
  .nav.active {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: var(--header-height);
    left: 0; width: 100%;
    background: rgba(34, 33, 32, 0.98);
    padding: 30px; gap: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    border-bottom: 2px solid var(--orange);
    animation: fadeIn 0.3s ease;
  }
}

@media (max-width: 768px) {
  .projects-grid { grid-template-columns: 1fr; gap: 20px; }
  .quiz-interactive-layout { grid-template-columns: 1fr; gap: 25px; }
  .gate-constructor { max-width: 340px; margin: 0 auto; }
}

@media (max-width: 600px) {
  .section { padding: 60px 0; }
  .container { padding-left: 15px !important; padding-right: 15px !important; }
  
  .logo img { height: 38px !important; width: auto; }
  .brand-name { font-size: 16px !important; }
  .brand-desc { display: none; }
  .header-phone span { display: none; }
  
  .hero-content { width: 100% !important; max-width: 100% !important; padding: 0 5px; }
  .hero h1 { font-size: 26px !important; word-wrap: break-word; }
  .hero-buttons { flex-direction: column; width: 100%; gap: 10px; }
  .hero-buttons .btn { width: 100% !important; }
  
  .contact-form .btn { max-width: 100%; width: 100%; }
  .quiz-container { padding: 20px 12px; }
  .quiz-navigation { flex-direction: column-reverse; gap: 15px; }
  .quiz-navigation .btn { width: 100%; }
  .about-grid { grid-template-columns: 1fr; gap: 20px; }
  .footer { padding: 40px 0 20px 0; }
  .footer-top { grid-template-columns: 1fr; gap: 25px; }
}

@media (max-width: 480px) {
  .social-grid { grid-template-columns: 1fr; max-width: 100%; }
  .fab-container { bottom: 20px; right: 20px; }
  .fab-main { width: 54px; height: 54px; }
  .quiz-bonus-alert { flex-direction: column; text-align: center; padding: 15px; gap: 10px; }
  .quiz-notice-alert { flex-direction: column; text-align: center; padding: 12px; gap: 8px; }
}
/* ==========================================
   ФІКС ГОРИЗОНТАЛЬНОГО СКРОЛУ ТА БІЛОЇ ПОЛОСИ
   ========================================== */

/* 1. Забороняємо виходити елементам за межі екрана */
html, body {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
  position: relative !important;
}

/* 2. Адаптуємо головний банер, щоб зображення не розтягувало екран */
.hero {
  width: 100% !important;
  max-width: 100vw !important;
  overflow: hidden !important;
}

/* 3. Окремий фікс для конструктора воріт у квізі на мобільних */
@media (max-width: 768px) {
  .gate-constructor {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  
  .quiz-interactive-layout {
    width: 100% !important;
    grid-template-columns: 1fr !important;
  }

  .social-grid {
    width: 100% !important;
    max-width: 100% !important;
  }

  .container {
    width: 100% !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    box-sizing: border-box !important;
  }
}
/* ==========================================
   ФІКС ВИДИМОСТІ ПУНКТІВ МОБІЛЬНОГО МЕНЮ
   ========================================== */
@media (max-width: 900px) {
  /* Ховаємо меню за замовчуванням */
  .nav {
    display: none !important;
    position: fixed !important;
    top: var(--header-height, 78px) !important;
    left: 0 !important;
    width: 100% !important;
    background: #222120 !important; /* Темний фон */
    padding: 20px 25px !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5) !important;
    border-bottom: 3px solid #FF8A00 !important;
    z-index: 1999 !important;
    box-sizing: border-box !important;
  }

  /* Коли квопка активна — показуємо блок */
  .nav.active {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  /* Примусово робимо текст посилань білим та видимим */
  .nav a,
  .nav.active a {
    color: #ffffff !important; /* Білий колір */
    font-family: 'Montserrat', sans-serif !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    padding: 10px 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .nav a:last-child {
    border-bottom: none !important;
  }

  .nav a:hover,
  .nav a:active {
    color: #FF8A00 !important; /* Помаранчевий підсвічувач при тапі */
  }
}
/* ==========================================
   ЦЕНТРУВАННЯ ТЕКСТУ В ШАПЦІ НА МОБІЛЬНИХ
   ========================================== */
@media (max-width: 600px) {
  .hero-content {
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }

  /* Бейдж "ОФІЦІЙНИЙ ПАРТНЕР ВИРОБНИКІВ" */
  .hero-content .badge {
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
  }

  /* Заголовок "Секційні та в'їзні ворота під ключ" */
  .hero-content h1 {
    text-align: center !important;
  }

  /* Опис під заголовком */
  .hero-content p {
    text-align: center !important;
  }

  /* Кнопки під текстом */
  .hero-buttons {
    justify-content: center !important;
    width: 100% !important;
  }
}