/* Shared B2C mobile / responsive polish &mdash; load after page CSS */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  position: relative;
}

img,
video,
iframe,
svg {
  max-width: 100%;
}

/* &mdash;&mdash; Kill page-level sideways pan / &#8220;zoomed out&#8221; feel &mdash;&mdash; */
@media (max-width: 767px) {
  .site-header,
  .utility,
  .hero,
  .hero__inner,
  .home-below-search,
  .home-section,
  .home-banner-host,
  .site-footer,
  main,
  .page,
  .results-wrap,
  .checkout,
  .checkout-form,
  .summary {
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
  }

  /* Utility bar &rarr; side menu on phones; top bar = logo + saves + cart + menu */
  .utility,
  .utility-bar--mini {
    display: none !important;
  }

  .site-header {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .site-header__inner {
    gap: 0.4rem !important;
    min-width: 0;
    width: 100%;
  }

  .site-header .brand-logo,
  .site-header a.logo.brand-logo {
    min-width: 0;
    max-width: min(52%, 12rem);
    flex-shrink: 1;
  }

  .site-header .brand-logo__img {
    height: 1.75rem;
    width: auto;
  }

  .site-header .brand-logo__holidays {
    font-size: 0.8rem;
    letter-spacing: 0.04em;
  }

  .header-actions {
    gap: 0.25rem !important;
    flex-shrink: 0;
    margin-left: auto;
  }

  .btn-header-saves,
  .btn-header-cart {
    font-size: 1.2rem !important;
    padding: 0.4rem 0.45rem !important;
  }

  .header-actions .btn-signin {
    display: none !important;
  }

  .menu-toggle {
    padding: 0.35rem !important;
  }

  .mobile-drawer__panel .drawer-link,
  .mobile-drawer__panel a,
  .mobile-drawer__panel button.drawer-link {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.9rem 0;
    border: none;
    border-bottom: 1px solid var(--border, #d1d9e6);
    background: none;
    color: var(--text, #1a2b49);
    font: inherit;
    font-weight: 500;
    font-size: 1rem;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    border-radius: 0;
    min-height: 0;
  }

  .mobile-drawer__panel .drawer-sep {
    margin: 0.5rem 0 0.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border, #d1d9e6);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted, #5c6c84);
  }

  .hero {
    min-height: auto;
    padding: 1.25rem 0.85rem 1.5rem;
  }

  .hero__title {
    font-size: 1.45rem;
    margin-bottom: 0.85rem;
  }

  .search-card {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }

  /* Home tour rows: horizontal carousel with peek + next arrow */
  .home-carousel-wrap,
  .home-carousel-wrap--four {
    overflow: visible;
    margin-right: -1rem;
    padding-right: 0;
  }

  .home-carousel,
  .home-carousel--four {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch;
    gap: 0.85rem;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory;
    padding: 0.15rem 1rem 0.65rem 0;
    -webkit-overflow-scrolling: touch;
  }

  .home-carousel > .home-card-wrap,
  .home-carousel--four > .home-card-wrap {
    flex: 0 0 min(78vw, 260px) !important;
    width: min(78vw, 260px) !important;
    max-width: min(78vw, 260px) !important;
    min-width: min(78vw, 260px) !important;
    scroll-snap-align: start;
  }

  .home-carousel__next {
    display: flex !important;
    right: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
  }

  .home-section {
    overflow: visible;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .home-banner-host {
    width: calc(100% - 1.5rem);
    margin-left: auto;
    margin-right: auto;
  }

  .whatsapp-float {
    right: max(0.75rem, env(safe-area-inset-right));
    bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
    width: 3.15rem;
    height: 3.15rem;
  }

  body:has(.mobile-book-bar:not([hidden])) .whatsapp-float,
  body:has(.pkg-mobile-bar:not([hidden])) .whatsapp-float,
  body:has(.mobile-ride-bar:not([hidden])) .whatsapp-float {
    bottom: calc(5.85rem + env(safe-area-inset-bottom, 0px));
    z-index: 44;
  }

  body:has(.mobile-book-sheet.is-open) .whatsapp-float,
  body:has(.mobile-ride-sheet.is-open) .whatsapp-float {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  main,
  .page,
  .results-wrap {
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  }

  .utility a[href*="supplier-signup"],
  .utility .utility__sep:has(+ a[href*="supplier-signup"]) {
    display: none !important;
  }

  button,
  .btn-book,
  .btn-reserve,
  .btn-add-cart,
  .picker-btn,
  .picker-select,
  .category-chip,
  .slot-btn {
    min-height: 2.5rem;
  }

  .picker-select select,
  select,
  input[type="date"],
  input[type="time"],
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="search"] {
    font-size: 16px; /* prevents iOS zoom-on-focus */
  }

  /* Tour detail: keep accordion / copy inside the screen */
  .page,
  .layout,
  .content-col,
  .tab-panel,
  .accordion,
  .acc-item,
  .acc-item__body,
  .acc-list,
  .acc-html,
  .about-text,
  .additional-info-body {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .acc-list {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .acc-list li,
  .acc-item__body,
  .acc-html,
  .acc-html p,
  .acc-html li,
  .about-text {
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    white-space: normal !important;
  }
}

@media (max-width: 430px) {
  .whatsapp-float {
    bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
  }

  .site-header .brand-logo__holidays {
    font-size: 0.72rem;
  }
}
