/* АТП-Завада — стилі сайту */
:root {
  --blue: #0071bc;
  --blue-dark: #005a96;
  --blue-light: #e8f2fa;
  --navy: #253a58;
  --gold: #f5b400;
  --gold-dark: #bf8f00;
  --text: #1f2933;
  --muted: #5b6770;
  --card: #ffffff;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Montserrat", Tahoma, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: #1b2433;
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Фон — фото автобуса, закріплене на весь екран (працює і на телефонах) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background:
    linear-gradient(to bottom, rgba(10, 20, 35, .55) 0, rgba(10, 20, 35, .15) 260px, rgba(10, 20, 35, .1) 100%),
    url("../images/bg-setra.jpg") center top / cover no-repeat;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }

.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 16px; }

/* ---------- Шапка ---------- */
.site-header { padding: 34px 0 26px; text-align: center; }
.brand {
  display: inline-block;
  text-decoration: none;
  font-family: Gabriola, "Philosopher", Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(30px, 5.4vw, 60px);
  line-height: 1.1;
  color: var(--gold);
  text-shadow: 0 0 6px rgba(255, 190, 0, .9), 0 0 18px rgba(255, 160, 0, .6), 0 2px 3px rgba(0, 0, 0, .8);
}
.brand:hover { color: #ffc72c; }
.brand small {
  display: block;
  margin-top: 6px;
  font-family: "Montserrat", Arial, sans-serif;
  font-style: normal;
  font-weight: 600;
  font-size: clamp(12px, 1.6vw, 15px);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .9);
}

/* ---------- Меню ---------- */
.nav { background: var(--blue); position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 52px; }
.nav-toggle {
  display: none;
  background: none; border: 0; color: #fff; cursor: pointer;
  font: 600 15px "Montserrat", Arial, sans-serif; padding: 12px 0;
  align-items: center; gap: 10px;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 22px; height: 2px; background: #fff; position: relative; content: "";
}
.nav-toggle span::before { position: absolute; top: -7px; }
.nav-toggle span::after { position: absolute; top: 7px; }

.menu { list-style: none; margin: 0 auto; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; }
.menu > li { position: relative; }
.menu a, .menu .sub-toggle {
  display: block; padding: 15px 18px; color: #fff; text-decoration: none;
  font: 600 15px/1.4 "Montserrat", Arial, sans-serif; background: none; border: 0; cursor: pointer; width: 100%; text-align: left;
}
.menu a:hover, .menu .sub-toggle:hover, .menu a[aria-current="page"], .menu .has-sub.active > .sub-toggle { background: var(--blue-dark); color: #fff; }
.menu a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--gold); }
.sub-toggle::after { content: " ▾"; font-size: 12px; }
.submenu {
  list-style: none; margin: 0; padding: 6px 0; position: absolute; left: 0; top: 100%; min-width: 260px;
  background: #fff; border-radius: 0 0 8px 8px; box-shadow: var(--shadow); display: none;
}
.submenu a { color: var(--navy); font-weight: 500; }
.submenu a:hover, .submenu a[aria-current="page"] { background: var(--blue-light); color: var(--blue-dark); box-shadow: none; }
.has-sub:hover .submenu, .has-sub:focus-within .submenu, .has-sub.open .submenu { display: block; }

/* ---------- Контент ---------- */
main { flex: 1; padding: 32px 0 48px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(20px, 4vw, 44px); }
.card + .card { margin-top: 24px; }

h1, h2, h3 { color: var(--navy); line-height: 1.25; margin: 0 0 16px; }
h1 { font-size: clamp(24px, 3.4vw, 32px); text-align: center; }
h2 { font-size: clamp(20px, 2.6vw, 26px); text-align: center; }
h3 { font-size: 19px; }
.title-gold {
  font-family: Gabriola, "Philosopher", Georgia, serif; font-style: italic; font-weight: 700;
  color: var(--gold-dark); font-size: clamp(28px, 4vw, 40px);
}
.lead {
  font-family: Gabriola, "Philosopher", Georgia, serif; font-style: italic; font-weight: 700;
  font-size: clamp(19px, 2.3vw, 26px); line-height: 1.45; text-align: center; margin: 0 auto; max-width: 960px;
}
p { margin: 0 0 14px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 30px; }
.stat { background: var(--blue-light); border-radius: 8px; padding: 18px 12px; text-align: center; }
.stat b { display: block; font-size: 30px; color: var(--blue); line-height: 1.1; }
.stat span { font-size: 14px; color: var(--muted); }

.btns { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 28px; }
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 6px; background: var(--blue); color: #fff;
  text-decoration: none; font-weight: 600;
}
.btn:hover { background: var(--blue-dark); color: #fff; }
.btn.alt { background: #fff; color: var(--blue); border: 2px solid var(--blue); }
.btn.alt:hover { background: var(--blue-light); color: var(--blue-dark); }

/* Маршрути */
.routes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 10px; }
.routes section { border: 1px solid #dde5ec; border-radius: 8px; padding: 18px; }
.routes h3 { color: var(--blue); }
.routes ul { margin: 0; padding-left: 18px; }
.routes li { margin-bottom: 6px; }

/* Списки послуг */
.dash-list { list-style: none; padding: 0; margin: 0 0 16px; }
.dash-list li { padding-left: 22px; position: relative; margin-bottom: 6px; }
.dash-list li::before { content: "—"; position: absolute; left: 0; color: var(--blue); }
ol.benefits { margin: 0; padding-left: 22px; }
ol.benefits li { margin-bottom: 8px; }

/* Таблиця цін */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.prices { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 620px; }
.prices th, .prices td { border: 1px solid #cfd8e0; padding: 10px 12px; text-align: center; }
.prices th { background: var(--blue); color: #fff; font-weight: 600; }
.prices td:first-child, .prices th:first-child { text-align: left; }
.prices tbody tr:nth-child(even) { background: #f4f8fb; }
.note { font-size: 14px; color: var(--muted); margin-top: 10px; }

/* Автобуси */
.bus { padding: 26px 0; border-top: 1px solid #e3e8ee; }
.bus:first-of-type { border-top: 0; padding-top: 0; }
.bus h2 { margin-bottom: 8px; }
.bus p { text-align: center; max-width: 760px; margin: 0 auto 18px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gallery a { display: block; border-radius: 8px; overflow: hidden; background: #eef2f5; aspect-ratio: 4 / 3; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gallery a:hover img { transform: scale(1.04); }
.gallery.portrait a { aspect-ratio: 3 / 4; }

.doc { max-width: 760px; margin: 0 auto; border: 1px solid #dde5ec; border-radius: 8px; overflow: hidden; }

/* Контакти */
.contacts { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; text-align: center; }
.contacts .title-gold { margin-bottom: 8px; }
.contacts p { font-size: 18px; font-weight: 600; }
.contacts a { text-decoration: none; }

.map { border-radius: 8px; overflow: hidden; border: 1px solid #dde5ec; aspect-ratio: 16 / 7; min-height: 300px; }
.map iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Головна: контент + бічна колонка з іншими проєктами */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 24px; align-items: start; }
.home-grid .card + .card { margin-top: 0; }
.projects { padding: 22px; position: sticky; top: 76px; }
.projects h2 { font-size: 19px; margin-bottom: 14px; }
.project {
  display: block; text-decoration: none; color: var(--text); border: 1px solid #dde5ec; border-radius: 8px;
  overflow: hidden; transition: box-shadow .2s, transform .2s;
}
.project + .project { margin-top: 14px; }
.project:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, .15); transform: translateY(-2px); color: var(--text); }
.project img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.project b { display: block; padding: 10px 12px 2px; color: var(--blue); }
.project span { display: block; padding: 0 12px 12px; font-size: 14px; color: var(--muted); line-height: 1.4; }
@media (max-width: 980px) {
  .home-grid { grid-template-columns: 1fr; }
  .projects { position: static; }
  .projects { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .projects h2 { grid-column: 1 / -1; margin-bottom: 0; }
  .project + .project { margin-top: 0; }
}
@media (max-width: 520px) { .projects { grid-template-columns: 1fr; } }

/* ---------- Підвал ---------- */
.site-footer { background: rgba(20, 32, 50, .94); color: #cfd8e3; font-size: 14px; padding: 26px 0; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 30px; justify-content: space-between; align-items: center; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--gold); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .9); display: none; align-items: center; justify-content: center;
  z-index: 100; padding: 50px 60px;
}
.lightbox.show { display: flex; }
.lightbox img { max-height: 100%; max-width: 100%; border-radius: 4px; box-shadow: 0 0 40px #000; }
.lightbox button {
  position: absolute; background: rgba(255, 255, 255, .12); color: #fff; border: 0; cursor: pointer;
  font-size: 30px; width: 48px; height: 48px; border-radius: 50%; line-height: 48px;
}
.lightbox button:hover { background: rgba(255, 255, 255, .28); }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 8px; top: 50%; transform: translateY(-50%); }

/* ---------- Адаптив ---------- */
@media (max-width: 900px) {
  .routes { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .lead { font-size: 19px; }
  .site-header { padding: 22px 0 18px; }
  .nav-toggle { display: flex; }
  .menu { display: none; width: 100%; flex-direction: column; padding-bottom: 8px; }
  .nav .wrap { flex-wrap: wrap; }
  .nav.open .menu { display: flex; }
  .submenu { position: static; box-shadow: none; background: rgba(0, 0, 0, .15); border-radius: 0; display: block; }
  .submenu a { color: #fff; padding-left: 34px; }
  .submenu a:hover, .submenu a[aria-current="page"] { background: var(--blue-dark); color: #fff; }
  .sub-toggle::after { content: ""; }
  .menu a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--gold); }
  .contacts { grid-template-columns: 1fr; }
  main { padding: 18px 0 32px; }
  .lightbox { padding: 60px 8px; }
}

/* ---------- Замовлення автобуса ---------- */
.menu-cta a { background: var(--gold); color: var(--navy) !important; font-weight: 700; }
.menu-cta a:hover, .menu-cta a[aria-current="page"] { background: #ffc72c; color: var(--navy) !important; box-shadow: none; }
.order-form { max-width: 820px; margin: 24px auto 0; }
.order-form fieldset { border: 1px solid #dde5ec; border-radius: 8px; padding: 16px 18px 6px; margin: 0 0 18px; }
.order-form legend { font-weight: 700; color: var(--blue); padding: 0 6px; }
.order-form .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.order-form label { display: block; font-size: 14px; font-weight: 600; color: var(--navy); margin-bottom: 14px; }
.order-form input, .order-form select, .order-form textarea {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px; font: 400 16px/1.4 "Montserrat", Arial, sans-serif;
  color: var(--text); background: #fff; border: 1px solid #c3ced8; border-radius: 6px;
}
.order-form input:focus, .order-form select:focus, .order-form textarea:focus { outline: 2px solid var(--blue); border-color: var(--blue); }
.order-form .invalid { border-color: #c62828; background: #fff5f5; }
.order-form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.order-form .check input { width: auto; margin-top: 3px; }
.order-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.order-form button[disabled] { opacity: .6; cursor: wait; }
.form-msg { text-align: center; font-weight: 600; min-height: 1.5em; }
.form-msg.ok { color: #1b7f3b; }
.form-msg.err { color: #c62828; }
@media (max-width: 640px) { .order-form .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 1100px) and (min-width: 761px) { .menu a, .menu .sub-toggle { padding: 15px 12px; font-size: 14px; } }

/* ---------- Квитки ---------- */
.demo-banner { background: #fff3cd; border: 1px solid #f5c542; color: #6b4e00; border-radius: 8px; padding: 10px 14px; text-align: center; font-weight: 600; margin-bottom: 18px; }
.tk-search { display: grid; grid-template-columns: 1fr auto 1fr 180px auto; gap: 12px; align-items: end; max-width: 900px; margin: 0 auto; }
.tk-search label { font-size: 14px; font-weight: 600; color: var(--navy); }
.tk-search select, .tk-search input { display: block; width: 100%; margin-top: 5px; padding: 10px 12px; font: 400 16px "Montserrat", Arial, sans-serif; border: 1px solid #c3ced8; border-radius: 6px; background: #fff; }
.tk-search .btn { border: 0; cursor: pointer; font: 600 16px "Montserrat", Arial, sans-serif; padding: 11px 20px; }
.tk-swap { border: 1px solid #c3ced8; background: #fff; border-radius: 50%; width: 40px; height: 40px; font-size: 18px; cursor: pointer; color: var(--blue); margin-bottom: 2px; }
.tk-rule { text-align: center; }
#tk-results { margin-top: 18px; }
.tk-trip { display: grid; grid-template-columns: 110px 1fr 110px 1.4fr 150px; gap: 14px; align-items: center; border: 1px solid #dde5ec; border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; }
.tk-trip.off { opacity: .6; }
.tk-times b { display: block; font-size: 24px; color: var(--navy); }
.tk-times span { font-size: 13px; color: var(--muted); }
.tk-line { text-align: center; font-size: 13px; color: var(--muted); border-bottom: 2px dashed #c3ced8; padding-bottom: 4px; }
.tk-info { font-size: 14px; }
.tk-buy { text-align: right; }
.tk-price { font-size: 22px; font-weight: 700; color: var(--blue); }
.tk-buy .btn { margin-top: 6px; padding: 8px 18px; border: 0; cursor: pointer; font: 600 15px "Montserrat", Arial, sans-serif; }
.tk-back { background: none; border: 0; color: var(--blue); cursor: pointer; font: 600 15px "Montserrat", Arial, sans-serif; padding: 0; margin-bottom: 12px; }
.tk-sum { background: var(--blue-light); border-radius: 8px; padding: 14px 16px; margin: 0 auto 16px; max-width: 820px; line-height: 1.7; }
.tk-total { text-align: center; font-size: 18px; }
.tk-paybox { max-width: 560px; margin: 0 auto; border: 2px solid #dde5ec; border-radius: 12px; padding: 20px; }
.tk-paylogo { text-align: center; font-weight: 700; font-size: 18px; margin-bottom: 14px; color: var(--navy); }
.tk-paylogo small { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }
.tk-paybox .btn, #tk-step-ticket .btn { border: 0; cursor: pointer; font: 600 16px "Montserrat", Arial, sans-serif; }
.ticket { max-width: 640px; margin: 10px auto 0; border: 2px solid var(--navy); border-radius: 12px; overflow: hidden; background: #fff; position: relative; }
.ticket.is-demo::after { content: "ДЕМО"; position: absolute; top: 45%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg); font-size: 90px; font-weight: 800; color: rgba(200, 0, 0, .12); pointer-events: none; }
.ticket-head { display: flex; justify-content: space-between; background: var(--navy); color: #fff; padding: 12px 16px; }
.ticket-body { display: flex; gap: 16px; padding: 16px; align-items: center; }
.ticket-main { flex: 1; }
.ticket-route { font-size: 22px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.ticket table { border-collapse: collapse; font-size: 15px; }
.ticket td { padding: 4px 12px 4px 0; vertical-align: top; }
.ticket td:first-child { color: var(--muted); }
.ticket-foot { border-top: 1px dashed #c3ced8; padding: 10px 16px; font-size: 13px; color: var(--muted); text-align: center; }
@media (max-width: 860px) {
  .tk-search { grid-template-columns: 1fr; }
  .tk-swap { justify-self: center; transform: rotate(90deg); }
  .tk-trip { grid-template-columns: 1fr auto 1fr; }
  .tk-info { grid-column: 1 / -1; }
  .tk-buy { grid-column: 1 / -1; text-align: left; display: flex; gap: 12px; align-items: center; justify-content: space-between; }
  .ticket-body { flex-direction: column; align-items: flex-start; }
}
@media print {
  body::before, .site-header, .nav, .site-footer, .btns, .form-msg, .demo-banner, h1 { display: none !important; }
  .card { box-shadow: none; padding: 0; }
}
.tk-paybox .btn.alt, #tk-step-ticket .btn.alt { border: 2px solid var(--blue); }
.demo-banner.info { background: var(--blue-light); border-color: #9cc6e6; color: var(--navy); }
