/* ============================================================
   Mobile / responsive polish
   Loaded after the main stylesheets so it can override safely.
   Scoped under media queries where possible to avoid impacting desktop.
   ============================================================ */

/* --- Universal: avoid horizontal page scroll & fluid media -------------- */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

img,
video,
iframe,
picture,
embed,
object {
  max-width: 100%;
}

img,
picture > img {
  height: auto;
}

.video-background {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Common containers that frequently overflow on small screens */
.owl-carousel,
.swiper-container,
.owl-stage-outer {
  max-width: 100%;
}

/* --- Typography & form inputs ------------------------------------------ */
/* iOS zooms on inputs whose font-size is < 16px.  Force at least 16px on
   small screens to stop that. */
@media (max-width: 767.98px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="search"],
  input[type="password"],
  input[type="date"],
  input[type="url"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* --- Tables: horizontal scroll instead of breaking layout -------------- */
@media (max-width: 767.98px) {
  table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* --- Header / nav ------------------------------------------------------ */
@media (max-width: 1199.98px) {
  .header .head-logo img {
    max-width: 140px;
    height: auto;
  }
  .header .navbar-toggler {
    padding: 8px;
  }
  .header .info-div,
  .header .header-right-info {
    display: none !important;
  }
}

/* Mobile nav menu: ensure full-width tappable links */
@media (max-width: 991.98px) {
  .mob-nav-menu .mob-nav-link {
    display: block;
    padding: 14px 16px;
    line-height: 1.3;
  }
  .mob-nav-menu .sub-list a {
    display: block;
    padding: 12px 16px;
    line-height: 1.3;
  }
}

/* --- Home banner ------------------------------------------------------- */
@media (max-width: 767.98px) {
  .home-banner,
  .home-banner.bannerH {
    height: auto;
    min-height: 0;
    max-height: none;
    padding: 0 0 24px;
  }

  .home-banner .video-background,
  .home-banner #bgvid {
    /* Cap the background video height so it doesn't push content out */
    height: 100%;
    object-fit: cover;
  }

  /* The banner content was using huge top/bottom padding designed for desktop */
  .home-banner .banner-content {
    padding: 90px 16px 16px !important;
    position: relative;
    z-index: 2;
  }

  /* Keep the video/gradient layer behind the content */
  .home-banner .video-background,
  .home-banner #bgvid,
  .home-banner .home-banner-overlay {
    z-index: 0;
  }

  /* Big vertical margins around the title (100/120 px) push the form below the
     hero on mobile. Tighten them. */
  .home-banner .banner-title-div {
    margin: 0 0 18px !important;
  }

  .banner-title {
    font-size: 24px !important;
    line-height: 1.2;
    margin: 0 0 8px;
  }
  .banner-subtitle {
    font-size: 14px !important;
  }

  /* Original markup hides the search form below md; show it on mobile */
  .reacher-form.d-none.d-md-block {
    display: block !important;
  }
  .reacher-form {
    width: 100%;
    padding: 0;
    box-sizing: border-box;
  }
  .reacher-form .form-display {
    display: block;
    padding: 0;
    margin: 0;
    list-style: none;
  }
  .reacher-form .form-display > li.input-display {
    display: block;
    width: 100%;
    float: none;
    padding: 0;
    margin: 0 0 10px;
    list-style: none;
  }
  .reacher-form .form-group {
    margin-bottom: 0;
  }
  .reacher-form .r-form-title {
    color: #fff;
    display: block;
    font-size: 13px;
    margin: 0 0 4px;
    width: auto;
  }
  .reacher-form .reacher-input {
    width: 100%;
    height: 44px;
    padding: 8px 12px;
    border-radius: 4px;
    box-sizing: border-box;
  }
  .reacher-form .submit-rech,
  .reacher-form .default-btn {
    width: 100%;
    height: 48px;
    padding: 12px;
    box-sizing: border-box;
    margin-top: 4px;
  }

  /* The opened dropdown panels (.reach-dropdown) need to span the screen
     and not push the page sideways */
  .reacher-form .r-form-options,
  .reacher-form .reach-dropdown {
    position: static;
    width: 100%;
    max-width: 100%;
    left: 0;
    right: 0;
    box-sizing: border-box;
  }

  /* Year/month picker columns: stack on phone */
  .reacher-form .r-option-col,
  .reacher-form .reach-container .row > [class*="col-"] {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .reacher-form .month-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 0;
    list-style: none;
  }
  .reacher-form .month-list li {
    list-style: none;
  }
  .reacher-form .month-list .month-link {
    display: block;
    text-align: center;
    padding: 8px 4px;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 4px;
    font-size: 13px;
  }
}

/* --- Hide empty offers row (server-populated; static HTML is empty) --- */
.offers-sec:has(.offers-row:empty) {
  display: none;
}

/* --- Reveal sections that are author-hidden below xl ------------------ */
/* The home page wraps its offers + destinations + tendances grids in
   `d-none d-xl-block`, leaving the section title with no body on phones.
   Unhide them and let the existing col-md-* grid handle layout. */
@media (max-width: 1199.98px) {
  .desktop-offers,
  .desktop-destination,
  .desktop-tendances,
  .desktop-experiences {
    display: block !important;
  }
}

/* --- Section padding gets generous on desktop, tight on mobile --------- */
@media (max-width: 767.98px) {
  .sec-pad {
    padding-top: 32px;
    padding-bottom: 32px;
  }
  .container,
  .modified-container {
    padding-left: 15px;
    padding-right: 15px;
  }
}

/* --- Card grids: stack neatly --------------------------------------- */
@media (max-width: 575.98px) {
  .row > [class*="col-"] {
    margin-bottom: 16px;
  }
  .row > [class*="col-"]:last-child {
    margin-bottom: 0;
  }
}

/* --- Footer ------------------------------------------------------------ */
@media (max-width: 767.98px) {
  .footer-col {
    margin-bottom: 24px;
  }
  .footer-link-list {
    padding-left: 0;
    list-style: none;
  }
  .footer-link-list li {
    margin-bottom: 8px;
  }
  .foo-payment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding-left: 0;
  }
  .foo-payment-list li {
    list-style: none;
  }
  .footer-social {
    display: flex;
    gap: 12px;
    padding-left: 0;
    list-style: none;
  }
}

/* --- Floating "back to top" doesn't overlap mobile UI ------------------ */
@media (max-width: 767.98px) {
  .goto-top-btn {
    bottom: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    line-height: 40px;
  }
}

/* --- Product / list / result page common helpers ----------------------- */
@media (max-width: 767.98px) {
  /* Cabin / cruise card images shouldn't overflow their cell */
  .product-img img,
  .cruise-img img,
  .ship-img img,
  .list-img img,
  .result-img img,
  .destination-img img {
    width: 100%;
    height: auto;
    object-fit: cover;
  }

  /* Long titles wrap instead of producing a horizontal scrollbar */
  h1, h2, h3, h4, h5, h6,
  .sec-title,
  .product-title,
  .list-title,
  .result-title {
    word-break: break-word;
    overflow-wrap: anywhere;
  }
}

/* --- Devis (quote) form ------------------------------------------------ */
@media (max-width: 767.98px) {
  .devis-form .form-row,
  .devis-form .row {
    margin-left: 0;
    margin-right: 0;
  }
  .devis-form input,
  .devis-form select,
  .devis-form textarea {
    width: 100%;
  }
}

/* --- Language switcher (FR / EN / DE) ----------------------------------
 * Fixed top-right pill, always rendered above page chrome.  No emoji flags
 * — they fall back to "GB" letters on systems without regional indicator
 * glyphs, which looks broken.
 */
.cdp-lang-switcher {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 2147483600;
  font: 600 12px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.6px;
}

/* When mounted inside the navbar, sit inline with the menu (desktop) or
 * between the hamburger and the brand (mobile).  Avoids overlapping the
 * gold "CROISIÈRE DE PRESTIGE" wordmark. */
nav .cdp-lang-switcher--in-nav,
.cdp-lang-switcher--in-nav {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  z-index: 1100;
}
/* On mobile the navbar uses justify-content: space-between with hamburger
 * on the left + brand on the right; put the pill in the gap (left side,
 * just after the hamburger). */
@media (max-width: 1199.98px) {
  nav .cdp-lang-switcher--in-nav,
  .cdp-lang-switcher--in-nav {
    right: auto;
    left: 60px;
  }
}
@media (max-width: 575.98px) {
  nav .cdp-lang-switcher--in-nav,
  .cdp-lang-switcher--in-nav {
    left: 54px;
  }
}
.cdp-lang-switcher .cdp-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(27, 48, 72, 0.88);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 6px 10px 6px 12px;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  min-height: 28px;
}
.cdp-lang-switcher .cdp-lang-btn:hover,
.cdp-lang-switcher.open .cdp-lang-btn {
  background: #cea049;
  color: #1b3048;
}
.cdp-lang-switcher .cdp-lang-current {
  font-weight: 700;
}
.cdp-lang-switcher .cdp-lang-caret {
  display: block;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}
.cdp-lang-switcher.open .cdp-lang-caret {
  transform: rotate(180deg);
}
.cdp-lang-switcher .cdp-lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  min-width: 150px;
  font-size: 13px;
  letter-spacing: 0.2px;
}
.cdp-lang-switcher.open .cdp-lang-menu {
  display: block;
}
.cdp-lang-switcher .cdp-lang-menu li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  color: #1b3048;
  font-weight: 500;
}
.cdp-lang-switcher .cdp-lang-menu li:hover {
  background: #f4f6fa;
}
.cdp-lang-switcher .cdp-lang-menu li.active {
  background: #fff8eb;
  font-weight: 700;
}
.cdp-lang-switcher .cdp-lang-code {
  display: inline-block;
  min-width: 22px;
  padding: 2px 5px;
  border-radius: 3px;
  background: #1b3048;
  color: #fff;
  font-weight: 700;
  font-size: 10px;
  text-align: center;
  letter-spacing: 0.5px;
}
.cdp-lang-switcher .cdp-lang-menu li.active .cdp-lang-code {
  background: #cea049;
}

/* The pill is hidden during print so it doesn't appear on the invoice PDF */
@media print {
  .cdp-lang-switcher { display: none !important; }
}

/* Calendar / appointment-date policy styles ----------------------------- */
/* See assets/js/calendar-policy.js — disables dates within the lead window
   and the optional allow-list, and highlights the first available date. */
.cdp-cal-disabled,
li.cdp-cal-disabled > .month-link,
.cdp-cal-disabled .price-link,
.cdp-cal-disabled .price-block {
  pointer-events: none !important;
  cursor: not-allowed !important;
  opacity: 0.32 !important;
  text-decoration: line-through;
  background-color: #f1f1f1 !important;
  color: #999 !important;
  filter: grayscale(0.7);
}
.cdp-cal-disabled .date-inner,
.cdp-cal-disabled .date-top {
  opacity: 0.55;
  background-color: #f1f1f1 !important;
  color: #888 !important;
}

.cdp-cal-first-available {
  outline: 2px solid #cea049;
  outline-offset: 1px;
  border-radius: 4px;
  position: relative;
  font-weight: 700 !important;
}
.cdp-cal-first-available::after {
  content: "1ʳᵉ disponible";
  position: absolute;
  left: 50%;
  bottom: -18px;
  transform: translateX(-50%);
  font-size: 10px;
  color: #cea049;
  white-space: nowrap;
  font-weight: 700;
}
.month-list .cdp-cal-first-available {
  outline-offset: 2px;
}

/* --- Long shared utility classes that break layout on small screens ---- */
@media (max-width: 575.98px) {
  /* Big font-size utilities can clip; loosen them */
  .f-43 { font-size: 26px !important; }
  .f-26 { font-size: 20px !important; }
  .f-21 { font-size: 17px !important; }
  .f-19 { font-size: 15px !important; }
}
