/* =========================================================
   NEW YORK PARTY YACHT
   HEADER.CSS
   Desktop dropdown + mobile expandable charter menu
   ========================================================= */


/* =========================================================
   HEADER SHELL
   ========================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  border-bottom: 1px solid rgba(7, 26, 43, 0.08);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.nav-wrap {
  display: flex;
  align-items: center;
  min-height: 82px;
  gap: 24px;
}


/* =========================================================
   LOGO
   ========================================================= */

.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--navy);
}

.site-logo {
  display: flex;
  align-items: center;
  width: 190px;
  max-width: 190px;
  height: 74px;
  overflow: hidden;
}

.site-logo img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 74px;
  object-fit: contain;
  object-position: left center;
}


/* =========================================================
   PRIMARY NAVIGATION
   ========================================================= */

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 22px;
}

.main-nav > a,
.nav-dropdown-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;

  min-height: 44px;
  padding: 0;

  border: 0;

  color: #304050;
  background: transparent;

  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;

  white-space: nowrap;
  cursor: pointer;

  transition: color 0.2s ease;
}

.main-nav > a:hover,
.nav-dropdown-toggle:hover,
.nav-dropdown:hover .nav-dropdown-toggle {
  color: var(--blue);
}


/* =========================================================
   YACHT CHARTERS DROPDOWN - DESKTOP
   ========================================================= */

.nav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-dropdown-toggle {
  gap: 6px;
}

.dropdown-arrow {
  display: inline-block;
  margin-top: -2px;

  font-size: 0.82rem;
  line-height: 1;

  transition: transform 0.2s ease;
}

.nav-dropdown:hover .dropdown-arrow,
.nav-dropdown.is-open .dropdown-arrow {
  transform: rotate(180deg);
}


/* =========================================================
   DESKTOP DROPDOWN PANEL
   ========================================================= */

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  z-index: 1200;

  width: 320px;
  max-width: calc(100vw - 30px);

  padding: 10px;

  border: 1px solid rgba(7, 26, 43, 0.1);
  border-radius: 14px;

  background: #ffffff;

  box-shadow: 0 18px 45px rgba(7, 26, 43, 0.15);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transform: translate(-50%, -8px);

  transition:
    opacity 0.2s ease,
    visibility 0.2s ease,
    transform 0.2s ease;
}


/* Invisible hover bridge */

.nav-dropdown::after {
  position: absolute;
  top: 100%;
  left: 0;

  width: 100%;
  height: 18px;

  content: "";
}


/* Desktop dropdown open state */

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;

  transform: translate(-50%, 0);
}


/* =========================================================
   DESKTOP DROPDOWN LINKS
   ========================================================= */

.nav-dropdown-menu a {
  display: block;

  width: 100%;
  box-sizing: border-box;

  padding: 12px 14px;

  border-radius: 9px;

  color: #304050;

  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;

  white-space: normal;

  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    transform 0.2s ease;
}

.nav-dropdown-menu a:hover {
  color: var(--blue);
  background: var(--sky);

  transform: translateX(3px);
}


/* =========================================================
   HEADER ACTION BUTTONS
   ========================================================= */

.nav-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;

  gap: 10px;
}

.nav-actions .btn {
  white-space: nowrap;
}


/* =========================================================
   MOBILE MENU BUTTON
   ========================================================= */

.nav-toggle {
  display: none;

  width: 44px;
  height: 44px;

  margin-left: auto;
  padding: 8px;

  border: 0;
  border-radius: 8px;

  background: transparent;

  cursor: pointer;
}

.nav-toggle span {
  display: block;

  width: 27px;
  height: 2px;

  margin: 6px auto;

  background: var(--navy);

  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}


/* =========================================================
   HAMBURGER ANIMATION
   ========================================================= */

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

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

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


/* Prevent page scrolling while mobile menu is open */

body.menu-open {
  overflow: hidden;
}


/* =========================================================
   LARGE TABLET / SMALL DESKTOP
   ========================================================= */

@media (max-width: 1180px) {

  .nav-wrap {
    gap: 18px;
  }

  .site-logo {
    width: 160px;
    max-width: 160px;
    height: 68px;
  }

  .site-logo img {
    max-height: 68px;
  }

  .main-nav {
    gap: 16px;
  }

  .main-nav > a,
  .nav-dropdown-toggle {
    font-size: 0.82rem;
  }

  .nav-actions .btn {
    padding-left: 18px;
    padding-right: 18px;
  }

}


/* =========================================================
   MOBILE NAVIGATION
   ========================================================= */

@media (max-width: 960px) {

  /* ---------------------------------------------------------
     HEADER
     --------------------------------------------------------- */

  .nav-wrap {
    min-height: 82px;
  }

  .site-logo {
    width: 180px;
    max-width: calc(100% - 70px);
    height: 68px;
  }

  .site-logo img {
    max-height: 68px;
  }

  .nav-toggle {
    display: block;
    flex-shrink: 0;
  }

  .nav-actions {
    display: none;
  }


  /* ---------------------------------------------------------
     FULL MOBILE MENU
     --------------------------------------------------------- */

  .main-nav {
    position: fixed;

    top: 82px;
    right: 0;
    bottom: 0;
    left: 0;

    z-index: 1100;

    display: none;

    width: 100%;
    max-width: 100%;

    height: calc(100vh - 82px);
    height: calc(100dvh - 82px);

    box-sizing: border-box;

    padding: 20px 24px 40px;

    overflow-x: hidden;
    overflow-y: auto;

    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;

    align-items: stretch;
    justify-content: flex-start;
    flex-direction: column;

    gap: 0;

    background: #ffffff;
  }

  .main-nav.open {
    display: flex;
  }


  /* ---------------------------------------------------------
     STANDARD MOBILE LINKS
     --------------------------------------------------------- */

  .main-nav > a {
    display: flex;
    align-items: center;

    width: 100%;
    max-width: 100%;
    min-height: 58px;

    box-sizing: border-box;

    padding: 14px 2px;

    border-bottom: 1px solid var(--border);

    color: var(--navy);

    font-size: 1.03rem;
    font-weight: 700;
  }


  /* =========================================================
     MOBILE YACHT CHARTERS ACCORDION
     ========================================================= */

  .nav-dropdown {
    position: static;

    display: block;

    width: 100%;
    max-width: 100%;

    box-sizing: border-box;
  }

  .nav-dropdown::after {
    display: none;
  }


  /* Mobile accordion button */

  .nav-dropdown-toggle {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: space-between;

    width: 100%;
    max-width: 100%;
    min-height: 58px;

    box-sizing: border-box;

    padding: 14px 2px;

    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;

    background: transparent;

    color: var(--navy);

    font-family: inherit;
    font-size: 1.03rem;
    font-weight: 700;
    line-height: 1.2;

    text-align: left;
    white-space: normal;

    cursor: pointer;
  }

  .dropdown-arrow {
    flex-shrink: 0;

    margin-top: 0;
    margin-left: 15px;

    font-size: 1rem;

    transition: transform 0.2s ease;
  }

  .nav-dropdown.is-open .dropdown-arrow {
    transform: rotate(180deg);
  }


  /* =========================================================
     MOBILE SUBMENU
     IMPORTANT:
     Completely override desktop positioning and transforms.
     ========================================================= */

  .nav-dropdown-menu {
    position: static;

    top: auto;
    right: auto;
    bottom: auto;
    left: auto;

    z-index: auto;

    display: none;

    width: 100%;
    max-width: 100%;

    box-sizing: border-box;

    margin: 0;

    padding: 8px 0 12px 12px;

    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;

    background: #f7fbfe;

    box-shadow: none;

    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transform: none;

    transition: none;

    overflow: hidden;
  }


  /* JavaScript opens the mobile submenu */

  .nav-dropdown.is-open .nav-dropdown-menu {
    display: block;

    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transform: none;
  }


  /* Override desktop hover behavior on mobile */

  .nav-dropdown:hover .nav-dropdown-menu,
  .nav-dropdown:focus-within .nav-dropdown-menu {
    transform: none;
  }


  /* =========================================================
     MOBILE SUBMENU LINKS
     ========================================================= */

  .nav-dropdown-menu a {
    display: block;

    width: 100%;
    max-width: 100%;

    box-sizing: border-box;

    padding: 13px 14px;

    border-radius: 8px;

    color: #405262;

    font-size: 0.94rem;
    font-weight: 600;
    line-height: 1.35;

    white-space: normal;
    overflow-wrap: break-word;

    transform: none;
  }

  .nav-dropdown-menu a:hover,
  .nav-dropdown-menu a:focus {
    color: var(--blue);
    background: #ffffff;

    transform: none;
  }

}


/* =========================================================
   PHONE
   ========================================================= */

@media (max-width: 620px) {

  .nav-wrap {
    min-height: 72px;
  }

  .site-logo {
    width: 155px;
    max-width: 155px;
    height: 60px;
  }

  .site-logo img {
    max-height: 60px;
  }

  .main-nav {
    top: 72px;

    height: calc(100vh - 72px);
    height: calc(100dvh - 72px);

    padding: 16px 20px 35px;
  }

  .main-nav > a,
  .nav-dropdown-toggle {
    min-height: 56px;

    font-size: 1rem;
  }

  .nav-dropdown-menu {
    width: 100%;
    max-width: 100%;

    padding: 6px 0 10px 10px;
  }

  .nav-dropdown-menu a {
    width: 100%;
    max-width: 100%;

    padding: 12px;

    font-size: 0.92rem;
  }

}


/* =========================================================
   VERY SMALL PHONES
   ========================================================= */

@media (max-width: 390px) {

  .site-logo {
    width: 140px;
    max-width: 140px;
  }

  .main-nav {
    padding-left: 16px;
    padding-right: 16px;
  }

}