@layer components {
  /*
    JPS Brand Header V1.4A.
    Same premium direction, with better desktop dropdown stacking.
  */

  .header,
  .site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background:
      linear-gradient(180deg, rgba(255, 253, 248, 0.99), rgba(250, 248, 245, 0.965));
    border-bottom: 1px solid rgba(15, 61, 55, 0.09);
    box-shadow:
      0 14px 38px rgba(43, 38, 32, 0.062),
      inset 0 -1px 0 rgba(221, 189, 119, 0.14);
    color: var(--ink);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  .header::after,
  .site-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(201, 146, 42, 0.34),
      rgba(15, 61, 55, 0.18),
      transparent
    );
    pointer-events: none;
  }

  .header.scrolled,
  .header.is-scrolled,
  .site-header.scrolled,
  .site-header.is-scrolled {
    background: rgba(255, 253, 248, 0.992);
    box-shadow:
      0 20px 52px rgba(43, 38, 32, 0.09),
      inset 0 -1px 0 rgba(221, 189, 119, 0.16);
  }

  .header .container,
  .site-header .container {
    width: min(1540px, calc(100% - (var(--page-gutter) * 2)));
  }

  .header-inner {
    min-height: 88px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: clamp(1.4rem, 2.6vw, 2.9rem);
  }

  .nav-desktop {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: clamp(1rem, 1.65vw, 1.45rem);
    margin-right: clamp(3.25rem, 6vw, 6.5rem);
    transform: translateX(-0.5rem);
}

  .nav-desktop a,
  .dropdown-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.34rem;
    color: rgba(43, 38, 32, 0.78);
    font-size: 1rem;
    font-weight: 730;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--transition-fast), transform var(--transition-fast);
  }

  .nav-desktop a::after,
  .dropdown-toggle::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.66rem;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--gold-deep), var(--gold-light));
    opacity: 0;
    transform: scaleX(0.72);
    transition:
      opacity var(--transition-fast),
      transform var(--transition-fast);
  }

  .nav-desktop a:hover,
  .nav-dropdown:hover .dropdown-toggle {
    color: var(--teal-dark);
    transform: translateY(-1px);
  }

  .nav-desktop a:hover::after,
  .nav-dropdown:hover .dropdown-toggle::after {
    opacity: 1;
    transform: scaleX(1);
  }

  .nav-dropdown {
    position: relative;
    z-index: 1;
  }

  .nav-dropdown:hover,
  .nav-dropdown:focus-within {
    z-index: 30;
  }

  .dropdown-menu {
    position: absolute;
    top: calc(100% + 1.2rem);
    left: 50%;
    min-width: 246px;
    padding: 0.58rem;
    border: 1px solid rgba(15, 61, 55, 0.11);
    border-radius: 18px;
    background: rgba(255, 253, 248, 0.995);
    box-shadow: 0 26px 70px rgba(15, 61, 55, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 8px);
    transition:
      opacity var(--transition-fast),
      visibility var(--transition-fast),
      transform var(--transition-fast);
    z-index: 40;
  }

  .nav-dropdown:hover .dropdown-menu,
  .nav-dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
  }

  .dropdown-menu a {
    display: block;
    padding: 0.74rem 0.85rem;
    border-radius: 13px;
    color: rgba(43, 38, 32, 0.72);
    font-size: 0.93rem;
    font-weight: 650;
    text-decoration: none;
  }

  .dropdown-menu a::after {
    display: none;
  }

  .dropdown-menu a:hover {
    background: rgba(15, 61, 55, 0.065);
    color: var(--teal-dark);
    transform: none;
  }

  .nav-desktop .btn-primary,
  .header .btn-primary {
    --jps-header-cta-shift: clamp(0.75rem, 1.6vw, 1.45rem);
    min-height: 50px;
    padding: 0.9rem 1.45rem;
    border: 1px solid rgba(221, 189, 119, 0.42);
    border-radius: 999px;
    background:
      linear-gradient(135deg, rgba(15, 61, 55, 1), rgba(26, 92, 83, 0.98));
    color: var(--white-warm);
    font-size: 0.98rem;
    font-weight: 830;
    letter-spacing: -0.01em;
    transform: translateX(var(--jps-header-cta-shift));
    box-shadow:
      0 18px 38px rgba(15, 61, 55, 0.20),
      inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }

  .nav-desktop .btn-primary:hover,
  .header .btn-primary:hover {
    color: var(--white-warm);
    transform: translateX(var(--jps-header-cta-shift)) translateY(-1px);
    box-shadow:
      0 22px 46px rgba(15, 61, 55, 0.24),
      inset 0 1px 0 rgba(255, 255, 255, 0.14);
  }

  .nav-desktop .btn-primary::after,
  .header .btn-primary::after {
    display: none;
  }

  .menu-toggle {
    width: 46px;
    height: 46px;
    display: none;
    place-items: center;
    border: 1px solid rgba(15, 61, 55, 0.16);
    border-radius: 999px;
    background: rgba(255, 253, 248, 0.86);
    color: var(--teal-dark);
    box-shadow: 0 10px 26px rgba(43, 38, 32, 0.055);
  }

  .menu-toggle span {
    width: 19px;
    height: 2px;
    display: block;
    border-radius: 99px;
    background: currentColor;
  }

  .menu-toggle span + span {
    margin-top: 4px;
  }

  @media (max-width: 1380px) {
    .nav-desktop {
      gap: 0.86rem;
      margin-right: clamp(1.25rem, 2.4vw, 2.4rem);
      transform: translateX(-0.25rem);
}

    .nav-desktop a,
    .dropdown-toggle {
      font-size: 0.92rem;
    }

    .nav-desktop .btn-primary,
    .header .btn-primary {
      min-height: 46px;
      padding-inline: 1.18rem;
      font-size: 0.9rem;
    }
  }

  @media (max-width: 1120px) {
    .header-inner {
      min-height: 78px;
      grid-template-columns: auto auto;
      justify-content: space-between;
    }

    .nav-desktop {
      display: none;
    }

    .menu-toggle {
      display: grid;
    }
  }

  @media (max-width: 720px) {
    .header {
      position: sticky;
      top: 0;
    }

    .header-inner {
      min-height: 70px;
    }

    .header .container,
    .site-header .container {
      width: min(100% - 1rem, var(--container));
    }
  }

  .nav-mobile {
    position: fixed;
    top: 78px;
    left: 50%;
    z-index: 99;
    width: min(92vw, 430px);
    max-height: calc(100vh - 98px);
    padding: 0.9rem;
    border: 1px solid rgba(15, 61, 55, 0.12);
    border-radius: 24px;
    background: rgba(255, 253, 248, 0.99);
    box-shadow: 0 30px 86px rgba(15, 61, 55, 0.20);
    overflow: auto;
    transform: translateX(-50%) translateY(-10px);
  }

  .nav-mobile:not(.active) {
    display: none;
  }

  .nav-mobile a,
  .nav-mobile summary {
    display: block;
    padding: 0.9rem 0.95rem;
    border-radius: 15px;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 740;
    text-decoration: none;
  }

  .nav-mobile a:hover,
  .nav-mobile summary:hover {
    background: rgba(15, 61, 55, 0.07);
    color: var(--teal-dark);
  }

  .mobile-submenu {
    display: grid;
    gap: 0.22rem;
    padding: 0.25rem 0 0.6rem 0.68rem;
  }

  .mobile-submenu a {
    color: rgba(43, 38, 32, 0.72);
    font-size: 0.95rem;
    font-weight: 660;
  }
}

@layer components {
  /*
    JPS Mobile Header/Menu V1.
    Premium mobile drawer under sticky header.
  */

  @media (max-width: 1120px) {
    .header,
    .site-header {
      position: sticky;
      top: 0;
      z-index: 120;
    }

    .menu-toggle {
      position: relative;
      display: inline-flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 0;
      padding: 0;
    }

    .menu-toggle span {
      width: 20px;
      height: 2px;
      display: block;
      margin: 0;
      border-radius: 999px;
      background: currentColor;
      transition:
        transform var(--transition-fast),
        opacity var(--transition-fast);
    }

    .menu-toggle span + span {
      margin-top: 5px;
    }

    .menu-toggle[aria-expanded="true"] span:nth-child(1) {
      transform: translateY(7px) rotate(45deg);
    }

    .menu-toggle[aria-expanded="true"] span:nth-child(2) {
      opacity: 0;
    }

    .menu-toggle[aria-expanded="true"] span:nth-child(3) {
      transform: translateY(-7px) rotate(-45deg);
    }

    .nav-mobile {
      position: fixed;
      top: 86px;
      left: 50%;
      right: auto;
      z-index: 110;
      width: min(420px, calc(100vw - 1.5rem));
      max-height: calc(100vh - 108px);
      padding: 0.72rem;
      border: 1px solid rgba(15, 61, 55, 0.13);
      border-radius: 24px;
      background:
        linear-gradient(180deg, rgba(255, 253, 248, 0.995), rgba(250, 248, 245, 0.985));
      box-shadow:
        0 30px 90px rgba(15, 61, 55, 0.22),
        0 0 0 1px rgba(255, 255, 255, 0.72) inset;
      overflow: auto;
      transform: translateX(-50%) translateY(-8px);
    }

    .nav-mobile:not(.active) {
      display: none;
    }

    .nav-mobile.active {
      display: block;
    }

    .nav-mobile details {
      margin: 0;
      border-bottom: 1px solid rgba(15, 61, 55, 0.08);
    }

    .nav-mobile details:last-of-type {
      border-bottom: 0;
    }

    .nav-mobile summary {
      cursor: pointer;
      list-style: none;
    }

    .nav-mobile summary::-webkit-details-marker {
      display: none;
    }

    .nav-mobile a,
    .nav-mobile summary {
      display: flex;
      align-items: center;
      justify-content: space-between;
      min-height: 48px;
      padding: 0.78rem 0.88rem;
      border-radius: 15px;
      color: var(--ink);
      font-size: 1rem;
      font-weight: 760;
      line-height: 1.2;
      text-decoration: none;
      transition:
        background var(--transition-fast),
        color var(--transition-fast),
        transform var(--transition-fast);
    }

    .nav-mobile summary::after {
      content: "↓";
      color: rgba(15, 61, 55, 0.58);
      font-size: 0.82rem;
      transform: translateY(-1px);
    }

    .nav-mobile details[open] summary::after {
      content: "↑";
    }

    .nav-mobile a:hover,
    .nav-mobile summary:hover {
      background: rgba(15, 61, 55, 0.07);
      color: var(--teal-dark);
      transform: none;
    }

    .mobile-submenu {
      display: grid;
      gap: 0.18rem;
      padding: 0.1rem 0.3rem 0.65rem 0.72rem;
    }

    .mobile-submenu a {
      min-height: 40px;
      padding: 0.62rem 0.76rem;
      color: rgba(43, 38, 32, 0.72);
      font-size: 0.93rem;
      font-weight: 660;
      border-radius: 13px;
    }

    .nav-mobile > a[href*="tidycal"],
    .nav-mobile .btn-primary {
      justify-content: center;
      min-height: 48px;
      margin-top: 0.55rem;
      border: 1px solid rgba(221, 189, 119, 0.38);
      border-radius: 999px;
      background: linear-gradient(135deg, var(--teal-dark), var(--teal));
      color: var(--white-warm);
      font-weight: 830;
      box-shadow: 0 16px 34px rgba(15, 61, 55, 0.18);
    }
  }

  @media (max-width: 720px) {
    .nav-mobile {
      top: 76px;
      width: min(430px, calc(100vw - 1rem));
      max-height: calc(100vh - 92px);
      border-radius: 22px;
    }
  }
}

@layer components {
  /*
    Brand Shell dropdown refinement.
    Makes desktop dropdown visually separate from the sticky header.
  */

  @media (min-width: 981px) {
    .header {
      z-index: 20000;
    }

    .nav-dropdown {
      position: relative;
    }

    .nav-dropdown .dropdown-menu {
      position: absolute !important;
      top: calc(100% + 0.85rem) !important;
      left: 50% !important;
      min-width: 245px !important;
      padding: 0.72rem !important;
      border: 1px solid rgba(15, 61, 55, 0.14) !important;
      border-radius: 18px !important;
      background:
        linear-gradient(180deg, rgba(255, 253, 248, 0.985), rgba(250, 248, 245, 0.96)) !important;
      box-shadow:
        0 24px 70px rgba(15, 61, 55, 0.16),
        0 1px 0 rgba(255, 255, 255, 0.86) inset !important;
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
      transform: translateX(-50%) translateY(0.35rem) !important;
      z-index: 20030 !important;
    }

    .nav-dropdown .dropdown-menu::before {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      top: -0.9rem;
      height: 0.9rem;
    }

    .nav-dropdown:hover > .dropdown-menu,
    .nav-dropdown:focus-within > .dropdown-menu {
      transform: translateX(-50%) translateY(0) !important;
      opacity: 1 !important;
      visibility: visible !important;
      pointer-events: auto !important;
    }

    .dropdown-menu a {
      border-radius: 12px !important;
      padding: 0.72rem 0.9rem !important;
    }

    .dropdown-menu a:hover {
      background: rgba(232, 244, 241, 0.82) !important;
      color: var(--teal-dark) !important;
    }
  }
}

@layer components {
  /*
    Brand Shell dropdown final refinement.
    Solid, separated, premium. Avoids visual merge with header/hero.
  */

  @media (min-width: 981px) {
    .header {
      z-index: 50000;
      isolation: isolate;
    }

    .nav-desktop {
      position: relative;
      z-index: 50010;
    }

    .nav-dropdown {
      position: relative;
    }

    .nav-dropdown .dropdown-menu {
      top: calc(100% + 1.05rem) !important;
      left: 50% !important;
      min-width: 260px !important;
      padding: 0.82rem !important;
      border: 1px solid rgba(15, 61, 55, 0.16) !important;
      border-radius: 20px !important;
      background: #fffdf8 !important;
      box-shadow:
        0 32px 80px rgba(15, 61, 55, 0.22),
        0 10px 24px rgba(43, 38, 32, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.92) !important;
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
      transform: translateX(-50%) translateY(0.35rem) !important;
      z-index: 50030 !important;
    }

    .nav-dropdown .dropdown-menu::before {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      top: -1.1rem;
      height: 1.1rem;
    }

    .nav-dropdown .dropdown-menu::after {
      content: "";
      position: absolute;
      top: -7px;
      left: 50%;
      width: 14px;
      height: 14px;
      background: #fffdf8;
      border-left: 1px solid rgba(15, 61, 55, 0.16);
      border-top: 1px solid rgba(15, 61, 55, 0.16);
      transform: translateX(-50%) rotate(45deg);
    }

    .nav-dropdown:hover > .dropdown-menu,
    .nav-dropdown:focus-within > .dropdown-menu {
      opacity: 1 !important;
      visibility: visible !important;
      pointer-events: auto !important;
      transform: translateX(-50%) translateY(0) !important;
    }

    .dropdown-menu a {
      position: relative;
      z-index: 2;
      padding: 0.78rem 0.95rem !important;
      border-radius: 13px !important;
      color: rgba(43, 38, 32, 0.78) !important;
      font-weight: 780 !important;
    }

    .dropdown-menu a:hover {
      background: rgba(232, 244, 241, 0.88) !important;
      color: var(--teal-dark) !important;
    }
  }
}


/* === JPS FIXED HEADER + MOBILE CTA FINAL START === */
@layer components {
  :root {
    --jps-header-height-desktop: 88px;
    --jps-header-height-mobile: 78px;
  }

  body {
    padding-top: var(--jps-header-height-desktop);
  }

  #header.header,
  .site-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 1400 !important;
    transform: translateZ(0);
    background:
      linear-gradient(180deg, rgba(255, 253, 248, 0.985), rgba(250, 248, 245, 0.955)) !important;
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    backdrop-filter: blur(18px) saturate(170%);
    box-shadow:
      0 14px 34px rgba(15, 61, 55, 0.075),
      inset 0 -1px 0 rgba(221, 189, 119, 0.16) !important;
  }

  #header.header.is-scrolled,
  #header.header.scrolled,
  .site-header.is-scrolled,
  .site-header.scrolled {
    background: rgba(255, 253, 248, 0.992) !important;
    box-shadow:
      0 20px 52px rgba(15, 61, 55, 0.12),
      inset 0 -1px 0 rgba(221, 189, 119, 0.20) !important;
  }

  @media (max-width: 1120px) {
    body {
      padding-top: var(--jps-header-height-mobile);
    }

    body.no-scroll {
      overflow: hidden;
      touch-action: none;
    }

    .nav-overlay {
      position: fixed;
      inset: 0;
      z-index: 1390;
      background: rgba(15, 61, 55, 0.34);
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transition: opacity 180ms ease, visibility 180ms ease;
      backdrop-filter: blur(5px);
      -webkit-backdrop-filter: blur(5px);
    }

    .nav-overlay.active {
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
    }

    .nav-mobile {
      position: fixed !important;
      top: calc(var(--jps-header-height-mobile) + max(0.65rem, env(safe-area-inset-top, 0px))) !important;
      left: max(0.75rem, env(safe-area-inset-left, 0px)) !important;
      right: max(0.75rem, env(safe-area-inset-right, 0px)) !important;
      width: auto !important;
      max-width: none !important;
      max-height: calc(100dvh - var(--jps-header-height-mobile) - 1.5rem - env(safe-area-inset-bottom, 0px)) !important;
      overflow-y: auto !important;
      overscroll-behavior: contain;
      z-index: 1410 !important;
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transform: translateY(-8px) scale(0.985) !important;
      border-radius: 24px !important;
      box-shadow: 0 28px 90px rgba(15, 61, 55, 0.25) !important;
    }

    .nav-mobile.active {
      opacity: 1 !important;
      visibility: visible !important;
      pointer-events: auto !important;
      transform: translateY(0) scale(1) !important;
    }

    .mobile-sticky-booking {
      position: fixed;
      left: max(0.85rem, env(safe-area-inset-left, 0px));
      right: calc(5.35rem + env(safe-area-inset-right, 0px));
      bottom: max(0.72rem, env(safe-area-inset-bottom, 0px));
      z-index: 1320;
      min-height: 56px;
      display: grid;
      place-items: center;
      padding: 0.62rem 1rem;
      border-radius: 999px;
      border: 1px solid rgba(240, 207, 136, 0.44);
      background:
        radial-gradient(circle at 10% 0%, rgba(240, 207, 136, 0.18), transparent 34%),
        linear-gradient(135deg, #0f3d37, #07342f);
      color: #f8f3ea;
      font-size: 0.96rem;
      font-weight: 900;
      line-height: 1.05;
      text-align: center;
      text-decoration: none;
      box-shadow:
        0 18px 44px rgba(15, 61, 55, 0.25),
        inset 0 1px 0 rgba(255,255,255,0.14);
    }

    .mobile-sticky-booking::after {
      content: "Online · 50€";
      display: block;
      margin-top: 0.16rem;
      color: #f0cf88;
      font-size: 0.72rem;
      font-weight: 850;
      letter-spacing: 0.02em;
    }

    .nav-mobile.active ~ .mobile-sticky-booking {
      opacity: 0;
      pointer-events: none;
    }
  }

  @media (min-width: 1121px) {
    .mobile-sticky-booking {
      display: none !important;
    }
  }
}
/* === JPS FIXED HEADER + MOBILE CTA FINAL END === */


/* === JPS MOBILE CTA FULL WIDTH FINAL START === */
@layer components {
  @media (max-width: 1120px) {
    .mobile-sticky-booking {
      left: max(0.85rem, env(safe-area-inset-left, 0px)) !important;
      right: max(0.85rem, env(safe-area-inset-right, 0px)) !important;
      width: auto !important;
      max-width: 28rem;
      margin-inline: auto;
      bottom: max(0.72rem, env(safe-area-inset-bottom, 0px)) !important;
      min-height: 56px;
      border-radius: 999px;
    }
  }
}
/* === JPS MOBILE CTA FULL WIDTH FINAL END === */


/* === JPS MOBILE CTA SMART REVEAL START === */
@layer components {
  @media (max-width: 1120px) {
    .mobile-sticky-booking {
      opacity: 0 !important;
      pointer-events: none !important;
      transform: translateY(16px) !important;
      transition:
        opacity 180ms ease,
        transform 180ms ease,
        box-shadow 180ms ease !important;
    }

    body.jps-mobile-cta-visible:not(.no-scroll) .mobile-sticky-booking {
      opacity: 1 !important;
      pointer-events: auto !important;
      transform: translateY(0) !important;
    }

    body.no-scroll .mobile-sticky-booking,
    body.jps-mobile-menu-open .mobile-sticky-booking {
      opacity: 0 !important;
      pointer-events: none !important;
      transform: translateY(16px) !important;
    }

    [data-jps-chat-lifted="true"] {
      bottom: calc(max(0.72rem, env(safe-area-inset-bottom, 0px)) + 4.9rem) !important;
    }
  }
}
/* === JPS MOBILE CTA SMART REVEAL END === */

