/* Traveler-only responsive layout. No payment or reservation state changes. */

@media (max-width: 980px) {
  body .ua-hold-extend-btn,
  body .ua-checkout-step2-payment-toggle { min-height: 44px; height: auto; }
  body .nav-mobile { height: 100vh; height: 100dvh; box-sizing: border-box; }
  body .nav-mobile .nav-menu-list { display: flex; flex-direction: column; align-items: stretch; gap: 0; width: 100%; }
  body .nav-mobile .nav-menu-item { width: 100%; min-width: 0; }
  body .nav-mobile .nav-menu-link { min-height: 44px; box-sizing: border-box; white-space: normal; }
  body.nav-mobile-open { padding-right: 0; }
  body.nav-mobile-open .quick-consult-widget { display: none; }
}

@media (max-width: 760px) {
  body .footer .footer-grid.footer-grid-inner { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  body .footer .footer-brand.footer-brand-span { grid-column: auto; }
  body .footer .footer-grid > * { min-width: 0; overflow-wrap: anywhere; }
  body .footer-bank-list { min-width: 0; }
  body .footer-bank-logo-img { max-width: 100%; }
  body .quick-consult-widget {
    width: 56px; height: 56px; padding: 0; margin: 0;
    right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px));
  }
  body .quick-consult-widget > .quick-consult-main,
  body .quick-consult-widget > .quick-consult-item { bottom: 0; right: 0; width: 56px; height: 56px; }
  body .quick-consult-widget > .quick-consult-sub { bottom: 0; right: 0; }
  body .ua-lookup-page-wrap input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  body .ua-lookup-page-wrap select,
  body .ua-lookup-page-wrap textarea { font-size: 16px; max-width: 100%; }

}

@media (max-width: 920px) {
  body .ua-checkout-page-wrap { min-height: 0; padding: 0; }
  body .ua-checkout-card { max-height: none; border-radius: 0; }
  /* One scroll region for form + summary; the action bar is a separate flex row. */
  body .ua-checkout-content-row {
    display: flex; flex-direction: column; flex: 1 1 auto; overflow: auto;
    overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch;
  }
  body .ua-checkout-left { flex: none; width: 100%; padding: 0 16px; overflow: visible; box-sizing: border-box; }
  body .ua-checkout-main { flex: none; overflow: visible; }
  body .ua-checkout-header,
  body.ua-checkout-embed .ua-checkout-header { padding: 20px 36px 16px 0; }
  body .ua-checkout-header-inner { gap: 10px; }
  body .ua-checkout-header-icon { width: 36px; height: 36px; }
  body .ua-checkout-header-text { min-width: 0; }
  body .ua-checkout-header-text h1 { font-size: 18px; line-height: 1.4; }
  body .ua-checkout-header-text p { margin-top: 4px; line-height: 1.5; }
  body .ua-checkout-steps,
  body.ua-checkout-embed .ua-checkout-steps {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px;
    padding: 12px 0; border-top: 1px solid #e5e7eb; border-bottom: 1px solid #e5e7eb;
  }
  body .ua-checkout-step { min-width: 0; flex-direction: column; gap: 6px; text-align: center; }
  body .ua-checkout-step:not(:last-child)::after { display: none; }
  body .ua-checkout-step-num { margin: 0; }
  body .ua-checkout-step span { font-size: 10px; line-height: 1.5; white-space: nowrap; }
  body .ua-checkout-form,
  body.ua-checkout-embed .ua-checkout-form { padding: 8px 0 16px; }
  body .ua-checkout-form input:not([type="checkbox"]):not([type="radio"]),
  body .ua-checkout-form select,
  body .ua-checkout-form textarea { font-size: 16px; max-width: 100%; }
  body .ua-checkout-form input:not([type="checkbox"]):not([type="radio"]),
  body .ua-checkout-form select { min-height: 44px; }
  body .ua-checkout-form .ua-traveler-row,
  body .ua-checkout-form .ua-traveler-row.ua-row-3,
  body .ua-checkout-form .ua-traveler-row.ua-row-2,
  body .ua-checkout-form .ua-traveler-row.ua-row-1-2 { grid-template-columns: minmax(0, 1fr); }
  body .ua-checkout-form .ua-traveler-row > * { grid-column: 1 / -1; min-width: 0; }
  body .ua-checkout-summary-sidebar,
  body.ua-checkout-embed .ua-checkout-summary-sidebar {
    flex: none; width: 100%; padding: 16px; border-left: 0; overflow: visible; box-sizing: border-box;
  }
  body .ua-checkout-summary-sidebar > .ua-checkout-summary-scroll {
    flex: none; width: 100%; max-width: 100%; padding-right: 0; max-height: none; overflow: visible;
  }
  /* Override the legacy direct-child calc(100% + 50px), not just its margins.
     Parent overflow:hidden can conceal the error from page-width-only checks. */
  body .ua-checkout-summary-sidebar > .ua-checkout-step2-payment-wrap {
    width: 100%; max-width: 100%; min-width: 0; margin: 16px 0 0; padding: 16px;
    border: 1px solid #e5e7eb; border-radius: 10px; box-sizing: border-box;
  }
  body .ua-checkout-summary-sidebar .ua-checkout-step2-payment,
  body .ua-checkout-summary-sidebar .ua-checkout-step2-payment-body,
  body .ua-checkout-summary-sidebar .ua-checkout-step2-payment-discount,
  body .ua-checkout-summary-sidebar .ua-checkout-step2-payment-section {
    width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box;
  }
  body .ua-checkout-summary-sidebar .ua-checkout-step2-payment-body:not(.is-collapsed) {
    max-height: none; overflow: visible;
  }
  body .ua-checkout-summary-sidebar .ua-checkout-step2-payment-body.is-collapsed {
    max-height: 0; overflow: hidden;
  }
  body .ua-checkout-summary-sidebar .ua-checkout-step2-payment-total { flex-wrap: wrap; gap: 8px; }
  body .ua-checkout-summary-sidebar .ua-checkout-step2-payment-total .amount {
    max-width: 100%; overflow-wrap: anywhere; padding-right: 0;
  }
  body .ua-checkout-summary-sidebar .discount-row { display: flex; width: 100%; min-width: 0; }
  body .ua-checkout-summary-sidebar .discount-row input {
    width: 0; min-width: 0; flex: 1 1 0%; font-size: 16px; min-height: 44px;
  }
  body .ua-checkout-summary-sidebar .discount-row .btn-apply { min-height: 44px; }
  body .ua-section-title-row { flex-wrap: wrap; }
  body .ua-checkout-buttons-bar,
  body.ua-checkout-embed .ua-checkout-buttons-bar {
    position: static; flex: none; height: auto; min-height: 0; max-height: none;
    display: flex; flex-wrap: nowrap; padding: 10px 12px max(10px, env(safe-area-inset-bottom, 0px)); gap: 8px;
  }
  body .ua-checkout-buttons-bar .ua-product-info { display: none; }
  body .ua-checkout-buttons-bar .ua-buttons-wrap { flex: 1; min-width: 0; height: auto; gap: 8px; }
  body .ua-checkout-buttons-bar .ua-btn-cancel,
  body .ua-checkout-buttons-bar .ua-btn-back { flex: 1; width: auto; min-width: 0; padding: 10px 6px; min-height: 44px; box-sizing: border-box; justify-content: center; text-align: center; }
  body .ua-checkout-buttons-bar .ua-btn-checkout,
  body .ua-checkout-buttons-bar .ua-btn-next { flex: 2; width: auto; min-width: 0; max-width: none; min-height: 44px; padding: 10px; border-radius: 6px; font-size: 14px; }
  body.ua-checkout-embed .ua-checkout-card { padding-bottom: 0; max-height: none; }
  body.ua-checkout-embed .ua-checkout-page-wrap { min-height: 0; }
  /* The outer modal follows Safari's changing browser chrome height. */
  body .ua-checkout-popup-overlay { height: 100vh; height: 100dvh; bottom: auto; padding: 0; }
  body .ua-checkout-popup { min-width: 0; width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
}
