/* ===================================================
   TKT JSC — RESPONSIVE / MOBILE-FIRST FIXES
   Tested: iPhone SE (375), iPhone 14 Pro (393),
           iPhone 14 Plus (430), iPad (768),
           iPad Pro (1024), Android (360/412)
   =================================================== */

/* ─── ANNOUNCE BAR ─────────────────────────────── */
@media (max-width: 640px) {
  .announce-bar {
    font-size: 11.5px;
    padding: 7px 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ─── HEADER ────────────────────────────────────── */
@media (max-width: 768px) {
  .header-top {
    padding: 8px 14px;
    gap: 8px;
  }
  .logo-img {
    height: 38px !important;
    width: auto;
  }
  .nav-actions {
    gap: 6px;
    flex-shrink: 0;
  }
  /* Hide lang button on small screens */
  .lang-btn { display: none; }

  /* Compact login/register */
  .login-btn {
    padding: 7px 11px;
    font-size: 12px;
    white-space: nowrap;
  }
  .register-btn {
    padding: 7px 11px;
    font-size: 12px;
    white-space: nowrap;
  }
  .menu-toggle { font-size: 20px; padding: 4px; }
}

@media (max-width: 400px) {
  .login-btn { display: none; } /* hide login, keep register + hamburger */
  .register-btn {
    padding: 7px 12px;
    font-size: 12px;
  }
}

/* ─── SERVICE TABS ──────────────────────────────── */
@media (max-width: 768px) {
  .service-tab {
    padding: 10px 13px;
    min-width: 76px;
    font-size: 11.5px;
  }
  .service-tab span.icon { font-size: 18px; }
}

/* ─── HERO ──────────────────────────────────────── */
@media (max-width: 768px) {
  .hero { padding: 28px 16px 52px; }

  .hero-text h1 {
    font-size: 22px;
    line-height: 1.3;
    margin-bottom: 8px;
  }
  .hero-text p {
    font-size: 13.5px;
    line-height: 1.5;
  }
  /* Logo in hero — smaller */
  .hero-text img {
    height: 68px !important;
    margin-bottom: 14px !important;
  }
}

@media (max-width: 400px) {
  .hero-text h1 { font-size: 20px; }
  .hero-text p  { font-size: 13px; }
}

/* ─── SEARCH WIDGET ─────────────────────────────── */
@media (max-width: 768px) {
  .search-widget {
    padding: 16px 14px;
    border-radius: 14px;
    margin: 0 4px;
  }

  /* Trip type – stop text wrapping */
  .trip-type {
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: nowrap;
  }
  .trip-type label {
    padding: 7px 10px;
    font-size: 12.5px;
    border-radius: 18px;
    white-space: nowrap;
    flex: 1;
    justify-content: center;
    text-align: center;
  }

  /* All search rows → 1 col */
  .search-row,
  .search-row-2,
  .search-row-3,
  .hotel-search-row {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  /* Swap button full width, centered */
  .swap-btn {
    align-self: center;
    margin: 0 auto 0;
  }

  .form-group .input-wrap { padding: 10px 12px; }
  .form-group label       { font-size: 10.5px; }
  .form-group input,
  .form-group select      { font-size: 14px; }

  /* Passenger row */
  .passenger-row {
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
  }
  .passenger-select {
    min-width: 0;
    flex: 1 1 44%;
    padding: 9px 10px;
    font-size: 13px;
  }
  .direct-check, .promo-check { font-size: 12.5px; }

  /* Search button */
  .search-btn {
    padding: 13px 36px;
    font-size: 15px;
    width: 100%;
    max-width: 320px;
  }
}

/* Tablet 2-col search (iPad) */
@media (min-width: 540px) and (max-width: 900px) {
  .search-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px;
  }
  /* Keep swap button inline on tablet */
  .swap-btn { display: none; }
}

/* ─── STATS SECTION ─────────────────────────────── */
@media (max-width: 600px) {
  /* 4 cols → 2x2 grid */
  .stats-section .container > div {
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
  }
  .stats-section .container > div > div > div:first-child {
    font-size: 32px !important;
  }
}

/* ─── DEAL CARDS ────────────────────────────────── */
@media (max-width: 500px) {
  .deals-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }
  .deal-card-img { height: 200px; }
}
@media (min-width: 501px) and (max-width: 768px) {
  .deals-grid { grid-template-columns: 1fr 1fr; }
}

/* ─── DESTINATION GRID ──────────────────────────── */
@media (max-width: 500px) {
  .dest-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px;
  }
  .dest-card { height: 160px; }
  .dest-overlay h3 { font-size: 14px; }
  .dest-overlay p  { font-size: 11px; }
}

/* ─── FEATURES GRID ─────────────────────────────── */
@media (max-width: 500px) {
  .features-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px;
  }
  .feature-item { padding: 16px 12px; }
  .feature-icon { font-size: 30px; margin-bottom: 8px; }
  .feature-item h3 { font-size: 13px; }
  .feature-item p  { font-size: 12px; }
}

/* ─── APP SECTION ───────────────────────────────── */
@media (max-width: 768px) {
  .app-section { padding: 36px 16px; }
  .app-section-inner {
    flex-direction: column;
    gap: 24px;
    text-align: center;
  }
  .app-text h2 { font-size: 22px; margin-bottom: 10px; }
  .app-text p  { font-size: 14px; }
  .app-stats   { justify-content: center; gap: 24px; flex-wrap: wrap; }
  .app-stat strong { font-size: 22px; }
  .app-buttons { justify-content: center; }
  .app-mockup  { display: none; }
}

/* ─── TESTIMONIALS ──────────────────────────────── */
@media (max-width: 600px) {
  .testimonials-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ─── NEWSLETTER ─────────────────────────────────── */
@media (max-width: 540px) {
  .newsletter-section { padding: 36px 16px; }
  .newsletter-inner h2 { font-size: 20px; }
  .newsletter-form {
    flex-direction: column;
    gap: 8px;
  }
  .newsletter-form input,
  .newsletter-form button { width: 100%; }
}

/* ─── PROMO STRIP ───────────────────────────────── */
@media (max-width: 600px) {
  .promo-strip { padding: 9px 12px; font-size: 12px; }
  .promo-strip .container { gap: 6px; flex-wrap: wrap; justify-content: center; }
}

/* ─── FOOTER ─────────────────────────────────────── */
@media (max-width: 768px) {
  .footer { padding: 36px 16px 20px; }
  .footer-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 24px;
  }
  .footer-logo-img { height: 48px !important; }
  .footer-col h4 { font-size: 12px; }
  .footer-col a  { font-size: 13px; }
}
@media (max-width: 440px) {
  .footer-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 600px) {
  .footer-bottom {
    flex-direction: column;
    gap: 10px;
    text-align: center;
    font-size: 11px;
  }
  .footer-bottom-links { gap: 12px; font-size: 11px; }
  .payment-icons { justify-content: center; }
}

/* ─── MODALS ─────────────────────────────────────── */
@media (max-width: 540px) {
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    border-radius: 20px 20px 0 0 !important;
    padding: 24px 18px !important;
    max-height: 92vh;
    width: 100%;
    max-width: 100%;
  }
  .form-row { grid-template-columns: 1fr !important; }
  .payment-methods { grid-template-columns: repeat(3, 1fr) !important; }
  .payment-method { padding: 8px 4px; font-size: 11px; }
  .payment-method .icon { font-size: 20px; }
}

/* ─── FLIGHT RESULTS ────────────────────────────── */
@media (max-width: 768px) {
  .results-layout {
    grid-template-columns: 1fr !important;
  }
  .flight-main { flex-wrap: wrap; gap: 12px; }
  .flight-times { order: 3; width: 100%; }
  .flight-price {
    min-width: 0;
    flex: 1;
    text-align: right;
  }
  .airline { min-width: 0; flex: 1; }
}

/* ─── ACTIVITY CARDS ────────────────────────────── */
@media (max-width: 600px) {
  /* inline grid on activity section */
  section#activities .container > div {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }
  .activity-card-img { height: 140px; }
  .activity-card-body h3 { font-size: 13px; }
}
@media (max-width: 400px) {
  section#activities .container > div {
    grid-template-columns: 1fr !important;
  }
}

/* ─── CAR RENTAL ────────────────────────────────── */
@media (max-width: 600px) {
  section#car-rental .deals-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* ─── SCROLL-TO-TOP ─────────────────────────────── */
@media (max-width: 480px) {
  .scroll-top { bottom: 16px; right: 16px; width: 40px; height: 40px; font-size: 17px; }
}

/* ─── SECTION TITLES ────────────────────────────── */
@media (max-width: 540px) {
  .section-title { font-size: 20px; }
  .section-sub   { font-size: 13px; }
  .section       { padding: 36px 14px; }
}

/* ─── IPAD / TABLET (768–1024) ──────────────────── */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Show nav links on iPad */
  .nav-links { display: flex !important; }
  .menu-toggle { display: none !important; }
  .nav-links a { padding: 7px 9px; font-size: 12px; }

  /* Full width container */
  .container,
  .header-top,
  .hero-content,
  .service-tabs-inner {
    max-width: 100%;
    padding-left: 20px;
    padding-right: 20px;
  }

  /* 2-col search on iPad portrait */
  .search-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px;
  }
  .search-widget { padding: 22px; max-width: 100%; }

  /* 3-col features */
  .features-grid { grid-template-columns: repeat(3, 1fr) !important; }

  /* Footer 3-col */
  .footer-grid { grid-template-columns: 1fr 1fr 1fr !important; }

  /* Hero sizing */
  .hero-text h1 { font-size: 30px; }
  .hero-text img { height: 78px !important; }

  /* Deal cards 2-col on iPad */
  .deals-grid { grid-template-columns: 1fr 1fr !important; }
}

/* ─── IPAD LANDSCAPE / LARGE TABLET (900–1100px) ── */
@media (min-width: 900px) and (max-width: 1100px) {
  .search-row {
    grid-template-columns: 1fr 1fr 1fr 1fr !important;
    gap: 10px;
  }
  .hero-text h1 { font-size: 34px; }
  .nav-links a  { padding: 8px 10px; font-size: 13px; }
  .deals-grid   { grid-template-columns: repeat(3, 1fr) !important; }
}

/* ─── SAFE AREA (iPhone notch / Dynamic Island) ─── */
@supports (padding: max(0px)) {
  .header-top {
    padding-left:  max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }
  .hero { padding-bottom: max(52px, calc(40px + env(safe-area-inset-bottom))); }
  .footer { padding-bottom: max(24px, calc(16px + env(safe-area-inset-bottom))); }
  .modal-overlay { padding-bottom: env(safe-area-inset-bottom); }
}

/* ─── TOUCH TARGET SIZE (accessibility) ─────────── */
@media (max-width: 768px) {
  .btn, button, a.btn,
  .service-tab, .region-btn,
  .deal-card, .dest-card {
    -webkit-tap-highlight-color: transparent;
  }
  /* Minimum touch target 44x44 */
  .wishlist-btn { width: 38px; height: 38px; font-size: 17px; }
  .swap-btn     { width: 44px; height: 44px; }
  .modal-close  { padding: 8px; font-size: 20px; }
}

/* ─── FONT SMOOTHING ────────────────────────────── */
@media (max-width: 768px) {
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }
  /* Prevent text zoom on iOS when focusing inputs */
  input, select, textarea {
    font-size: max(16px, 1em) !important;
  }
}

/* ─── DESTINATIONS PAGE MOBILE ──────────────────── */
@media (max-width: 600px) {
  .dest-grid-3, .dest-grid-4 {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px;
  }
  .dest-grid-2 {
    grid-template-columns: 1fr !important;
  }
  .featured-card { height: 260px !important; }
  .featured-overlay h2 { font-size: 20px !important; }
  .featured-overlay p  { display: none; }
  .dest-big-card .img-wrap { height: 160px !important; }
  .dest-sm-card { height: 150px !important; }
  .dest-sm-overlay h4 { font-size: 13px; }
  .compare-table { font-size: 11px; }
  .compare-table th,
  .compare-table td { padding: 8px 8px; }
  .weather-row { grid-template-columns: repeat(6, 1fr); }
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px;
  }
  .filter-tabs { gap: 6px; }
  .ftab { padding: 7px 12px; font-size: 12px; }
  .page-hero h1 { font-size: 24px; }
  .page-hero p  { font-size: 14px; }
}

@media (min-width: 601px) and (max-width: 900px) {
  .dest-grid-3 { grid-template-columns: 1fr 1fr !important; }
  .dest-grid-4 { grid-template-columns: 1fr 1fr !important; }
}

/* ─── PREVENT HORIZONTAL SCROLL ────────────────── */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}
.header-top,
.search-widget,
.hero-content {
  max-width: 100%;
}
