/* JMT TRAVELS — Mobile Responsive Foundation
 * Additive responsive layer. Preserves desktop styling and existing application logic.
 */

html, body { max-width: 100%; overflow-x: hidden; }
img, video, iframe { max-width: 100%; }

/* Service Card Hover Elevation */
.jmt-service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 230, 118, 0.15) !important;
  border-color: rgba(0, 230, 118, 0.4) !important;
}

/* Tablet / small laptop */
@media (max-width: 1100px) {
  .header-nav .shell,
  header[style] .shell { gap: 12px !important; padding-inline: 20px !important; }
  .nav-links { gap: 12px !important; }
  .nav-links a { font-size: 12px !important; }
  .nav-actions { gap: 8px !important; }
}

/* Phones */
@media (max-width: 900px) {
  .header-nav .shell,
  header[style] .shell {
    min-height: 68px !important;
    height: auto !important;
    padding: 10px 16px !important;
  }

  .brand-logo { min-width: 0; gap: 8px !important; }
  .brand-logo img { width: 42px !important; height: 42px !important; }
  .brand-title b { font-size: 17px !important; }
  .brand-title small { font-size: 7px !important; letter-spacing: 1px !important; }

  .nav-links { display: none !important; }
  .nav-actions { margin-left: auto; }
  .nav-actions #nav-auth { display: none !important; }
  .nav-actions .theme-toggle-btn { display: none !important; }
  .mobile-menu-btn { display: inline-flex !important; align-items: center; justify-content: center; color: #fff !important; background: #0B286C !important; border-radius: 10px !important; width: 42px; height: 42px; }

  .mobile-nav-drawer { padding: 14px 16px 20px !important; }
  .mobile-nav-links a { min-height: 42px; display: flex !important; align-items: center; }

  /* Top contact strip: convert desktop row into a compact mobile stack. */
  body > div:first-child .shell,
  body > .shell { flex-wrap: wrap !important; }
  body > div:first-child .shell > div:last-child { width: 100%; justify-content: flex-start !important; gap: 8px !important; flex-wrap: wrap !important; }
  body > div:first-child .shell > div:first-child { width: 100%; line-height: 1.4; }

  /* Generic grids collapse cleanly. */
  .card-grid,
  .reviews-grid,
  .timeline-grid,
  .destinations-grid,
  .destination-grid,
  .packages-grid,
  .hotel-grid,
  .flight-grid,
  .footer-grid { grid-template-columns: 1fr !important; }

  .shell, .container,
  #view-container > .shell { width: 100% !important; max-width: 100% !important; padding-inline: 16px !important; }

  /* Common page section spacing. */
  #view-container section { margin-inline: 0 !important; }
  #view-container .section,
  #view-container .section-pad,
  #view-container .page-section { padding-block: 38px !important; }

  /* Hero and image safety. */
  .hero-slideshow-wrap { height: clamp(360px, 72vw, 500px) !important; min-height: 360px !important; overflow: hidden !important; }
  .hero-slideshow-wrap .shell { width: 100% !important; max-width: 100% !important; padding-inline: 16px !important; }
  .hero-slide-item { background-position: center center !important; }
  .oman-promo-card { grid-template-columns: 1fr !important; margin: 40px 0 !important; }
  .oman-promo-content { padding: 28px 20px !important; }
  .oman-promo-image { min-height: 240px !important; max-height: 320px; }

  /* Search panels: one comfortable field per row. */
  form, .search-form, .flight-search, .hotel-search,
  .hero-search-card, .jmt-hotel-search-panel,
  #home-flight-panel, #home-flight-search-form,
  #flight-search-panel-container { max-width: 100% !important; width: 100% !important; box-sizing: border-box !important; }
  form > *, .search-form > *, .flight-search > *, .hotel-search > *,
  .hero-search-card > *, .jmt-hotel-search-panel > *,
  #home-flight-panel > *, #home-flight-search-form > *,
  #flight-search-panel-container > * { min-width: 0 !important; max-width: 100% !important; box-sizing: border-box !important; }

  form .form-row, form .search-row,
  .search-form .form-row, .search-form .search-row,
  .flight-search .form-row, .flight-search .search-row,
  .hotel-search .form-row, .hotel-search .search-row { grid-template-columns: 1fr !important; display: grid !important; }

  /* Flight search has its own desktop grid; force a single-column phone layout
     without changing the markup or search behaviour. */
  #home-flight-panel .jmt-flight-fields-grid,
  #home-flight-search-form .jmt-flight-fields-grid,
  #flight-search-panel-container .jmt-flight-fields-grid { grid-template-columns: 1fr !important; display: grid !important; gap: 12px !important; }
  #home-flight-panel .jmt-flight-fields-grid > *,
  #home-flight-search-form .jmt-flight-fields-grid > *,
  #flight-search-panel-container .jmt-flight-fields-grid > * { min-width: 0 !important; width: 100% !important; }

  input, select, textarea, button { max-width: 100%; box-sizing: border-box; }
  input, select, textarea { font-size: 16px; }
  form button, .search-form button, .flight-search button, .hotel-search button { width: 100%; }

  /* Prevent fixed-width cards/components from creating horizontal scroll. */
  .card, .jmt-card, .jmt-panel, .card-subtle, .jmt-card-subtle,
  .destination-card, .dest-card-box { min-width: 0 !important; max-width: 100% !important; }
  .destination-card { height: 300px !important; }

  /* Buttons wrap instead of forcing the viewport wider. */
  .btn-group, .hero-actions, .cta-actions, .action-row { flex-wrap: wrap !important; }
  .btn-group .btn, .hero-actions .btn, .cta-actions .btn { max-width: 100%; }

  /* Chatbot stays inside the safe mobile viewport. */
  .chatbot-drawer { left: 12px !important; right: 12px !important; bottom: 76px !important; width: auto !important; max-width: none !important; height: min(70vh, 520px) !important; border-radius: 16px !important; }
  .chatbot-trigger { right: 16px !important; bottom: 16px !important; }

  /* Tables become horizontally scrollable instead of breaking the viewport. */
  .table-responsive, .table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { max-width: 100%; }
}

@media (max-width: 600px) {
  .footer-grid { gap: 24px !important; }
  .card, .jmt-card, .jmt-panel, .card-subtle, .jmt-card-subtle { padding: 18px !important; }

  h1 { font-size: clamp(30px, 9vw, 42px) !important; line-height: 1.1 !important; }
  h2 { font-size: clamp(24px, 7vw, 34px) !important; line-height: 1.15 !important; }
  h3 { font-size: clamp(19px, 5.5vw, 26px) !important; }

  .hero-slideshow-wrap { height: 390px !important; min-height: 390px !important; }
  .hero-search-card { margin-inline: 0 !important; border-radius: 16px !important; }
  .jmt-hotel-search-panel { padding: 18px !important; border-radius: 16px !important; }
  .cta-banner-wrapper { padding: 38px 18px !important; margin-top: 40px !important; }

  /* Keep fixed chat controls clear of phone safe areas. */
  .chatbot-trigger { bottom: max(16px, env(safe-area-inset-bottom)) !important; }
  .chatbot-drawer { bottom: max(76px, calc(env(safe-area-inset-bottom) + 68px)) !important; }

  /* Comfortable tap targets on phones. */
  button, a.btn, input, select, textarea { min-height: 44px; }

  /* Avoid long labels/phone numbers forcing horizontal overflow. */
  .shell *, .container * { min-width: 0; }
  .top-strip, .contact-strip { line-height: 1.35 !important; }
  .top-strip a, .contact-strip a { overflow-wrap: anywhere; }
  .hero-slideshow-wrap .hero-content,
  .hero-slideshow-wrap .hero-copy { max-width: 100% !important; }
}

@media (max-width: 380px) {
  .brand-title { display: none !important; }
  .header-nav .shell, header[style] .shell { padding-inline: 12px !important; }
  .mobile-menu-btn { width: 40px; height: 40px; }
  .shell, .container, #view-container > .shell { padding-inline: 12px !important; }
}

/* Respect users who request reduced motion. */
@media (prefers-reduced-motion: reduce) {
  .hero-slide-item, .destination-card, .card, .jmt-card, * { scroll-behavior: auto !important; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* V2.9 Unified Enquiry Modal & Mobile CTA Styles */
.jmt-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 21, 59, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.jmt-modal-card {
  background: linear-gradient(135deg, #07153B 0%, #0B286C 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  color: #FFFFFF;
  padding: 28px;
  position: relative;
}

.jmt-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.jmt-modal-close {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #FFFFFF;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.jmt-modal-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Global Contact Helper Banner */
.jmt-global-helper-banner {
  background: linear-gradient(135deg, #07153B 0%, #0B286C 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  padding: 24px 30px;
  margin-top: 36px;
  margin-bottom: 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  box-shadow: 0 10px 30px rgba(7, 21, 59, 0.2);
}

@media (max-width: 600px) {
  .jmt-global-helper-banner {
    flex-direction: column;
    text-align: center;
    padding: 20px 16px;
  }
  .jmt-global-helper-banner > div:last-child {
    width: 100%;
    flex-direction: column;
  }
  .jmt-global-helper-banner a,
  .jmt-global-helper-banner button {
    width: 100%;
    justify-content: center;
  }
}

