/* Header */
#header {
  position: fixed;
  top: 48px;
  left: 0;
  right: 0;
  z-index: 1000;
  margin-left: auto;
  margin-right: auto;
  /* width: 100%; */
}

#header .header-wrapper {
  width: 100%;
  padding: 24px 48px;
  background-color: var(--bg-primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-radius: 24px;
  /* Make bounce more pronounced with faster animation */
  transition: transform 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

#header #branding #site-title a {
  height: 40px;
  display: block;
}

#header #branding #site-title .custom-logo {
  height: 40px;
}

#header .menu-icon {
  height: 40px;
  width: 35px;
  cursor: pointer;
}

.header-menu-top {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

#header #menu {
}

#menu .main-menu {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

#header #menu .menu-item a {
  font-size: 3.15em;
  line-height: 140%;
  font-weight: 400;
  letter-spacing: -0.25px;
  text-decoration: none;
  color: var(--color-brown-medium);
}

/* Header Menu Toggle Styles */
.header-menu-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
  z-index: 100;
}

.menu-icon {
  width: 24px;
  height: auto;
  transition: opacity 0.3s ease;
}

.menu-icon-open {
  opacity: 1;
}

.menu-icon-close {
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
}

/* Menu Styles */
.menu-wrapper {
  max-height: 0;
  overflow: hidden;
  /* Delay the menu opening until after the bounce */
  transition:
    max-height 0.5s ease-in-out 0.2s,
    /* Added delay */ opacity 0.4s ease-in-out 0.2s; /* Added delay */
  opacity: 0;
  transform-origin: top;
}

/* Menu open state */
.menu-open #header {
  transform: translateY(-15px); /* Increased bounce height */
}

.menu-open .menu-wrapper {
  max-height: 640px; /* Adjust based on your menu height */
  opacity: 1;
}

.menu-open .menu-icon-open {
  opacity: 0;
}

.menu-open .menu-icon-close {
  opacity: 1;
}

#menu .main-menu {
  padding: 64px 0;
}

.header-address-contact {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  align-items: end;
}

.wrapper-address {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wrapper-address p {
  max-width: 470px;
  color: var(--color-brown-medium);
}

.wrapper-contact {
  display: flex;
  flex-direction: row;
  gap: 20px;
}

@media (min-width: 1800px) {
}

@media (min-width: 1600px) and (max-width: 1799px) {
  #header {
    max-width: var(--container-max-width-xl);
  }
}

@media (max-width: 1399px) {
  #header {
    max-width: var(--container-max-width-md);
  }
}

@media (max-width: 1200px) {
  #header {
    max-width: var(--container-max-width-sm);
  }
}

@media (max-width: 992px) {
  #header {
    max-width: var(--container-max-width-xs);
  }
}

/* XXL Screens (1800px and up) */
@media (min-width: 1800px) {
  #header {
    max-width: var(--container-max-width-xxl);
  }
}

/* XL Screens (1600px-1799px) */
@media (min-width: 1600px) and (max-width: 1799px) {
  #header {
    max-width: var(--container-max-width-xl);
  }
}

/* Large Screens (1400px-1599px) */
@media (min-width: 1400px) and (max-width: 1599px) {
  #header {
    max-width: var(--container-max-width);
  }
}

/* Medium-Large Screens (1200px-1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
  #header {
    max-width: var(--container-max-width-md);
  }
}

/* Small-Medium Screens (max-width: 1199px) */
@media (max-width: 1199px) {
  #header {
    max-width: var(--container-max-width-sm);
  }
}

/* Small Screens (max-width: 992px) */
@media (max-width: 992px) {
  #header {
    max-width: var(--container-max-width-xs);
  }
}

/* Mobile Screens (max-width: 768px) */
@media (max-width: 768px) {
  #header {
    max-width: var(--container-max-width-xs);
    width: 100%;
    top: 8px;
    padding: 16px 24px;
  }

  #header .header-wrapper {
    padding: 16px 24px;
  }

  #header #branding #site-title a {
    display: flex;
    align-items: center;
  }

  #header #branding #site-title .custom-logo {
    height: 32px;
  }

  #header .menu-icon {
    height: 32px;
    width: 28px;
  }

  #header .menu-open .menu-wrapper {
    max-height: 640px;
    opacity: 1;
  }

  #menu .main-menu {
    padding: 24px 0;
  }

  #header #menu .menu-item a {
    font-size: 1.77em;
  }

  #header .header-address-contact {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  #header .header-address-contact .wrapper-address {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  #header .wrapper-contact {
    flex-wrap: wrap;
    gap: 12px;
  }
}
