

/* ===== Site Header (top.php) ===== */
.site-header {
  background-color: #f9f5f0;
  border-bottom: 1px solid #e8dfd5;
  position: relative;
}

.header-container {
  max-width:100%;
  margin: 0 auto;
  background-color: #f9f5f0;
  padding: 20px 40px;
  display: grid;
  grid-template-columns: auto 1fr auto; /* logo | centered nav | phone */
  align-items: center;
}

.logo {
  font-size: 1.2rem;
  font-weight: 600;
  color: #502628;
  text-decoration: none;
}

.header-nav {
  grid-column: 2;
  justify-self: center;
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 40px;
  align-items: center;
}
.nav-links li {
  position: relative;
}
.nav-links a {
  text-decoration: none;
  color: #2c1810;
  font-size: 1rem;
  font-weight: 400;
  transition: color 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav-links a:hover {
  color: #8b5a3c;
}

.dropdown-arrow {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-left: 2px solid #2c1810;
  border-bottom: 2px solid #2c1810;
  transform: rotate(-45deg);
  margin-top: -3px;
  transition: border-color 0.3s ease;
}
.nav-links a:hover .dropdown-arrow,
.drawer-links a:hover .dropdown-arrow {
  border-color: #8b5a3c;
}

/* Submenu (desktop dropdown under header nav) */
.nav-links li.has-submenu > a {
  position: relative;
}
.nav-links li .submenu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: #ffffff;
  border: 1px solid #e8dfd5;
  box-shadow: 0 6px 12px rgba(0,0,0,0.08);
  list-style: none;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 1002;
}
.nav-links li.has-submenu:hover > .submenu,
.nav-links li.has-submenu:focus-within > .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-links li .submenu li a {
  display: block;
  padding: 10px 14px;
  color: #2c1810;
  white-space: nowrap;
}
.nav-links li .submenu li a:hover {
  background-color: #f9f5f0;
  color: #8b5a3c;
}

.phone-link {
  grid-column: 3;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #2c1810;
  font-size: 1rem;
  transition: color 0.3s ease;
}
.phone-link:hover {
  color: #8b5a3c;
}
.phone-icon {
  width: 20px;
  height: 20px;
}

.mobile-menu-btn {
  grid-column: 3;
  justify-self: end;
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #2c1810;
  cursor: pointer;
}

/* Tablet tweaks */
@media (max-width: 968px) {
  .header-container {
    padding: 12px 20px;
  }
  .nav-links {
    gap: 28px;
  }
}

/* Mobile layout (legacy desktop header behavior if shown) */
@media (max-width: 768px) {
  /* Layout: show logo left, phone centered, hamburger right */
  .header-container {
    display:none;
    grid-template-columns: auto 1fr auto;
    padding: 12px 16px;
  }
  .logo {
    display: block;
  }
  .phone-link {
    grid-column: 2;
    justify-self: center;
  }
  .mobile-menu-btn {
    display: block;
    grid-column: 3;
    justify-self: end;
  }

  /* Nav toggling */
  .header-nav {
    display: none;
  }
  .header-nav.active {
    display: flex;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background-color: #f9f5f0;
    border-bottom: 1px solid #e8dfd5;
    box-shadow: 0 4px 6px rgba(0,0,0,0.06);
    justify-content: center;
    padding: 16px 0;
    z-index: 1000;
  }
  .nav-links {
    flex-direction: column;
    gap: 18px;
  }
}

/* ------------------------------ */
/* Dedicated Mobile Header & Nav  */
/* ------------------------------ */
.mobile-header {
  display: none;
  background-color: #f9f5f0;
  border-bottom: 1px solid #e8dfd5;
  position: relative;
}

.mobile-bar {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 5px;
  display: grid;
  grid-template-columns: auto 1fr auto; /* logo | phone center | hamburger */
  align-items: center;
}

.mobile-logo {
  font-size: 1rem;
  font-weight: 600;
  color: #502628;
  text-decoration: none;
}
.mobile-phone {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #2c1810;
  font-size: 0.9rem;
}
.mobile-header .mobile-menu-btn {
  display: block;
  grid-column: 3;
  justify-self: end;
}

/* Slide-down mobile nav (legacy, not used now) */
.mobile-nav {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background-color: #f9f5f0;
  border-bottom: 1px solid #e8dfd5;
  box-shadow: 0 4px 6px rgba(0,0,0,0.06);
  z-index: 1000;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  transition: max-height 0.3s ease, opacity 0.25s ease, transform 0.25s ease;
}
.mobile-nav.open {
  max-height: 300px; /* enough space for links */
  opacity: 1;
  transform: translateY(0);
}
.mobile-nav .nav-links {
  flex-direction: column;
  gap: 18px;
  align-items: center;
  padding: 16px 0;
}

/* Show mobile header on small screens; hide desktop header */
@media (max-width: 768px) {
  .site-header {
    display: none;
  }
  /* Ensure desktop header container is hidden on mobile even if .site-header is missing */
  header .header-container {
    display: none;
  }
  .mobile-header {
    display: block;
  }
}

/* ------------------------------ */
/* Off-canvas Mobile Drawer       */
/* ------------------------------ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.30);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 1000;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  width: 80%;
  max-width: 360px;
  background: #f9f5f0;
  box-shadow: -4px 0 12px rgba(0,0,0,0.12);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 1001;
  display: flex;
  flex-direction: column;
}
.mobile-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border-bottom: 1px solid #e8dfd5;
}
.drawer-logo {
  font-size: 1.2rem;
  font-weight: 600;
  color: #502628;
  text-decoration: none;
}
.drawer-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: #2c1810;
  cursor: pointer;
}

.drawer-nav {
  padding: 12px 16px;
}
.drawer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding:0px;
}
.drawer-links a {
  text-decoration: none;
  color: #2c1810;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Submenu (mobile drawer) */
.drawer-links .submenu-toggle {
  background: none;
  border: none;
  color: #2c1810;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 0;
  width: 100%;
  text-align: left;
}
.drawer-links li .submenu {
  list-style: none;
  padding-left: 12px;
  margin-top: 8px;
  display: none;
}
.drawer-links li.has-submenu.open > .submenu {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.drawer-links li .submenu a {
  text-decoration: none;
  color: #2c1810;
  font-size: 1rem;
}

/* Prevent background scroll while drawer open */
body.drawer-open {
  overflow: hidden;
}

/* Hide drawer on larger screens */
@media (min-width: 769px) {
  .drawer-overlay {
    display: none;
  }
  .mobile-drawer {
    display: none;
  }
}