/* ===== Responsive — mobile-first enhancements ===== */

/* Safe area (notched phones) */
.header {
  padding-top: max(16px, env(safe-area-inset-top));
}

.container {
  padding-left: max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
}

/* Mobile nav overlay */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 998;
  background: rgba(10, 15, 26, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.nav-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

body.nav-open {
  overflow: hidden;
}

/* Menu toggle animation */
.menu-toggle {
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.menu-toggle span {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Touch devices — service cards always expanded */
@media (hover: none) {
  .service-box-card .service-box-content,
  .service-box-card--compact .service-box-content {
    min-height: 148px;
    padding-bottom: 16px;
    z-index: 10;
    background: linear-gradient(
      180deg,
      transparent 0%,
      rgba(255, 255, 255, 0.9) 14%,
      rgba(255, 251, 235, 0.98) 100%
    );
  }

  .service-box-card .service-box-tags {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .service-box-card .service-box-link {
    opacity: 1;
    transform: none;
  }

  .service-box-card .service-box-photo,
  .service-box-card:hover .service-box-photo,
  .service-box-card:focus-within .service-box-photo,
  .service-box-card:has(.service-box-link:active) .service-box-photo {
    z-index: 0;
    transform: translate(-50%, -50%) scale(1.06);
  }

  .service-box-card--bankcard::before,
  .service-box-card--wallet::before {
    z-index: 0;
    transform: scale(1.02);
  }
}

/* Tablet landscape & small laptop */
@media (max-width: 1200px) {
  .hero-content {
    gap: 36px;
  }

  .bg-icon-metro {
    left: 6%;
    right: auto;
  }
}

/* Tablet */
@media (max-width: 992px) {
  .hero {
    padding: 110px 0 0;
    min-height: auto;
  }

  .hero-visual {
    order: -1;
  }

  .hero-text {
    text-align: center;
  }

  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-buttons {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
  }

  .hero-bottom-box {
    min-height: 128px;
    margin-top: 32px;
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
  }

  .hero-flights-head {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 0 14px 8px;
    gap: 6px 10px;
  }

  .hero-flights-title {
    font-size: 0.85rem;
  }

  .hero-flights-date,
  .hero-flights-updated {
    font-size: 0.68rem;
  }

  .hero-flights-updated {
    margin-right: 0;
    width: 100%;
  }

  .hero-flights-track {
    padding: 10px 12px 4px;
  }

  .hero-flight-card {
    min-width: min(210px, 78vw);
    max-width: 78vw;
    padding: 8px 10px;
    gap: 8px;
  }

  .hero-flight-route {
    font-size: 0.78rem;
  }

  .hero-flight-time {
    font-size: 0.88rem;
  }

  .hero-flight-no {
    display: none;
  }

  .features,
  .about,
  .currency,
  .download-cta {
    padding: 72px 0;
  }

  .section-header {
    margin-bottom: 48px;
  }

  .nav-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .container {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .header {
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: 12px;
  }

  .header.scrolled {
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: 8px;
  }

  .logo-text {
    font-size: 1rem;
  }

  .header-actions .btn-sm {
    padding: 8px 14px;
    font-size: 0.8rem;
  }

  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(300px, 88vw);
    height: 100dvh;
    height: 100vh;
    background: var(--white);
    flex-direction: column;
    align-items: stretch;
    padding: max(80px, calc(64px + env(safe-area-inset-top))) 20px 24px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.12);
    transition: right 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 999;
    overflow-y: auto;
  }

  .nav.open {
    right: 0;
  }

  .nav-link {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border-radius: var(--radius-sm);
  }

  .header-dark .nav {
    background: var(--dark-2);
  }

  .menu-toggle {
    display: flex;
  }

  .lang-btn {
    display: none;
  }

  .hero {
    padding: 96px 0 0;
  }

  .hero-title {
    font-size: clamp(1.65rem, 7vw, 2.2rem);
  }

  .hero-desc {
    font-size: 0.95rem;
    margin-bottom: 24px;
  }

  .hero-buttons {
    margin-bottom: 32px;
  }

  .hero-buttons .btn-lg {
    width: 100%;
    padding: 14px 24px;
  }

  .hero-app-shot {
    width: min(240px, 78vw);
    max-height: 520px;
    border-radius: 22px;
  }

  .hero-stats {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
  }

  .stat {
    flex: 1;
    min-width: 0;
    text-align: center;
  }

  .stat-num {
    font-size: 1.2rem;
  }

  .stat-label {
    font-size: 0.72rem;
  }

  .stat-divider {
    display: none;
  }

  .hero-content,
  .about-inner,
  .currency-box {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .about-services {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 420px;
    margin-inline: auto;
  }

  .about-text {
    text-align: center;
  }

  .currency-converter {
    padding: 24px 20px;
  }

  .converter-row select,
  .converter-row input {
    font-size: 16px;
    min-height: 48px;
  }

  .result-value {
    font-size: clamp(1.45rem, 6vw, 2rem);
    word-break: break-word;
  }

  .currency-rates,
  .currency-rates--3 {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .rate-card {
    padding: 16px 12px;
    gap: 8px;
    border-radius: 14px;
  }

  .rate-flag {
    font-size: 1.35rem;
  }

  .rate-name {
    font-size: 0.9rem;
  }

  .rate-price {
    font-size: 0.95rem;
  }

  .download-inner {
    flex-direction: column;
    text-align: center;
    gap: 28px;
  }

  .download-buttons {
    justify-content: center;
  }

  .download-buttons .appstore-button,
  .download-buttons .playstore-button,
  .download-buttons .download-io-button {
    width: 100%;
    justify-content: center;
  }

  .download-logo-desktop {
    display: none;
  }

  .download-app-mobile {
    display: block;
    margin: 0 auto;
    max-width: min(240px, 78vw);
    border-radius: 22px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 32px;
  }

  .footer-brand .logo {
    justify-content: center;
  }

  .footer-links a {
    padding: 8px 0;
  }

  /* Hero bg icons — smaller, fewer conflicts */
  .bg-icon {
    width: calc(var(--icon-size, 88px) * 0.72) !important;
    height: calc(var(--icon-size, 88px) * 0.72) !important;
    padding: calc(var(--icon-pad, 10px) * 0.75) !important;
  }

  /* Hero icons — parenthesis layout */
  .bg-icon-plane { top: 10%; right: 5%; left: auto; }
  .bg-icon-car { top: 10%; left: 5%; right: auto; }
  .bg-icon-metro { top: 28%; left: 1%; right: auto; }
  .bg-icon-bus { top: 38%; right: 1%; left: auto; }
  .bg-icon-train { top: 56%; right: 4%; left: auto; }
  .bg-icon-sim { top: 44%; left: 1%; right: auto; }
  .bg-icon-cash { top: 56%; left: 4%; right: auto; }

  .hero-orb-1 {
    width: 280px;
    height: 280px;
    right: -120px;
  }

  .hero-orb-2 {
    width: 240px;
    height: 240px;
    left: -100px;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .hero-content {
    gap: 28px;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .hero-buttons .btn {
    width: 100%;
  }

  .section-header {
    margin-bottom: 36px;
  }

  .section-desc {
    font-size: 0.92rem;
    padding: 0 4px;
  }

  .about-services {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 100%;
    gap: 10px;
  }

  .about-service-item {
    min-height: 96px;
    padding: 12px 8px;
    font-size: 0.72rem;
  }

  .logo-text {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-actions .btn-sm span,
  .header-actions .btn-sm {
    font-size: 0.75rem;
    padding: 8px 12px;
  }

  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
    max-width: 100%;
    gap: 8px;
  }

  .stat-num {
    font-size: 1rem;
  }

  .stat-label {
    font-size: 0.65rem;
    line-height: 1.35;
  }

  .currency-rates,
  .currency-rates--3 {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .rate-card {
    flex-direction: column;
    text-align: center;
    padding: 14px 10px;
  }

  .rate-name {
    flex: none;
  }

  .features-grid--app {
    gap: 10px;
  }

  .service-box-card--compact {
    height: 210px;
  }

  .service-box-card--compact .service-box-content {
    min-height: 148px;
  }

  .features-grid {
    gap: 20px;
  }

  .bg-icon-plane { top: 8%; right: 3%; left: auto; }
  .bg-icon-car { top: 8%; left: 3%; right: auto; }
  .bg-icon-metro { top: 26%; left: 0; right: auto; }
  .bg-icon-bus { top: 36%; right: 0; left: auto; }
  .bg-icon-sim { top: 42%; left: 0; right: auto; }
  .bg-icon-cash { top: 52%; left: 2%; right: auto; }

  .bg-icon-train {
    display: none;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .btn-lg {
    font-size: 0.9rem;
  }

  .footer-bottom {
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
}

/* Extra small — iPhone SE, narrow Android */
@media (max-width: 360px) {
  .container {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .logo-text {
    max-width: 100px;
    font-size: 0.9rem;
  }

  .header-actions .btn-sm {
    padding: 7px 10px;
    font-size: 0.7rem;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .hero-app-shot {
    width: min(200px, 68vw);
  }

  .features-grid--app {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .service-box-card--compact {
    height: 196px;
  }

  .service-box-content h3 {
    font-size: 0.82rem;
  }

  .service-box-tags span {
    font-size: 0.62rem;
    padding: 2px 7px;
  }

  .currency-rates,
  .currency-rates--3 {
    grid-template-columns: 1fr;
  }

  .converter-result {
    padding: 18px 12px;
  }

  .nav {
    width: min(280px, 92vw);
  }

  .scroll-top-btn {
    width: 44px;
    height: 44px;
  }

  .scroll-top-btn:hover {
    width: 120px;
  }

  .scroll-top-btn:hover::before {
    font-size: 11px;
  }

  .rate-card {
    min-height: 72px;
  }
}

/* ===== Traveler-friendly touch & mobile perf ===== */
@media (max-width: 768px) {
  .nav-overlay {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(10, 15, 26, 0.58);
  }

  .btn,
  .nav-link,
  .service-box-link,
  .scroll-top-btn,
  .appstore-button,
  .playstore-button,
  .download-io-button {
    touch-action: manipulation;
  }

  .hero-desc,
  .section-header .section-desc {
    line-height: 1.85;
    max-width: 38ch;
    margin-inline: auto;
  }

  .hero-flight-card {
    min-width: min(200px, 85vw);
    min-height: 52px;
    max-width: 85vw;
  }

  .hero-flights-head {
    padding-inline: 12px;
  }

  .hero-flights-title-wrap {
    flex: 1 1 100%;
  }

  .hero-flight-price {
    font-size: 0.82rem;
  }

  .download-buttons {
    gap: 12px;
    width: 100%;
    max-width: 320px;
    margin-inline: auto;
  }

  .scroll-top-btn {
    left: max(14px, env(safe-area-inset-left));
    bottom: max(18px, env(safe-area-inset-bottom));
  }

  .about-service-item {
    min-height: 84px;
    padding: 12px 8px;
  }

  .service-box-link {
    min-height: 44px;
    line-height: 30px;
    padding-inline: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-overlay {
    transition: none;
  }
}
