/*
 * Avelen mobile navigation rail
 * Progressive enhancement for the five-route public mobile dock.
 */
@media (max-width: 900px) {
  body.avelen-mobile-rail-active {
    padding-bottom: calc(156px + env(safe-area-inset-bottom)) !important;
    scroll-padding-bottom: calc(156px + env(safe-area-inset-bottom));
  }
  html {
    scroll-padding-bottom: calc(156px + env(safe-area-inset-bottom));
  }

  .mobile-dock.avelen-mobile-rail {
    --avelen-rail-x: 0px;
    --avelen-rail-tilt: 0deg;
    position: fixed;
    z-index: 130;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    display: grid;
    grid-template-columns: .92fr .98fr 1.25fr .98fr .92fr;
    min-height: 76px;
    padding: 5px 5px 6px;
    overflow: visible;
    isolation: isolate;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 25px;
    background:
      linear-gradient(135deg, rgba(63,47,43,.98), rgba(24,19,18,.96) 58%, rgba(39,30,28,.98)),
      rgba(23,20,19,.94);
    box-shadow:
      0 22px 54px rgba(0,0,0,.42),
      inset 0 1px 0 rgba(255,255,255,.13),
      inset 0 -1px 0 rgba(0,0,0,.3);
    backdrop-filter: blur(23px) saturate(1.14);
    transform: translate3d(var(--avelen-rail-x), 0, 0) rotate(var(--avelen-rail-tilt));
    transform-origin: 50% 100%;
    transition: transform 520ms cubic-bezier(.16,1,.3,1), box-shadow 300ms ease;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
  }

  .mobile-dock.avelen-mobile-rail::before {
    position: absolute;
    z-index: -1;
    top: 0;
    right: 11%;
    left: 11%;
    height: 1px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(255,239,228,.63), transparent);
    content: "";
    opacity: .74;
    pointer-events: none;
  }

  .mobile-dock.avelen-mobile-rail::after {
    position: absolute;
    z-index: -1;
    inset: 1px;
    border-radius: inherit;
    background:
      radial-gradient(circle at 50% -45%, rgba(245,190,207,.16), transparent 45%),
      linear-gradient(90deg, rgba(255,255,255,.025), transparent 28%, rgba(236,181,158,.05));
    content: "";
    pointer-events: none;
  }

  .mobile-dock.avelen-mobile-rail > :is(a,button) {
    --avelen-rail-item-x: 0px;
    --avelen-rail-item-y: 0px;
    --avelen-rail-item-tilt: 0deg;
    position: relative;
    z-index: 1;
    display: grid;
    min-width: 0;
    min-height: 64px;
    place-items: center;
    align-content: center;
    gap: 5px;
    border: 0;
    border-radius: 18px;
    padding: 8px 2px 7px;
    color: rgba(255,255,255,.61);
    background: transparent;
    font: inherit;
    font-size: 8.5px;
    font-weight: 750;
    letter-spacing: .015em;
    line-height: 1.02;
    text-align: center;
    text-decoration: none;
    text-transform: none;
    transform: translate3d(var(--avelen-rail-item-x), var(--avelen-rail-item-y), 0) rotate(var(--avelen-rail-item-tilt));
    transform-origin: 50% 88%;
    transition:
      transform 460ms cubic-bezier(.16,1,.3,1),
      color 220ms ease,
      background 220ms ease,
      box-shadow 220ms ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .mobile-dock.avelen-mobile-rail > :is(a,button)::before {
    position: absolute;
    z-index: -1;
    inset: 5px 3px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.015));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
    content: "";
    opacity: 0;
    transform: scale(.86);
    transition: opacity 220ms ease, transform 280ms cubic-bezier(.2,.9,.25,1), border-color 220ms ease;
    pointer-events: none;
  }

  .mobile-dock.avelen-mobile-rail > :is(a,button) > :is(svg,span) {
    position: relative;
    z-index: 1;
  }

  .mobile-dock.avelen-mobile-rail > :is(a,button) svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.8;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.18));
  }

  .mobile-dock.avelen-mobile-rail > :is(a,button) > span {
    display: block;
    max-width: 8.3ch;
    overflow-wrap: anywhere;
    text-wrap: balance;
  }

  .mobile-dock.avelen-mobile-rail > :is(a,button).avelen-rail-active:not(.dock-book)::before,
  .mobile-dock.avelen-mobile-rail > :is(a,button):hover:not(.dock-book)::before {
    border-color: rgba(255,255,255,.11);
    opacity: 1;
    transform: scale(1);
  }

  .mobile-dock.avelen-mobile-rail > :is(a,button).avelen-rail-active:not(.dock-book) {
    color: #fffaf6;
    text-shadow: 0 1px 12px rgba(255,255,255,.16);
  }

  .mobile-dock.avelen-mobile-rail .dock-book,
  .mobile-dock.avelen-mobile-rail .dock-book.active {
    z-index: 2;
    min-height: 72px !important;
    margin: -12px 2px 0 !important;
    border: 1px solid rgba(255,248,242,.72) !important;
    border-radius: 20px !important;
    padding: 8px 4px 7px !important;
    color: #241b19 !important;
    background:
      radial-gradient(circle at 50% 0%, rgba(255,255,255,.72), transparent 44%),
      linear-gradient(142deg, #fff7f0 0%, #f3c9d6 47%, #e9ad78 100%) !important;
    box-shadow:
      0 12px 24px rgba(0,0,0,.34),
      0 4px 13px rgba(231,167,190,.24),
      inset 0 1px 0 rgba(255,255,255,.82) !important;
  }

  .mobile-dock.avelen-mobile-rail .dock-book::before {
    inset: 4px;
    border-color: rgba(85,46,47,.12);
    background: transparent;
    opacity: 1;
    transform: scale(1);
  }

  .mobile-dock.avelen-mobile-rail .dock-book svg {
    width: 22px;
    height: 22px;
    stroke: #241b19 !important;
  }

  .mobile-dock.avelen-mobile-rail .dock-book > span {
    max-width: 12ch;
    color: #241b19;
    font-size: 8.4px;
    font-weight: 800;
    letter-spacing: .005em;
    line-height: 1.05;
    white-space: normal;
    overflow: visible;
    text-wrap: balance;
  }

  .mobile-dock.avelen-mobile-rail .dock-start,
  .mobile-dock.avelen-mobile-rail .dock-start.active,
  .mobile-dock.avelen-mobile-rail .dock-client-entry {
    z-index: 1;
    min-height: 64px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 18px !important;
    padding: 8px 2px 7px !important;
    color: rgba(255,255,255,.61) !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .mobile-dock.avelen-mobile-rail .dock-start svg,
  .mobile-dock.avelen-mobile-rail .dock-client-entry svg {
    width: 20px;
    height: 20px;
    stroke: currentColor !important;
  }

  .mobile-dock.avelen-mobile-rail .dock-start > span,
  .mobile-dock.avelen-mobile-rail .dock-client-entry > span {
    max-width: 8.3ch;
    color: inherit;
    font-size: 8.5px;
    font-weight: 750;
  }

  .mobile-dock.avelen-mobile-rail .dock-account {
    color: #f5d1b2;
  }

  .mobile-dock.avelen-mobile-rail .dock-account.is-login {
    color: #fff4ea;
  }

  .mobile-dock.avelen-mobile-rail .dock-account.is-login > span {
    font-weight: 800;
    letter-spacing: .02em;
  }

  .mobile-dock[data-client-navigation="true"] {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }

  .mobile-dock[data-client-navigation="true"] .dock-account {
    display: grid !important;
  }

  .mobile-dock.avelen-mobile-rail .dock-account.has-client::after {
    top: 11px;
    right: calc(50% - 16px);
  }

  .mobile-dock.avelen-mobile-rail.avelen-rail-is-dragging,
  .mobile-dock.avelen-mobile-rail.avelen-rail-is-dragging > :is(a,button) {
    transition-duration: 0ms;
  }

  .mobile-dock.avelen-mobile-rail:focus-within {
    box-shadow:
      0 22px 54px rgba(0,0,0,.42),
      0 0 0 1px rgba(245,196,168,.28),
      inset 0 1px 0 rgba(255,255,255,.13);
  }

  .mobile-dock.avelen-mobile-rail > :is(a,button):focus-visible {
    outline: 2px solid #fff4e9;
    outline-offset: -2px;
  }

  body.avelen-mobile-rail-active .support-fab {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .mobile-menu.open .avelen-rail-languages {
    position: relative;
    z-index: 6;
    pointer-events: auto;
  }

  .mobile-menu.open .avelen-rail-languages button {
    position: relative;
    z-index: 7;
    pointer-events: auto;
  }

  body.avelen-overlay-open .site-header .language-switcher,
  body.menu-open .site-header .language-switcher {
    pointer-events: none;
  }

  body.avelen-field-focus .mobile-dock,
  body.avelen-field-focus .sticky-pay,
  body.avelen-field-focus .support-fab,
  body.avelen-field-focus .avelen-sticky-cta {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .mobile-menu.avelen-mobile-sheet,
  .mobile-start-sheet.avelen-mobile-sheet {
    --avelen-sheet-x: 0px;
    --avelen-sheet-y: 0px;
    --avelen-sheet-tilt: 0deg;
    padding-bottom: calc(118px + env(safe-area-inset-bottom)) !important;
  }

  .mobile-menu.avelen-mobile-sheet > nav,
  .mobile-start-sheet.avelen-mobile-sheet > .start-panel {
    transform: translate3d(var(--avelen-sheet-x), var(--avelen-sheet-y), 0) rotate(var(--avelen-sheet-tilt)) !important;
    transform-origin: 50% 100%;
    transition: transform 480ms cubic-bezier(.16,1,.3,1) !important;
    touch-action: pan-y;
  }

  .mobile-menu.avelen-mobile-sheet:not(.open) > nav,
  .mobile-start-sheet.avelen-mobile-sheet:not(.open) > .start-panel {
    transform: translate3d(var(--avelen-sheet-x), calc(22px + var(--avelen-sheet-y)), 0) rotate(var(--avelen-sheet-tilt)) !important;
  }

  .mobile-menu.avelen-mobile-sheet.avelen-sheet-is-dragging > nav,
  .mobile-start-sheet.avelen-mobile-sheet.avelen-sheet-is-dragging > .start-panel {
    transition-duration: 0ms !important;
  }

  .mobile-menu.avelen-mobile-sheet nav {
    max-height: calc(100dvh - 160px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  .mobile-menu.avelen-mobile-sheet .sheet-head {
    position: sticky;
    z-index: 3;
    top: 0;
    background: rgba(35, 29, 27, .98);
  }

  .mobile-menu.avelen-mobile-sheet nav::-webkit-scrollbar {
    display: none;
  }

  .mobile-menu.avelen-mobile-sheet .sheet-link,
  .mobile-start-sheet.avelen-mobile-sheet .journey-option {
    --avelen-sheet-item-x: 0px;
    --avelen-sheet-item-tilt: 0deg;
    transform: translate3d(var(--avelen-sheet-item-x), 0, 0) rotate(var(--avelen-sheet-item-tilt));
    transform-origin: 50% 50%;
    transition: transform 260ms cubic-bezier(.2,.9,.25,1), border-color 220ms ease, background 220ms ease, box-shadow 220ms ease;
  }

  .mobile-menu.avelen-mobile-sheet .sheet-link:active,
  .mobile-start-sheet.avelen-mobile-sheet .journey-option:active {
    transform: scale(.985);
  }

  .avelen-rail-languages {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    padding: 10px 0 8px;
    margin-top: 6px;
    border-top: 1px solid rgba(255,255,255,.1);
  }

  .avelen-rail-languages button {
    min-height: 34px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 11px;
    color: rgba(255,255,255,.66);
    background: rgba(255,255,255,.045);
    font: inherit;
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .1em;
    transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
  }

  .avelen-rail-languages button[aria-pressed="true"] {
    border-color: rgba(245,204,174,.56);
    color: #261c19;
    background: linear-gradient(135deg, #fff2e9, #efbed0 55%, #e8b17d);
    box-shadow: 0 7px 14px rgba(0,0,0,.16);
  }

  .avelen-rail-languages button:focus-visible {
    outline: 2px solid #f5c4a8;
    outline-offset: 2px;
  }
}

@media (hover: hover) and (pointer: fine) and (max-width: 900px) {
  .mobile-dock.avelen-mobile-rail > :is(a,button):hover:not(.dock-book) {
    color: #fff;
  }

  .mobile-dock.avelen-mobile-rail .dock-book:hover {
    box-shadow:
      0 20px 37px rgba(0,0,0,.37),
      0 7px 18px rgba(231,167,190,.3),
      inset 0 1px 0 rgba(255,255,255,.82) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-dock.avelen-mobile-rail,
  .mobile-dock.avelen-mobile-rail > :is(a,button),
  .mobile-menu.avelen-mobile-sheet > nav,
  .mobile-start-sheet.avelen-mobile-sheet > .start-panel,
  .mobile-menu.avelen-mobile-sheet .sheet-link,
  .mobile-start-sheet.avelen-mobile-sheet .journey-option,
  .avelen-rail-languages button {
    transition: none !important;
    animation: none !important;
  }
}

/* Dual sticky CTA: Book + WhatsApp sit ABOVE the dock, never in the center-pill gap */
@media (max-width: 900px) {
  .avelen-sticky-cta {
    --avelen-fab-bottom: calc(156px + env(safe-area-inset-bottom, 0px) + var(--avelen-vv-inset, 0px));
    position: fixed;
    z-index: 128;
    right: 12px;
    bottom: var(--avelen-fab-bottom);
    left: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    pointer-events: none;
  }

  body.avelen-mobile-rail-active .avelen-sticky-cta {
    --avelen-fab-bottom: calc(156px + env(safe-area-inset-bottom, 0px) + var(--avelen-vv-inset, 0px));
  }

  .avelen-sticky-cta a {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 12px;
    border-radius: 14px;
    overflow: visible;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    text-transform: uppercase;
    box-shadow: 0 12px 28px rgba(0,0,0,.28);
  }

  .avelen-sticky-cta .avelen-sticky-book {
    color: #241b19;
    background: linear-gradient(140deg, #fff4ed, #efc1d0 49%, #e8ae76);
  }

  .avelen-sticky-cta .avelen-sticky-wa {
    color: #eafff1;
    border: 1px solid rgba(139, 230, 167, .35);
    background: linear-gradient(145deg, #1d3a28, #14251a);
  }

  .avelen-sticky-cta svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
  }

  body.avelen-sticky-cta-active {
    padding-bottom: calc(220px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body.avelen-sticky-cta-active .support-fab {
    bottom: calc(212px + env(safe-area-inset-bottom, 0px) + var(--avelen-vv-inset, 0px)) !important;
  }

  body.avelen-sticky-cta-active.avelen-mobile-rail-active .support-fab {
    bottom: calc(212px + env(safe-area-inset-bottom, 0px) + var(--avelen-vv-inset, 0px)) !important;
  }

  /* Booking already has sticky Pay + dock Book — sitewide pills hijack Day/Pay */
  body[data-page="book"] .avelen-sticky-cta,
  body.booking-page .avelen-sticky-cta {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

@media (min-width: 901px) {
  .avelen-sticky-cta { display: none !important; }
}

/* Explore / consult sheets: hide FABs, keep dock tappable under padded sheet */
@media (max-width: 900px) {
  body.menu-open .avelen-sticky-cta,
  body.avelen-overlay-open .avelen-sticky-cta,
  body:has(.mobile-menu.open) .avelen-sticky-cta,
  body:has(.mobile-start-sheet.open) .avelen-sticky-cta,
  .mobile-menu.open ~ .avelen-sticky-cta,
  .mobile-start-sheet.open ~ .avelen-sticky-cta,
  body.menu-open .sticky-pay,
  body.avelen-overlay-open .sticky-pay,
  body.menu-open .support-fab,
  body.avelen-overlay-open .support-fab,
  body:has(.mobile-menu.open) .support-fab,
  body:has(.mobile-start-sheet.open) .support-fab {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  body.menu-open .mobile-dock,
  body.avelen-overlay-open .mobile-dock {
    z-index: 110 !important;
  }

  .mobile-menu:not(.open),
  .mobile-start-sheet:not(.open),
  .support-backdrop:not(.open),
  .support-panel:not(.open) {
    visibility: hidden !important;
    pointer-events: none !important;
    background: transparent !important;
  }
  .mobile-menu:not(.open) *,
  .mobile-start-sheet:not(.open) *,
  .support-backdrop:not(.open) *,
  .support-panel:not(.open) * {
    pointer-events: none !important;
  }

  .mobile-menu.open,
  .mobile-start-sheet.open {
    z-index: 240 !important;
    padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px)) !important;
    background: rgba(12, 10, 9, .82) !important;
    pointer-events: auto !important;
  }

  .mobile-menu.open.avelen-mobile-sheet nav,
  body.avelen-overlay-open .mobile-menu.open.avelen-mobile-sheet nav {
    max-height: calc(100dvh - 132px);
    padding-bottom: 8px;
  }

  .mobile-menu .sheet-close,
  .mobile-start-sheet .start-close {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px;
    min-height: 44px;
  }
}

/* CLASS: closed overlay parent {pointer-events:none} does NOT stop children
   (default auto) from winning elementFromPoint. Hide the whole layer. */
.mobile-menu:not(.open),
.mobile-start-sheet:not(.open),
.support-backdrop:not(.open),
.support-panel:not(.open),
#avelen-friend-promo:not(.open),
#avelen-friend-promo-backdrop:not(.open),
#avelen-email-soft:not(.open),
#avelen-email-soft-backdrop:not(.open) {
  visibility: hidden !important;
  pointer-events: none !important;
}
.mobile-menu:not(.open) *,
.mobile-start-sheet:not(.open) *,
.support-backdrop:not(.open) *,
.support-panel:not(.open) *,
#avelen-friend-promo:not(.open) *,
#avelen-email-soft:not(.open) * {
  pointer-events: none !important;
}
