/* ------------------------------------------------ HEADER */

.light-header {
  color: white !important;

  a {
    color: white;
  }
}

.dark-header {
  color: black;

  a {
    color: black;
  }
}

/* header[dynamic-header] {
  color: var(--header-text-color, black);

  a {
    color: var(--header-link-color, black);
  }
} */

/* Optional: You can keep these classes for backwards compatibility or specific overrides */
/* .light-header {
  --header-text-color: white;
  --header-link-color: white;
}

.dark-header {
  --header-text-color: black;
  --header-link-color: black;
} */

.journey {
  top: 0 !important;
}

#header {
  position: relative;
  display: flex;
  padding: 16px 16px 24px;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  height: var(--header-height);
  z-index: 10;
  /* top: 44px; */
  animation: fadeInDown 1s ease-out 1.2s forwards;
  opacity: 0;
  transition: all 0.5s ease-out;

  .logo-wrapper {
    display: flex;
    justify-content: center;
  }

  .logo-wrapper img {
    max-width: 88px;
  }

  button {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    font-size: 12px;
    gap: 1rem;
  }

  li {
    font-size: 13px;
  }

  .ghost-menu-button {
    opacity: 0;
    min-width: 70.2px;
  }
}

/* ------------------------------------------------ MENU */

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

/* Ensure consistent width for Firefox */
@-moz-document url-prefix() {
  body {
    overflow-y: scroll;
    scrollbar-width: thin;
  }
}

/* For Webkit browsers (Chrome, Safari) */
body::-webkit-scrollbar {
  width: thin;
}

body {
  width: 100%;
  overflow-x: hidden;
  transition: padding-right 0.3s ease;
}

.toggle-menu-button {
  cursor: pointer;
  padding: 0;
  font-weight: 400;

  svg {
    z-index: 11;
    width: 12px;
    height: 15px;
  }
}

#mobile-menu {
  width: 100vw;
  height: 100vh;
  position: fixed;
  left: 0;
  top: -100%; /* Start off-screen */
  background-color: var(--bentley-white);
  transition: top 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
  opacity: 0;
  visibility: hidden;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow-y: auto;

  header {
    display: none;
  }

  .toggle-menu-wrapper {
    height: 3rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-right: 2rem;
    padding-top: 110px;
  }

  .toggle-menu-button {
    /* position: relative;
  top: 1px; */
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 0;
    z-index: 22;
  }

  a {
    text-transform: uppercase;
    color: var(--bm-text-color);
    text-decoration: none;

    &:hover {
      color: var(--bentley-living-green);
    }
  }

  nav {
    /* flex-grow: 1; */
    display: flex;
    flex-direction: column;
    justify-content: center;

    ul {
      list-style: none;
      display: flex;
      flex-direction: column;
      gap: 1.6rem;
      padding-left: 16px;
      padding-right: 40px;
      padding-top: 23px;

      li {
        transform: translateX(-50px);
        opacity: 0;
        transition: transform 0.3s ease, opacity 0.3s ease;
        transition-delay: calc(var(--item-index) * 0.2s);
        color: rgb(4, 4, 4);
      }

      a {
        padding: 2rem 0;
        display: block;
        width: 100%;
        height: 100%;
        letter-spacing: 1.3px;
        font-size: 16px;
        font-weight: 400;
      }
    }
  }

  .image-container {
    display: none;
    aspect-ratio: 464 / 448;
  }
}

#mobile-menu.is-open {
  top: 0; /* Slide to visible position */
  opacity: 1;
  visibility: visible;
}

#mobile-menu.is-open nav ul li {
  transform: translateX(0);
  opacity: 1;
}

#mobile-menu body.menu-open {
  overflow: hidden;
}

.desktop-nav {
  display: none;
}

.menu-image-overlay {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), #040404 75%);
  content: "";
  height: 90%;
  inset: 0;
  position: absolute;
  width: 100%;
}

@media (min-width: 768px) {
  #header {
    top: 10px;
    padding: 16px 30px 24px;
    flex-direction: row-reverse;
  }

  #header .logo-wrapper img {
    max-width: 110px;
  }

  .journey {
    top: 10px !important;
  }

  #mobile-menu {
    nav {
      display: flex;
      flex-direction: row;
      padding: 0 4rem 0 2rem;
    }

    header {
      display: flex;
    }

    ul {
      width: 100%;
      flex: 1;
      padding-top: 20px;
    }

    .image-container {
      flex-grow: 1;
      overflow: hidden;
      display: flex;
      flex: 0 0 calc(66.66667% - 16px);
      position: relative;
      margin-top: 6rem;

      img {
        width: 100%;
        height: 90%;
        object-fit: cover;
      }
    }

    .toggle-menu-wrapper {
      padding-top: 0;
      padding-right: 4rem;
    }

    .toggle-menu-button {
      /* flex-direction: row-reverse; */

      svg {
        margin-left: 0;
      }
    }
  }
}

@media (min-width: 1024px) {
  #header {
    top: 28px;
  }

  .journey {
    top: 20px !important;
  }
}

@media (min-width: 1440px) {
  #mobile-menu {
    display: none;
  }

  #header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding-left: 112px;
    padding-right: 112px;
  }

  /* Left content alignment */
  .left-content {
    justify-self: start;
  }

  /* Center the logo */
  .logo-wrapper {
    display: block;
    grid-column: 2;
    justify-self: center;
  }

  /* Right content alignment */
  .right-content {
    justify-self: end;
  }

  /* Hide mobile menu button */
  .toggle-menu-button,
  .ghost-menu-button {
    display: none !important;
  }

  /* Desktop navigation styles */
  .desktop-nav {
    display: flex;
    align-items: center;

    ul {
      padding: 0;
      list-style: none;
      margin: 0;
      display: flex;
      gap: 20px;
    }

    a {
      text-decoration: none;
      text-transform: uppercase;
      font-weight: 400;
    }
  }
}

/* ------------------------------------------------ FOOTER */

/* footer should fill the screen width */
#footer {
  /* color: var(--bentley-living-green); */
  font-size: 0.9em;
  margin-top: 20px;
  padding: 20px;
  padding-bottom: 10px;
  margin-top: 0px;
  transition: all 1s ease-in-out;

  a {
    font-weight: 400;
  }

  p {
    text-align: center;
    margin-bottom: 0;
  }

  p:last-child {
    margin-bottom: 0;
    /* font-size: 10px; */
    text-align: center;
  }

  img {
    width: 100%;
    max-width: 64px;
    padding-bottom: var(--bm-grid-gutter);
    margin-bottom: calc(var(--bm-grid-gutter) * 2);
  }

  li {
    display: flex;
  }

  h4 {
    margin-bottom: 20px;
  }

  .logo-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
  }
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  text-transform: uppercase;
  list-style: none;
  padding: 0;
  justify-content: center;

  a {
    font-size: 10px;
    text-decoration: none;
    color: black;
  }

  li {
    margin: 12px 10px;
  }
}

#footer .footer-nav-buttons {
  margin-bottom: 40px;
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px 20px;
}

@media (min-width: 768px) {
  #footer {
    padding: 40px 10% 10px 10%;

    img {
      max-width: 80px;
    }

    .footer-nav-buttons {
      flex-direction: row;
      align-items: center;
      justify-content: center;
    }
  }
}

@media (min-width: 1440px) {
  #footer {
    width: 100% !important;
    margin: 20px auto 0;
  }

  .footer-nav a {
    font-size: 12px;
  }
}

/* ------------------------------------------------ LOADING SPINNER */

[ng\:cloak],
[ng-cloak],
[data-ng-cloak],
[x-ng-cloak],
.ng-cloak,
.x-ng-cloak {
  display: none !important;
}

#loading-spinner {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  background-color: rgba(255, 255, 255, 0.9);
  background-repeat: repeat;
  background-size: 100px auto;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

#loading-spinner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.7);
}

#loading-spinner-content {
  position: relative;
  z-index: 1;
  color: #333;
  font-size: 24px;
  font-weight: bold;
}

/* Main content */
#init-hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

.body-content {
  background: linear-gradient(to bottom, white 30%, #f8f7f2);
  min-height: 100vh;
}

.body-content {
  min-height: 100vh;
}

.body-content:has(.standard-text-page) {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  grid-template-columns: 100%;
}

.body-content:has(.confirmation-page) {
  min-height: calc(100vh - 84px);
  margin: 0;
  display: grid;
  grid-template-rows: 1fr auto;
}

@media screen and (min-width: 768px) {
  .body-content {
    background: linear-gradient(to bottom, white 40%, #f8f7f2);
  }
}

/* Utility classes */
.fade-out {
  opacity: 0 !important;
  visibility: hidden !important;
}

.fade-in {
  opacity: 1 !important;
  visibility: visible !important;
}

.hidden {
  display: none !important;
}
