/* Only the live masthead gets the centred logo. Menu previews retain the
   original geometry of the navigation and its transitions. */
#wandoras-site-header #wandoras-global-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0;
}
#wandoras-global-nav > .wim-brand { grid-area: 1 / 2; justify-self: center; margin-inline: 0; }
#wandoras-global-nav > :is(.wim-trigger, .wim-fallback) { grid-area: 1 / 3; justify-self: end; }
@media (max-width: 360px) {
  #wandoras-site-header #wandoras-global-nav > .wim-trigger { gap: 5px; padding-inline-start: 0; }
  #wandoras-global-nav > .wim-trigger .wim-trigger-icon { width: 23px; }
}

/* Shared text alignment applies to content inserted after a page has loaded, too. */
@scope (html) to (#wandoras-site-header, .wim-dialog) {
@layer customer-text {
  :where(body *) { text-align: center !important; }
  :where(input, textarea)::placeholder { text-align: center; }
}

body :is(main, section, article, aside, form, dialog, footer) > :is(h1, h2, h3, h4, h5, h6, p, blockquote, table),
body fieldset > legend {
  margin-inline: auto;
}

body :where(main, article) :where(ul, ol):not([class]) {
  padding-inline: 0;
  list-style-position: inside;
}

body .wsl-landing .wsl-copy {
  inset-inline: 7%;
  margin-inline: auto;
}

body .wsl-landing :is(.wsl-title, .wsl-description, .wsl-kicker) {
  margin-inline: auto;
}

body .wsl-landing .wsl-scroll {
  inset-inline: 0;
  width: max-content;
  max-width: 90%;
  margin-inline: auto;
  justify-content: center;
}

body .wsl-landing:has(.wsl-image-note) .wsl-scroll {
  bottom: max(3.5rem, env(safe-area-inset-bottom));
}

body .wsl-landing .wsl-image-note {
  inset-inline: 0;
  max-width: 88%;
  margin-inline: auto;
  bottom: max(1rem, env(safe-area-inset-bottom));
}

/* Each slide owns its copy. The moving track and the direction buttons keep their geometry. */
body.atlas-home .whp-home .whp-hero-content,
body.atlas-home .whp-home .whp-story-copy {
  align-items: center;
}

body.atlas-home .whp-home .whp-hero .cinema-copy,
body.atlas-home .whp-home .whp-hero .cinema-copy :is(h1, h2, p),
body.atlas-home .whp-home :is(.whp-mixcopy, .whp-story-copy, .whp-video-grid, .whp-wandra-copy) p {
  margin-inline: auto;
}

body.atlas-home .whp-home .whp-hero :is(.whp-hero-actions, .cinema-actions),
body.atlas-home .whp-home :is(.whp-mixlinks, .credibility-evidence, .whp-stopover-fares) {
  justify-content: center;
}

body.atlas-home .whp-home .whp-hero :is(.whp-hero-foot, .cinema-caption) {
  inset-inline: 0;
  margin-inline: auto;
  width: fit-content;
  max-width: 80%;
}

body.atlas-home .whp-home :is(.whp-sectionhead, .whp-end, .credibility-heading) {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  row-gap: .75rem;
}

body.atlas-home .whp-home .whp-sectionhead > p { margin-inline: auto; }
body.atlas-home .whp-home :is(.whp-hero-actions, .cinema-actions) > :is(a, button) { justify-content: center; }

#wandoras-site-footer .footer-inner {
  justify-items: center;
}

#wandoras-site-footer .footer-inner > div:first-child,
#wandoras-site-footer .footer-inner p {
  margin-inline: auto;
}

#wandoras-site-footer .footer-nav > div { align-items: center; }
#wandoras-site-footer .wandoras-cookie-settings { display: block; margin-inline: auto; }

/* These titles have their own width limits; centre the title box as well as its lines. */
body .wsl-landing .wsl-copy > :is(.wsl-title, .wsl-description, .wsl-kicker),
body .fct-booking-review-wrap > :is(h1, p),
body .public-attractions-heading :is(h1, p),
body .public-attractions :is(h1, h2) {
  margin-inline: auto !important;
}

body .pt-hub .pt-editorial :is(h2, p),
body main.sig > .lead > div > :is(h1, p),
body .night-tours .nt-hero :is(h1, p) { margin-inline: auto; }
body .pt-hub :is(.pt-filters, .pt-durations),
body .night-tours .nt-hero :is(.nt-actions, .wm-discovery-choices) { justify-content: safe center; }

body .pt-hero .pt-hero-layout > .wsl-copy {
  justify-self: center;
  margin-inline: auto;
}
body .pt-hero .pt-hero-layout .pt-comparison { margin-inline: auto; }

/* Keep the photograph and the booking panel in their own columns. Centre each column’s content. */
#main-content :is(.tb-section, .tb-tools, .collection-detail-page, .public-attractions-heading, .public-attraction-card-prices),
#main-content .tb-section :is(.tb-list-price, .tb-editorial-prices, .tb-editorial-heading),
#main-content .public-attractions-card--mix .public-attraction-card-prices :is(dt, dd),
#main-content .public-attractions-search input { text-align: center; }
#main-content :is(.tb-editorial-heading, .collection-detail-hero) :is(h1,h2,p),
#main-content .tb-list-heading :is(h3,p) { margin-inline: auto; }
#main-content :is(.tb-filters, .tb-rating, .tb-editorial-prices dl, .public-attractions-chips, .public-ticket-transport-controls),
#main-content .public-attraction-card-prices dl > div,
#main-content .public-attractions-card--mix .public-attractions-card-actions,
#main-content.bundle-product .bundle-comparison div { justify-content: safe center; }
#main-content .tb-section .tb-list-footer,
#main-content .tb-tools .tb-list-footer { flex-direction: column; align-items: center; }
#main-content :is(.tb-list-price, .tb-list-footer > .tb-rating) { margin-inline: auto; text-align: center; }
#main-content .tb-editorial-content :is(.tb-rating,.tb-editorial-cta) { align-self: center; }
#main-content .tb-editorial-media .tb-bundle-badge { inset-inline: 0; width: fit-content; margin-inline: auto; }
#main-content .public-attractions-card--mix .public-attraction-card-prices { text-align: center; }
#main-content .public-attractions-filters summary,
#main-content.public-attractions .public-attractions-hero { justify-content: center; }
#main-content.public-attractions .public-attractions-cart { margin-inline: auto; }
.public-attraction-shell-page .attraction-shell-status { text-align: center; }
.public-attraction-shell-page .attraction-shell-links { justify-content: safe center; }
.public-attraction-details-dialog { text-align: center; }
.public-attraction-details-dialog .public-attraction-details-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.public-attraction-details-header > strong { grid-column: 2; }
.public-attraction-details-header > button { justify-self: end; }
.public-attraction-details-dialog .public-attraction-details-footer { flex-wrap: wrap; justify-content: center; }

/* Option names, rates and review controls share the centre of the available card. */
dialog.tour-checkout, dialog.tour-checkout :is(h2,h3,legend,summary,.tour-option-name,.tour-option-status,.tour-option-location) { text-align: center; }
.tour-checkout :is(.tour-option-group legend,.tour-joining-details summary) { margin-inline: auto; }
.tour-checkout :is(.tour-party-recap,.tour-group-total,.tour-checkout-actions,.tour-option-fare) { justify-content: center; }
.tour-checkout .tour-option-body { grid-template-columns: 17px minmax(0,1fr) 17px; }
.tour-checkout .tour-option-name { grid-column: 2; }

/* Keep route fields, fares and journey controls centered in both transfer layouts. */
#wandoras-airport-page .w-content,
#wandoras-airport-page :is(legend,label,input:not([type=checkbox],[type=radio]),select,textarea,.airport-date-trigger,.transfer-picker-trigger,.w-option-price) { text-align: center; }
#wandoras-airport-page :is(.w-search-top,.w-tabs,.w-singapore,.w-benefits,.w-route,.w-specs,.airport-date-trigger,.transfer-picker-trigger),
#wandoras-airport-page #airport-party-fields { justify-content: center; }
#wandoras-airport-page .w-search-top { flex-direction: column; align-items: center; }
#wandoras-airport-page :is(.w-tabs,.w-singapore,.w-vehicle-copy p,.w-group-note,.w-search legend) { margin-inline: auto; }
#wandoras-airport-page .w-option { grid-template-columns: 17px minmax(0,1fr) 17px; }
#wandoras-airport-page .w-option-price { grid-column: 2; grid-row: 2; justify-self: center; }

/* The editor mounts its versioned stylesheet after the page has loaded. Keep its
   alignment override stable across both editor releases and lazy-loaded screens. */
@layer wandoras-editor-alignment {
  [data-native-trip],
  [data-native-trip] :where([data-trip-fallback], [data-trip-fallback] *, #wm-mix-all, #wm-mix-all *) {
    text-align: center !important;
  }

  /* A centred line also needs a centred measure when the design caps its width. */
  [data-native-trip] #wm-mix-all :where(h1, h2, h3, h4, h5, h6, p, legend) {
    margin-inline: auto !important;
  }

  /* Centre related actions and their captions without changing grid columns,
     calendar navigation, stepper order, or the position of the sticky tray. */
  [data-native-trip] #wm-mix-all :where(
    .mm-card-footer, .mm-card-actions, .mm-catalog .mm-card-actions,
    .mm-price, .mm-dock-price, .mm-dock-actions, .mm-trip-actions, .mm-trip-context, .mm-trip-context-actions,
    .mm-category-head, .mm-itinerary-entry-actions, .mm-itinerary-footer,
    .mm-details-actions, .mm-setup-actions, .mm-setup-secondary-actions,
    .mm-checkout-actions, .mm-combine-save-actions, .mm-combine-save-selected-actions,
    .sd-actions, .sd-pick-action, .sd-evening-more summary, .sd-pickup-option, .sd-airport,
    .be-choice, .be-date-time, .be-line-price, .be-sum-row, summary, .wd-designed-trigger
  ) {
    justify-content: center !important;
  }

  [data-native-trip] #wm-mix-all :where(.sd-pickup-option, .mm-trip-actions) {
    align-items: center !important;
  }

  [data-native-trip] #wm-mix-all :where(.sd-sectionhead, .sd-day > header, .sd-evening-heading, .be-section-top) {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: .3rem;
  }

  [data-native-trip] #wm-mix-all :where(.be-guests > summary > strong, .sd-airport button) {
    margin-inline: 0 !important;
  }

  [data-native-trip] #wm-mix-all :where(.sd-hero > div, .mm-card-title > button) {
    margin-inline: auto !important;
  }

  [data-native-trip] #wm-mix-all .mm-hotel-handoff > a {
    justify-self: center !important;
  }

  /* Keep both sides of price and trip-detail pairs aligned, including when
     descriptions or converted currency amounts wrap onto a second line. */
  [data-native-trip] #wm-mix-all :where(.sd-charge, .sd-total, .sd-saving, .sd-tripinfo > div) {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: center;
    column-gap: .5rem;
  }

  [data-native-trip] #wm-mix-all :where(.sd-charge, .sd-tripinfo > div) > :where(dt, dd) {
    margin-inline: 0 !important;
    overflow-wrap: anywhere;
  }

  /* The dialog title remains geometrically centred while the close control
     retains its own column and accessible target. */
  [data-native-trip] #wm-mix-all :is(.sd-dialog-title, .wd-designed-dialog-header):has(> :is(h2, h3) + button:last-child) {
    display: grid !important;
    grid-template-columns: minmax(2.75rem, 1fr) minmax(0, auto) minmax(2.75rem, 1fr);
    align-items: center;
  }

  [data-native-trip] #wm-mix-all :is(.sd-dialog-title, .wd-designed-dialog-header) > :is(h2, h3) {
    grid-column: 2;
  }

  [data-native-trip] #wm-mix-all :is(.sd-dialog-title, .wd-designed-dialog-header) > button {
    grid-column: 3;
    justify-self: end;
  }
}

/* Centre copy and actions within the existing editorial columns and cards. */
:is(.atlas-editorial, .atlas-batch3) main :is(h1, h2, h3, p),
.atlas-editorial main :is(.destination-hero-copy, .guides-search, .guide-article-header, .guides-landing-hero > div),
.atlas-batch3 main :is(.b3-section-heading, .b3-reading, .prose-page, .page-hero),
main :is(.today-intro, .today-disclosure, .collection-detail-hero p, .planning-page .journey-photo-hero > div),
main :is(.wc-introduction, .wc-feature, .wc-discover-copy) :is(h2, h3, p) {
  margin-inline: auto;
}

.atlas-editorial main :is(.guide-hub-hero, .guide-destination-card, .destination-tile) {
  align-items: center;
}

.atlas-editorial main :is(.hero-actions, .guide-crumbs, .guide-byline, .guide-booking-end, .guide-chips),
.atlas-batch3 main :is(.b3-actions, .b3-topic-nav),
main :is(.today-filters, .quick-filters, .today-actions, .quick-card-bottom) {
  justify-content: center;
}

.atlas-editorial main .section-head,
main :is(.planning-page, .collection-detail-page) .section-head {
  align-items: center;
  justify-content: center;
}

.atlas-editorial main .guide-reading-layout,
.atlas-batch3 main .b3-help-layout {
  margin-inline: auto;
}

.atlas-editorial main .guide-article .guide-list-item {
  padding-inline-start: 0;
}
.atlas-editorial main .guide-list-item::before {
  position: static;
  margin-inline-end: .4em;
}

.atlas-batch3 main .b3-faq summary {
  position: relative;
  justify-content: center;
  padding-inline: 2rem;
}
.atlas-batch3 main .b3-faq summary::after {
  position: absolute;
  inset-inline-end: .5rem;
}

main .wc-discover-inner {
  justify-content: center;
}
main .itinerary-story article {
  padding-inline-end: 30px;
}

@media (max-width: 420px) {
  #wandoras-airport-page .airport-inline-luggage > :is(label:has(select), [data-airport-guidance]) {
    grid-column: 1 / -1;
    min-width: 0;
  }
  #wandoras-airport-page .airport-inline-luggage select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
}
}
