/* DEC 3.2.14 — separate, uncluttered phone steps on the COMPLETE booking page.
 * <=740px only; the existing desktop journey, look and business logic stay intact.
 * Works equally for the WordPress booking page and the installed DEC PWA.
 */
@media screen and (max-width:740px) {
  /* Ensure hidden stages NEVER occupy space, regardless of builder/app styles. */
  .at24-booking.dec-reference-booking .at24-panel[hidden] {display:none!important;}
  .at24-booking.dec-reference-booking .at24-step[hidden],
  .at24-booking.dec-reference-booking .dec-mobile-trip-line[hidden] {display:none!important;}

  .at24-booking.dec-reference-booking[data-dec-mode="complete"].dec-mobile-confirm-active
    .dec-top-tabs,
  .at24-booking.dec-reference-booking[data-dec-mode="complete"].dec-mobile-confirm-active:not(.dec-mobile-confirm-editing)
    .at24-searchbar.dec-search-line {display:none!important;}

  /* When the passenger edits their journey, retain original fields but never
     display a second Get My Quote button above the confirmation. */
  .at24-booking.dec-reference-booking[data-dec-mode="complete"].dec-mobile-confirm-active
    .at24-searchbar.dec-search-line .dec-quote-button {display:none!important;}
  .at24-booking.dec-reference-booking[data-dec-mode="complete"].dec-mobile-confirm-active.dec-mobile-confirm-editing
    .dec-top-tabs {display:flex!important;}

  .at24-booking.dec-reference-booking[data-dec-mode="complete"].dec-mobile-confirm-active
    .dec-complete-heading {padding:18px 15px 5px!important;}
  .at24-booking.dec-reference-booking[data-dec-mode="complete"].dec-mobile-confirm-active
    .dec-complete-heading strong {font-size:clamp(23px,5.6vw,29px)!important;line-height:1.2!important;}
  .at24-booking.dec-reference-booking[data-dec-mode="complete"].dec-mobile-confirm-active
    .dec-complete-heading p {font-size:13px!important;line-height:1.5!important;}

  .at24-booking.dec-reference-booking[data-dec-mode="complete"].dec-mobile-confirm-active
    .dec-mobile-trip-summary:not([hidden]) {display:block!important;margin:10px 14px!important;padding:15px!important;background:#fdfbf7!important;border:1px solid #dbc7a2!important;border-radius:13px!important;}
  .at24-booking.dec-reference-booking[data-dec-mode="complete"].dec-mobile-confirm-active
    .dec-mobile-trip-line:not([hidden]) {display:flex!important;flex-direction:column!important;gap:3px!important;padding:9px 0!important;border-bottom:1px solid #eee6d9!important;}
  .at24-booking.dec-reference-booking[data-dec-mode="complete"].dec-mobile-confirm-active
    .dec-mobile-trip-line span {color:#6b6253!important;font-size:12px!important;font-weight:600!important;}
  .at24-booking.dec-reference-booking[data-dec-mode="complete"].dec-mobile-confirm-active
    .dec-mobile-trip-line strong {color:#171717!important;font-size:14px!important;font-weight:650!important;line-height:1.45!important;overflow-wrap:anywhere!important;}
  .at24-booking.dec-reference-booking[data-dec-mode="complete"].dec-mobile-confirm-active
    .dec-mobile-trip-pair {display:grid!important;grid-template-columns:1fr 1fr!important;gap:12px!important;}
  .at24-booking.dec-reference-booking[data-dec-mode="complete"].dec-mobile-confirm-active
    .dec-mobile-edit-route {display:inline-flex!important;margin:12px 0 0!important;padding:8px 2px!important;min-height:34px!important;border:0!important;background:transparent!important;color:#8a6127!important;text-decoration:underline!important;font-size:13px!important;font-weight:700!important;cursor:pointer!important;}
  .at24-booking.dec-reference-booking[data-dec-mode="complete"].dec-mobile-confirm-active
    .dec-mobile-confirm-actions:not([hidden]) {display:flex!important;min-width:0!important;margin:0!important;align-items:stretch!important;}
  .at24-booking.dec-reference-booking[data-dec-mode="complete"].dec-mobile-confirm-active
    .dec-mobile-confirm-actions .at24-btn {width:100%!important;min-height:48px!important;height:auto!important;padding:9px 10px!important;font-size:13px!important;line-height:1.3!important;white-space:normal!important;}
  /* On the terminal step the only journey controls are summary, terminal
     selections, existing Journey options and Continue; no stacked form. */
  .at24-booking.dec-reference-booking[data-dec-mode="complete"].dec-mobile-confirm-active
    .dec-journey-options {margin:0!important;min-width:0!important;align-self:center!important;}

  /* Mobile CONFIRM-ONLY layout. Keep markup exactly as before v3.2.13 on
     desktop; the additional button aligns through CSS grid only on phones. */
  .at24-booking.dec-reference-booking[data-dec-mode="complete"].dec-mobile-confirm-active
    .dec-main-surface {
      display:grid!important;
      grid-template-columns:minmax(100px,.83fr) minmax(0,1.17fr)!important;
      column-gap:10px!important;
      align-items:center!important;
  }
  .at24-booking.dec-reference-booking[data-dec-mode="complete"].dec-mobile-confirm-active
    .dec-main-surface > :not(.dec-journey-options):not(.dec-mobile-confirm-actions) {
      grid-column:1 / -1!important;
      width:100%!important;
      min-width:0!important;
  }
  .at24-booking.dec-reference-booking[data-dec-mode="complete"].dec-mobile-confirm-active
    .dec-main-surface > .dec-journey-options {
      grid-column:1!important;
      margin:8px 0 12px!important;
  }
  .at24-booking.dec-reference-booking[data-dec-mode="complete"].dec-mobile-confirm-active
    .dec-main-surface > .dec-mobile-confirm-actions:not([hidden]) {
      grid-column:2!important;
      margin:8px 0 12px!important;
  }
  .at24-booking.dec-reference-booking[data-dec-mode="complete"].dec-mobile-confirm-active
    .dec-main-surface:has(> .dec-journey-options[open]) {
      grid-template-columns:minmax(0,1fr)!important;
  }
  .at24-booking.dec-reference-booking[data-dec-mode="complete"].dec-mobile-confirm-active
    .dec-main-surface:has(> .dec-journey-options[open]) > .dec-journey-options,
  .at24-booking.dec-reference-booking[data-dec-mode="complete"].dec-mobile-confirm-active
    .dec-main-surface:has(> .dec-journey-options[open]) > .dec-mobile-confirm-actions:not([hidden]) {
      grid-column:1 / -1!important;
  }
  .at24-booking.dec-reference-booking[data-dec-mode="complete"].dec-mobile-confirm-active
    .dec-journey-options>summary {white-space:normal!important;font-size:12px!important;}

  /* Prevent Elementor's previously reserved / fixed widget or containing
     section height from holding a tall empty area after a mobile stage change.
     Only the nearest marked booking host is affected; the homepage hero and
     all desktop heights remain as designed. */
  .dec-mobile-compact-booking-host,
  .dec-mobile-compact-booking-host > .elementor-widget-container,
  .dec-mobile-compact-booking-host .elementor-shortcode,
  .dec-mobile-compact-booking-section,
  .dec-mobile-compact-booking-section > .e-con-inner,
  .dec-mobile-compact-booking-section > .elementor-container,
  .dec-mobile-compact-booking-section > .elementor-widget-wrap {
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
  }
  .at24-booking.dec-reference-booking.dec-mobile-compact-booking-root,
  .at24-booking.dec-reference-booking.dec-mobile-compact-booking-root .at24-card,
  .at24-booking.dec-reference-booking.dec-mobile-compact-booking-root #at24-form {
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin-bottom:0!important;
    padding-bottom:0!important;
  }
  /* In narrow phones the CTA can safely wrap to a full-width second row. */
  @media (max-width:340px) {
    .at24-booking.dec-reference-booking[data-dec-mode="complete"].dec-mobile-confirm-active
      .dec-main-surface {grid-template-columns:1fr!important;}
    .at24-booking.dec-reference-booking[data-dec-mode="complete"].dec-mobile-confirm-active
      .dec-main-surface > .dec-mobile-confirm-actions:not([hidden]) {grid-column:1!important;grid-row:auto!important;}
  }
}
/* Mobile-only elements remain absent on desktop even after device rotation. */
@media screen and (min-width:741px){
  .at24-booking.dec-reference-booking .dec-mobile-trip-summary,
  .at24-booking.dec-reference-booking .dec-mobile-confirm-actions {display:none!important;}
}
