/* ============================================
   Арзан билеттер — styles.css
   ============================================ */

/* --- Variables --- */
:root {
  --plane-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M21%2016v-2l-8-5V3.5a1.5%201.5%200%200%200-3%200V9l-8%205v2l8-2.5V19l-2%201v1l3-.5%203%20.5v-1l-2-1v-5.5z%22%2F%3E%3C%2Fsvg%3E");
  --bg1: #87CEFA;
  --bg2: #EAF6FF;
  --ink: #0b1220;
  --muted: #3b4a66;
  --card: #ffffffcc;
  --border: rgba(15, 23, 42, .10);
  --shadow: 0 18px 45px rgba(2, 10, 38, .12);
  --shadow2: 0 10px 24px rgba(2, 10, 38, .08);
  --accent: #2563eb;
  --radius: 18px;
}

/* --- Skip link (a11y) --- */
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  z-index: 9999;
  text-decoration: none;
}
.skip-link:focus {
  width: auto;
  height: auto;
  padding: 8px 16px;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: #fff;
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  border-radius: 0 0 8px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  left: 0;
  top: 0;
}

/* --- Base / Reset --- */
*, *::before, *::after { box-sizing: border-box; }

html {
  height: 100%;
  font-size: 16px;
  background: linear-gradient(180deg, var(--bg1) 0%, var(--bg2) 45%, #f6f7fb 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  height: 100%;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 400;
  background: transparent;
  overflow-x: hidden;
}

/* --- Typography --- */
h1, h2, h3 {
  font-family: "Inter", sans-serif;
  line-height: 1.25;
  margin: 0 0 16px 0;
}
h1 { font-size: 22px; font-weight: 600; }
h2 { font-size: 22px; font-weight: 600; }
h3 { font-size: 18px; font-weight: 600; }
h4 { font-size: 18px; font-weight: 700; }
h5 { font-size: 16px; font-weight: 700; }
h6 { font-size: 14px; font-weight: 700; }

/* --- Sky background (decorative clouds) --- */
.sky { position: relative; }
.sky::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle at 10% 10%, rgba(255,255,255,.35) 0 90px, transparent 91px),
    radial-gradient(circle at 35% 18%, rgba(255,255,255,.28) 0 120px, transparent 121px),
    radial-gradient(circle at 70% 12%, rgba(255,255,255,.30) 0 100px, transparent 101px),
    radial-gradient(circle at 90% 25%, rgba(255,255,255,.26) 0 140px, transparent 141px),
    radial-gradient(circle at 15% 55%, rgba(255,255,255,.26) 0 140px, transparent 141px),
    radial-gradient(circle at 48% 60%, rgba(255,255,255,.22) 0 170px, transparent 171px),
    radial-gradient(circle at 80% 52%, rgba(255,255,255,.24) 0 150px, transparent 151px),
    radial-gradient(circle at 20% 90%, rgba(255,255,255,.22) 0 160px, transparent 161px),
    radial-gradient(circle at 60% 92%, rgba(255,255,255,.20) 0 190px, transparent 191px),
    radial-gradient(circle at 92% 88%, rgba(255,255,255,.20) 0 150px, transparent 151px);
  opacity: .9;
}

/* --- Layout --- */
.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 16px 54px;
  position: relative;
  z-index: 1;
}

.grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 16px;
}
.span { grid-column: 1 / -1; }
.popular-card { grid-column: 1 / -1; }
header + main.card { margin-top: 16px; }

/* --- Header --- */
header {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(255,255,255,.72));
  border-radius: calc(var(--radius) + 6px);
  padding: 26px 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  -webkit-text-size-adjust: 100%;
}
.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
}
.brand-link {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.brand-link:focus {
  outline: 2px solid rgba(37,99,235,.35);
  outline-offset: 4px;
  border-radius: 14px;
}
.brand-link > div,
.brand > div { min-width: 0; flex: 1 1 auto; }
.brand a,
.brand a:visited,
.brand-link,
.brand-link:visited {
  color: inherit;
  text-decoration: none;
}
.brand-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
  color: inherit;
}
.logo {
  width: 60px;
  height: 60px;
  flex: 0 0 60px;
  display: block;
  object-fit: contain;
  border-radius: 18px;
}

/* !important на .brand-title — перебивает стили Travelpayouts-виджетов */
header .brand .brand-title,
header .brand-link .brand-title {
  margin: 0 !important;
  font-size: 30px !important;
  line-height: 1.15 !important;
  letter-spacing: -0.02em !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-synthesis: none !important;
}
header .sub {
  margin: 8px 0 0;
  font-size: 16px;
  color: var(--muted);
  max-width: 72ch;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* --- Language switcher --- */
.lang {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(2, 10, 38, .08);
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
  color: #111827;
  border: 1px solid transparent;
  -webkit-tap-highlight-color: transparent;
}
.lang-btn:hover {
  border-color: rgba(15,23,42,.14);
  background: rgba(255,255,255,.70);
}
.lang-btn.is-active,
.lang-btn[aria-current="true"] {
  border-color: rgba(37,99,235,.25);
  box-shadow: 0 8px 18px rgba(37,99,235,.14);
  background: rgba(255,255,255,.92);
}
.lang-sep {
  color: rgba(17,24,39,.45);
  font-weight: 800;
}

/* --- Cards --- */
.card {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  overflow: visible;
}
.card h2:first-child { margin-top: 0; }
.card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}
.card ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}

/* --- Common text elements --- */
.note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.hint {
  margin-top: 0;
  font-size: 12px;
  color: #4b5563;
}
.micro {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(17,24,39,.72);
}
.list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.contact a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 400;
}
.contact a:hover { text-decoration: underline; }

/* --- FAQ --- */
.faq { margin: 0; padding: 0; list-style: none; }
.faq li {
  padding: 12px 0;
  border-top: 1px solid rgba(15,23,42,.08);
}
.faq li:first-child { border-top: 0; padding-top: 0; }
.faq .q {
  font-weight: 700;
  color: #111827;
  margin: 0 0 6px;
}
.faq .a {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

/* --- Tips slider --- */
.tips {
  margin-top: 14px;
  position: relative;
  z-index: 5;
  border: 1px solid rgba(15,23,42,.18);
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.78));
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 12px 26px rgba(2,10,38,.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.tips * { pointer-events: auto; }
.tips-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.tips-title {
  margin: 0;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .01em;
  color: rgba(17,24,39,.92);
}
.tips-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  position: relative;
  z-index: 10;
}
.tips-btn {
  position: relative;
  z-index: 20;
  pointer-events: auto;
  border: 1px solid rgba(15,23,42,.18);
  background: rgba(255,255,255,.92);
  color: rgba(17,24,39,.92);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 6px 14px rgba(2,10,38,.10);
}
.tips-btn:hover {
  border-color: rgba(37,99,235,.35);
  box-shadow: 0 8px 18px rgba(37,99,235,.14);
}
.tips-body {
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,.14);
  background: rgba(255,255,255,.88);
  padding: 10px 12px;
  min-height: 54px;
  display: flex;
  align-items: center;
}
.tips-line {
  font-size: 13.5px;
  line-height: 1.45;
  color: rgba(17,24,39,.92);
  opacity: 1;
  transition: opacity .35s ease, transform .35s ease;
}
.tips-line.is-fading {
  opacity: 0;
}

/* --- Policy pages --- */
.policy-content p { margin: 8px 0 0; }
.policy-content ul { margin: 10px 0 0; padding-left: 18px; }
.policy-content h2:first-child { margin-top: 0; }

/* --- Footer --- */
footer {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  color: rgba(17,24,39,.70);
}
.footer-links {
  margin-top: 8px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.footer-links a {
  color: rgba(17,24,39,.72);
  text-decoration: none;
  border-bottom: 1px dashed rgba(17,24,39,.28);
  font-weight: 400;
}
.footer-links a:hover {
  color: rgba(17,24,39,.92);
  border-bottom-color: rgba(17,24,39,.55);
}

/* --- Destinations index --- */
.destinations {
  max-width: none !important;
  margin: 0 !important;
}
.destinations .card {
  padding-top: 16px;
  padding-bottom: 16px;
}
.destinations .card + .card {
  margin-top: 12px;
}
.dest-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.card .dest-links {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}
.dest-links li { margin: 0; }
.dest-links a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  text-decoration: none;
  color: #111827;
  font-size: 14px;
  line-height: 1.35;
  white-space: nowrap;
  border: 1px solid rgba(15,23,42,.12);
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.78));
  box-shadow: 0 8px 18px rgba(2,10,38,.08);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.dest-links a:hover {
  border-color: rgba(37,99,235,.25);
  box-shadow: 0 10px 22px rgba(37,99,235,.12);
}
.dest-links a::before {
  content: "";
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-right: 10px;
  background-color: #9aa3af;
  opacity: .95;
  -webkit-mask-image: var(--plane-mask);
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-image: var(--plane-mask);
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  transition: background-color .2s ease, transform .2s ease, opacity .2s ease;
}
.dest-links a:hover::before {
  background-color: var(--accent);
  opacity: 1;
}
/* !important на ::after — перебивает стили Travelpayouts-виджетов */
.dest-links a::after {
  content: "\2192" !important;
  flex: 0 0 auto !important;
  margin-left: auto !important;
  color: rgba(17,24,39,.45) !important;
  opacity: .9 !important;
  transition: transform .15s ease, opacity .15s ease !important;
}
.dest-links a:hover::after {
  opacity: 1 !important;
}
.dest-links .all a::before { display: none; }
.dest-links .all a::after { display: none; }
.dest-links .all a {
  justify-content: center;
  color: var(--accent);
}

/* --- Route pages --- */
.route {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 20px;
  align-items: start;
}
.breadcrumbs {
  font-size: 12px;
  color: rgba(17,24,39,.55);
  margin: 0 0 10px;
}
.breadcrumbs a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 400;
}
.breadcrumbs a:hover { text-decoration: underline; }

.route-left .note { margin-top: 0; }
.route-left .widget {
  margin-top: 12px;
  margin-bottom: 16px;
  min-height: 260px;
  max-width: 820px;
}
.route-left .hint { margin-top: 0; }
.route-left .hint + .micro { margin-top: 14px; }

.route-right { position: static; line-height: 1.5; }
.route-right .note { margin: 8px 0 12px; }
.route-right .list {
  margin-top: 6px;
  margin-bottom: 12px;
  padding-left: 18px;
}
.route-right .list a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 400;
}
.route-right .list a:hover { text-decoration: underline; }

.route-box {
  border: 0;
  background: rgba(255,255,255,.38);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: none;
  backdrop-filter: none;
}

/* --- Route SEO section --- */
.route-seo {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(17,24,39,.10);
}
.route-seo > *:last-child {
  margin-bottom: 0;
}
.route-seo h2 {
  margin-top: 28px;
  margin-bottom: 10px;
}
.route-seo h2:first-child {
  margin-top: 0;
}
.route-seo h3 {
  margin-top: 22px;
  margin-bottom: 8px;
}
.route-seo .note {
  margin-top: 8px;
  margin-bottom: 6px;
}
.route-seo .list {
  margin-top: 6px;
  margin-bottom: 16px;
  padding-left: 18px;
}
.route-seo details {
  background: rgba(255,255,255,.32);
  border: 1px solid rgba(17,24,39,.08);
  border-radius: 12px;
  padding: 0;
  margin: 8px 0;
  overflow: hidden;
}
.route-seo summary {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
  color: rgba(17,24,39,.78);
  user-select: none;
  list-style: none;
}
.route-seo summary::-webkit-details-marker { display: none; }
.route-seo summary::before {
  content: "\25B8";
  flex: 0 0 auto;
  font-size: 14px;
  line-height: 1;
  color: rgba(17,24,39,.55);
}
.route-seo details[open] summary::before {
  content: "\25BE";
  color: rgba(17,24,39,.60);
}
.route-seo summary:hover {
  background: rgba(255,255,255,.35);
  color: rgba(17,24,39,.90);
}
.route-seo summary:focus { outline: none; }
.route-seo summary:focus-visible {
  outline: 2px solid rgba(37,99,235,.35);
  outline-offset: -2px;
  background: rgba(255,255,255,.38);
}
.route-seo details p {
  margin: 0;
  padding: 10px 12px 12px 34px;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(17,24,39,.72);
  border-top: 1px solid rgba(17,24,39,.08);
}

/* Route SEO FAQ headings */
.route-seo .faq-title,
.route-seo .faq-heading,
.route-seo .route-faq-title,
.route-seo .route-faq-heading {
  position: relative;
  display: block;
  margin-top: 22px;
  padding-top: 18px;
}
.route-seo .faq-title::before,
.route-seo .faq-heading::before,
.route-seo .route-faq-title::before,
.route-seo .route-faq-heading::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(17,24,39,.10);
}
.route-seo h2[id*="faq" i],
.route-seo h3[id*="faq" i],
.route-seo h4[id*="faq" i],
.route-seo h2[class*="faq" i],
.route-seo h3[class*="faq" i],
.route-seo h4[class*="faq" i] {
  position: relative;
  margin-top: 22px;
  padding-top: 18px;
}
.route-seo h2[id*="faq" i]::before,
.route-seo h3[id*="faq" i]::before,
.route-seo h4[id*="faq" i]::before,
.route-seo h2[class*="faq" i]::before,
.route-seo h3[class*="faq" i]::before,
.route-seo h4[class*="faq" i]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(17,24,39,.10);
}

/* --- Travelpayouts widget overrides --- */
.card:has(.tp-simple) {
  z-index: 10;
}
.tp-simple {
  display: block;
  position: static;
  overflow: visible;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.tp-simple .tp-widget-slot { display: block; }
.route-left .tp-simple {
  margin: 0 !important;
  padding: 8px 0 8px !important;
  display: block !important;
}
.route-left .tp-spacer {
  display: block;
  height: 8px;
}

/* --- Utilities --- */
.mt12 { margin-top: 12px !important; }

/* ============================================
   Media queries
   ============================================ */

@media (max-width: 920px) {
  .grid { grid-template-columns: 1fr; }
  .route { grid-template-columns: 1fr; gap: 8px; }
  .route-left .widget { max-width: 100%; }
}

@media (max-width: 640px) {
  .wrap { padding: 18px 14px 44px; }
  header { padding: 18px 16px; }
  header .sub { font-size: 15px; }
  header .brand .brand-title,
  header .brand-link .brand-title {
    font-size: 26px !important;
  }
  .header-right {
    width: 100%;
    justify-content: space-between;
  }
  .lang { margin-top: 8px; }
  .logo {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    border-radius: 16px;
  }
  .topline { align-items: flex-start; }
  .brand { width: 100%; }
  .card .dest-links { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  header .sub { font-size: 13.5px; margin-top: 4px; line-height: 1.35; }
  header .brand .brand-title,
  header .brand-link .brand-title {
    font-size: 22px !important;
  }
  .route-left .widget { min-height: 300px; }
}

@media (hover: hover) {
  .logo { transition: transform .25s ease, box-shadow .25s ease; }
  .brand-link:hover .logo,
  .brand:hover .logo {
    box-shadow: 0 6px 16px rgba(37,99,235,.18);
  }
}

@media (hover: none) {
  .lang-btn { -webkit-tap-highlight-color: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .sky::before { animation: none !important; }
  .tips-line { transition: none !important; }
}
