/*
 * Client header + mobile single-tour index.
 * Visual palette inherits the active Elementor Site Kit for each company.
 * No hardcoded company colors, no widget or template mutation.
 */
:root {
  --mad4b-client-ink: var(--e-global-color-primary, currentColor);
  --mad4b-client-surface: var(--e-global-color-bnav001, transparent);
  --mad4b-client-hover: var(--e-global-color-secondary, currentColor);
  --mad4b-client-accent: var(--e-global-color-accent, currentColor);
  --mad4b-client-muted: var(--e-global-color-text, currentColor);
}

/* Existing nationality/country header controls: never alter input/select meaning. */
.header-context-controls .header-context-toggle,
.header-context-toggle[data-header-context-toggle] {
  color: var(--mad4b-client-ink);
  border-color: color-mix(in srgb, var(--mad4b-client-hover) 50%, transparent);
  background: transparent;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}
.header-context-controls .header-context-toggle:hover,
.header-context-controls .header-context-toggle:focus-visible,
.header-context-toggle[data-header-context-toggle]:hover,
.header-context-toggle[data-header-context-toggle]:focus-visible {
  color: var(--mad4b-client-hover);
  border-color: var(--mad4b-client-accent);
  background: color-mix(in srgb, var(--mad4b-client-accent) 9%, transparent);
}
.header-context-toggle:focus-visible {
  outline: 2px solid var(--mad4b-client-accent);
  outline-offset: 3px;
}

/* Actual header navigation is Elementor Mega Menu (ID 6072b3f),
 * not Astra. The menu, dropdown, and mobile button remain native. */
.elementor-location-header .elementor-element-6072b3f {
  --n-menu-title-color-normal: var(--e-global-color-text);
  --n-menu-title-color-hover: var(--e-global-color-accent);
  --n-menu-title-color-active: var(--e-global-color-secondary);
  --n-menu-toggle-icon-color: var(--e-global-color-primary);
}
.elementor-location-header .elementor-element-6072b3f
  .e-n-menu-title > .e-n-menu-title-container {
  position: relative;
  color: var(--e-global-color-text);
  font-family: var(--e-global-typography-text-font-family, inherit);
  font-size: var(--e-global-typography-text-font-size, inherit);
  font-weight: var(--e-global-typography-text-font-weight, inherit);
  transition: color 160ms ease;
}
@media (min-width: 1025px) and (hover: hover) {
  .elementor-location-header .elementor-element-6072b3f
    .e-n-menu-title > .e-n-menu-title-container::after {
    content: "";
    position: absolute;
    inset-inline: 9px;
    inset-block-end: 5px;
    block-size: 2px;
    border-radius: 2px;
    background: var(--e-global-color-accent);
    pointer-events: none;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 180ms ease;
  }
  .elementor-location-header .elementor-element-6072b3f
    .e-n-menu-title:hover > .e-n-menu-title-container,
  .elementor-location-header .elementor-element-6072b3f
    .e-n-menu-title > .e-n-menu-title-container:focus-visible {
    color: var(--e-global-color-accent);
  }
  .elementor-location-header .elementor-element-6072b3f
    .e-n-menu-title:hover > .e-n-menu-title-container::after,
  .elementor-location-header .elementor-element-6072b3f
    .e-n-menu-title > .e-n-menu-title-container:focus-visible::after,
  .elementor-location-header .elementor-element-6072b3f
    .e-n-menu-title > .e-n-menu-title-container[aria-current="page"]::after {
    transform: scaleX(1);
  }
}
.elementor-location-header .elementor-element-6072b3f
  .e-n-menu-title > .e-n-menu-title-container:focus-visible {
  outline: 2px solid var(--e-global-color-accent);
  outline-offset: 3px;
}

/* Rebuilt TOC is never visible on desktop after resize from mobile. */
.mad4b-tour-toc { display: none; }

/* The original full Elementor TOC stays intact and accessible on desktop. */
@media (max-width: 767px) {
  body.single-tours-and-activities .elementor-24784 .elementor-element-b29a19b {
    /* Physical gap below the previous mobile content block; scoped to TOC only. */
    margin-block-start: 12px;
    width: 100%;
    max-width: none;
    min-width: 0;
    --box-background-color: var(--mad4b-client-surface);
    --box-border-radius: 14px;
    --item-text-color: var(--mad4b-client-ink);
    --item-text-active-color: var(--mad4b-client-hover);
    --item-text-hover-color: var(--mad4b-client-hover);
    --marker-color: var(--mad4b-client-accent);
  }
  /* Progressive fallback if Elementor generated TOC links are not ready. */
  body.single-tours-and-activities .elementor-24784 .elementor-element-b29a19b .elementor-toc__body {
    max-height: min(58dvh, 440px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
  }
  body.single-tours-and-activities .elementor-24784 .elementor-element-b29a19b.mad4b-toc-ready > .elementor-widget-container > .elementor-toc__header,
  body.single-tours-and-activities .elementor-24784 .elementor-element-b29a19b.mad4b-toc-ready > .elementor-widget-container > .elementor-toc__body {
    display: none !important;
  }

  body.single-tours-and-activities .mad4b-tour-toc {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: none;
    margin: 0;
    font-family: var(--e-global-typography-text-font-family, inherit);
    font-size: var(--e-global-typography-text-font-size, inherit);
    font-weight: var(--e-global-typography-text-font-weight, inherit);
    color: var(--mad4b-client-ink);
  }
  body.single-tours-and-activities .mad4b-tour-toc__drawer {
    overflow: clip;
    background: var(--mad4b-client-surface);
    border: 1px solid color-mix(in srgb, var(--mad4b-client-hover) 15%, transparent);
    border-radius: 14px;
    box-shadow: 0 5px 18px rgba(0, 0, 0, .045);
  }
  body.single-tours-and-activities .mad4b-tour-toc__drawer > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    padding: 12px 15px;
    list-style: none;
    cursor: pointer;
    color: var(--mad4b-client-ink);
    font-size: 1em;
    font-weight: var(--e-global-typography-accent-font-weight, 700);
    line-height: 1.35;
  }
  body.single-tours-and-activities .mad4b-tour-toc__drawer > summary::-webkit-details-marker,
  body.single-tours-and-activities .mad4b-tour-toc__group > summary::-webkit-details-marker {
    display: none;
  }
  body.single-tours-and-activities .mad4b-tour-toc__heading {
    flex: 1;
    min-width: 0;
  }
  body.single-tours-and-activities .mad4b-tour-toc__count {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 999px;
    color: var(--mad4b-client-hover);
    background: color-mix(in srgb, var(--mad4b-client-hover) 10%, transparent);
  }
  body.single-tours-and-activities .mad4b-tour-toc__chevron {
    inline-size: 8px;
    block-size: 8px;
    flex: none;
    border-inline-end: 2px solid currentColor;
    border-block-end: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 160ms ease;
  }
  body.single-tours-and-activities .mad4b-tour-toc__drawer[open] > summary .mad4b-tour-toc__chevron {
    transform: rotate(225deg);
  }
  body.single-tours-and-activities .mad4b-tour-toc__panels {
    max-height: min(58dvh, 440px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding: 0 8px 8px;
    border-top: 1px solid color-mix(in srgb, var(--mad4b-client-hover) 12%, transparent);
  }
  body.single-tours-and-activities .mad4b-tour-toc__group {
    border-bottom: 1px solid color-mix(in srgb, var(--mad4b-client-hover) 10%, transparent);
  }
  body.single-tours-and-activities .mad4b-tour-toc__group:last-child {
    border-bottom: 0;
  }
  body.single-tours-and-activities .mad4b-tour-toc__group > summary {
    cursor: pointer;
    display: flex;
    gap: 8px;
    align-items: center;
    min-height: 43px;
    padding: 9px 9px;
    font-size: .93em;
    font-weight: var(--e-global-typography-accent-font-weight, 600);
    color: var(--mad4b-client-hover);
    list-style: none;
  }
  body.single-tours-and-activities .mad4b-tour-toc__group > summary::before {
    content: "+";
    inline-size: 18px;
    text-align: center;
    color: var(--mad4b-client-accent);
    font-size: 17px;
    font-weight: 500;
  }
  body.single-tours-and-activities .mad4b-tour-toc__group[open] > summary::before {
    content: "−";
  }
  body.single-tours-and-activities .mad4b-tour-toc__group ul {
    list-style: none;
    margin: 0;
    padding: 0 4px 9px 24px;
  }
  body.single-tours-and-activities .mad4b-tour-toc__group li {
    margin: 0;
    padding: 0;
  }
  body.single-tours-and-activities .mad4b-tour-toc__group a {
    display: block;
    padding: 9px 9px;
    color: var(--mad4b-client-ink);
    font-size: .91em;
    line-height: 1.45;
    text-decoration: none;
    overflow-wrap: anywhere;
    border-radius: 7px;
  }
  body.single-tours-and-activities .mad4b-tour-toc__group a:hover,
  body.single-tours-and-activities .mad4b-tour-toc__group a:focus-visible {
    background: color-mix(in srgb, var(--mad4b-client-accent) 12%, transparent);
    color: var(--mad4b-client-hover);
    outline: 2px solid var(--mad4b-client-accent);
    outline-offset: -2px;
  }
  body.single-tours-and-activities [id^="elementor-toc__heading-anchor"] {
    scroll-margin-top: 110px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .elementor-location-header .elementor-element-6072b3f .e-n-menu-title-container::after,
  .mad4b-tour-toc__chevron,
  .header-context-toggle {
    transition: none !important;
  }
}

/* Tour editorial headings inherit Elementor Global Typography;
   their color is the site's global secondary, not a hard-coded per-language value. */
body.single-tours-and-activities .elementor-widget-heading h2.elementor-heading-title {
  color: var(--e-global-color-secondary, var(--e-global-color-primary));
}
@media (max-width: 767px) {
  /* Elementor generated CSS adds ~58px margin above the About heading.
     Keep the 12px TOC top gap, then a compact 16px separation below TOC. */
  body.single-tours-and-activities .elementor-24784 .elementor-element-c16d4db > .elementor-widget-container {
    margin-block-start: 16px;
  }
}

/* Mobile tour cards: the JetEngine listing widget reserves only ~153px
 * while its real destination card is 309–349px. Keep the widget's full
 * responsive content height so the following Tour Countries heading never
 * occupies the image's space. Scoped to the original related-destinations
 * Elementor template, not booking Rates or Extras. */
@media (max-width: 767px) {
  body.single-tours-and-activities .elementor-48366 .elementor-element-47f5ac8 {
    min-height: min(calc(100vw - 11px), 349px) !important;
  }

  /* Native Jet Dropbar sharing stays clickable at the tour title. Its former
   * fixed 90px position painted over the sticky Tour Contents and images. */
  body.single-tours-and-activities .elementor-element-3c17f4e.jet-dropbar-position-bottom-right {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    z-index: 10 !important;
  }
}

/* The active mobile Mega Menu must paint an opaque canvas. Otherwise its
 * destination cards can visually overlap the tour headline behind the panel. */
@media (max-width: 767px) {
  body.single-tours-and-activities .elementor-location-header .elementor-element-6072b3f .e-n-menu-content.e-active {
    background-color: var(--e-global-color-primary, #102d40) !important;
  }
}

/* Native TOC wins above tour cards while expanded without outranking site navigation. */
@media (max-width:767px) {
 body.single-tours-and-activities .elementor-24784 .elementor-element-fd7e73a:has(.mad4b-tour-toc__drawer[open]) {
   position:relative;
   z-index:60!important;
 }
 body.single-tours-and-activities .elementor-24784 .elementor-element-f846cdc:has(.mad4b-tour-toc__drawer[open]) {
   position:relative;
   z-index:80!important;
 }
 body.single-tours-and-activities .elementor-24784 .elementor-element-b29a19b:has(.mad4b-tour-toc__drawer[open]) {
   position:relative;
   z-index:81!important;
 }
 body.single-tours-and-activities .elementor-24784 .elementor-element-b29a19b:has(.mad4b-tour-toc__drawer[open]) > .elementor-widget-container {
   overflow:visible!important;
 }
 body.single-tours-and-activities .mad4b-tour-toc__drawer[open] {
   position:relative;
   z-index:90!important;
 }
 /* On mobile only, the above-form price duplicates the tour hero price. */
 body.single-tours-and-activities .elementor-24784 .elementor-element-bf8a70e {
   display:none!important;
 }
 /* The original price strip had the 25px top corners; carry them onto Fluent Forms. */
 body.single-tours-and-activities .elementor-24784 .elementor-element-ebdaa9c .fluentform-widget-wrapper {
   border-radius:25px!important;
 }
}


/* Keep the sticky TOC trigger above the booking form even when closed.
   Its stacking parent isolates descendants, so the parent must participate. */
@media (max-width:767px) {
 body.single-tours-and-activities .elementor-24784 .elementor-element-fd7e73a:has(.mad4b-tour-toc__drawer) {position:relative;z-index:60!important;}
 body.single-tours-and-activities .elementor-24784 .elementor-element-f846cdc:has(.mad4b-tour-toc__drawer) {position:relative;z-index:80!important;}
 body.single-tours-and-activities .elementor-24784 .elementor-element-b29a19b:has(.mad4b-tour-toc__drawer) {position:relative;z-index:81!important;}
 body.single-tours-and-activities .mad4b-tour-toc__drawer {position:relative;z-index:90!important;}
}

