/* ==========================================================================
   Layout: Header
   ========================================================================== */

.l-header {
  padding: 20px;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;

  --header-height: 80px;
  background-color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.l-header__inner {
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
}

.l-header__logo {
  text-decoration: none;
  flex: none;
  height: 34px;
  width: 280px;
  max-width: 100%;
  display: block;
}

.l-header__logo img {
  height: 100%;
  width: 100%;
  object-fit: contain;
  display: block;
  transition: opacity 0.3s;
}

.l-header__logo img:hover {
  opacity: 0.7;
}

.l-header__nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.l-header__link {
  color: var(--primary-text-color);
  text-decoration: none;
  font-size: var(--font-sm);
  letter-spacing: var(--default-letter-spacing);
  font-weight: bold;
  white-space: nowrap;
  transition: opacity 0.3s;
}

.l-header__link:hover {
  opacity: 0.7;
}

.l-header__phone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.l-header__phone-number {
  display: flex;
  align-items: center;
  font-weight: bold;
  color: var(--primary-color);
  font-size: var(--font-base);
  letter-spacing: var(--default-letter-spacing);
}

.l-header__phone-number::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  background-image: url("../../images/common/icons/icon_tel_gy.png");
  background-size: contain;
  background-repeat: no-repeat;
  margin-right: 0.5em;
}

.l-header__phone-hours {
  font-size: var(--font-xs);
  color: var(--primary-text-color);
}

.l-header__nav-mobile {
  display: none;
}

.l-header__menu-toggle {
  display: none;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.l-header__menu-toggle-bar {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px auto;
  transition: all 0.3s ease-in-out;
  background-color: var(--dark);
}

/* ==========================================================================
   Layout: Overlay (Used with mobile menu)
   ========================================================================== */
.l-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 990; /* Below mobile nav and toggle */
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  pointer-events: none;
}

.l-overlay.is-active {
  opacity: 1;
  pointer-events: all;
}

/* ==========================================================================
   Media Queries for Header Responsiveness
   ========================================================================== */
@media (max-width: 864px) {
  /* Hide desktop nav, show toggle */
  .l-header__nav {
    display: none;
  }

  .l-header__menu-toggle {
    display: block;
  }

  /* Mobile Nav Styling */
  .l-header__nav-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    position: fixed;
    bottom: -100vh;
    left: 0;
    width: 100%;
    height: 100dvh;
    background-color: white;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    z-index: 999;
    padding: 80px 20px 20px;
    overflow-y: auto;
    opacity: 0;
    transition:
      bottom 0.5s cubic-bezier(0, 0, 0, 1),
      opacity 0.5s ease-in-out;
  }

  /* Active state for mobile nav */
  .l-header__nav-mobile.is-active {
    bottom: 0;
    opacity: 1;
  }

  .l-header__nav-mobile .l-header__logo {
    width: 200px;
  }

  .l-header__nav-mobile .l-header__link {
    font-size: var(--font-base);
  }

  /* Hamburger animation */
  .l-header__menu-toggle.is-active .l-header__menu-toggle-bar:nth-child(2) {
    opacity: 0;
  }

  .l-header__menu-toggle.is-active .l-header__menu-toggle-bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .l-header__menu-toggle.is-active .l-header__menu-toggle-bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
}
