/* Header layout to match Soilux template - works with custom.css */

/* Navbar row: logo | centered nav | Get Started */
.navbar .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  position: relative;
}

.main-menu {
  display: flex;
  align-items: center;
  flex: 1;
}

header.main-header .header-sticky.active {
  background: #ffffff;
  border-bottom: 1px solid rgba(44, 44, 44, 0.08);
}

header.main-header .header-sticky.active .navbar,
header.main-header .header-sticky.active .navbar .container {
  min-height: 90px;
  padding-top: 0;
  padding-bottom: 0;
}

header.main-header .header-sticky.active .main-menu ul li a {
  color: #000000;
}

header.main-header .header-sticky.active .main-menu ul li a:hover,
header.main-header .header-sticky.active .main-menu ul li a:focus {
  color: var(--accent-color);
}

header.main-header .header-sticky.active .site-brand img {
  width: 90px;
  height: 90px;
}

/* Drawer close button – only visible in mobile drawer */
.nav-drawer-close {
  display: none;
}

/* Center the nav links (Soilux style) */
.main-menu .nav-menu-wrapper {
  display: flex;
  flex: 1;
  justify-content: center;
}

/* Mobile: drawer overlay and panel */
@media only screen and (max-width: 991px) {
  .navbar .container {
    justify-content: space-between;
  }

  /* Backdrop – full screen, tap to close */
  .nav-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    cursor: pointer;
  }

  /* Drawer panel – fixed right, slides in */
  .main-menu.responsive-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    flex-direction: column;
    align-items: stretch;
    margin: 0;
    padding: 0;
    padding-top: 24px;
    padding-bottom: 24px;
    padding-left: 20px;
    padding-right: 20px;
    background: var(--primary-color);
    border-left: 1px solid var(--dark-divider-color, rgba(255,255,255,0.1));
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
    pointer-events: none;
    order: unset;
    border-top: none;
    max-height: none;
  }

  .main-menu.responsive-menu.menu-open {
    transform: translateX(0);
    pointer-events: auto;
  }

  /* Close button – top of drawer (show only on mobile) */
  .main-menu.responsive-menu .nav-drawer-close {
    display: flex;
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white-color);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
  }

  .main-menu.responsive-menu .nav-drawer-close:hover,
  .main-menu.responsive-menu .nav-drawer-close:focus {
    background: rgba(255, 255, 255, 0.2);
    color: var(--accent-color);
    outline: none;
  }

  .main-menu .nav-menu-wrapper {
    width: 100%;
    justify-content: flex-start;
    flex: 0 0 auto;
    margin-top: 32px;
  }

  .main-menu .nav-menu-wrapper > ul {
    flex-direction: column;
    width: 100%;
    align-items: stretch;
  }

  .main-menu ul li {
    margin: 0;
    border-bottom: 1px solid var(--dark-divider-color, rgba(255,255,255,0.1));
  }

  .main-menu ul li a {
    display: block;
    padding: 14px 0 !important;
  }

  .main-menu ul ul {
    position: static;
    width: 100%;
    transform: none;
    box-shadow: none;
    margin: 0;
    padding-left: 15px;
    background: rgba(0,0,0,0.1);
    border-radius: 0;
  }

  .main-menu ul li:hover > ul {
    padding: 0 0 5px 0;
  }

  .main-menu .header-btn {
    display: block;
    margin-top: 24px;
    width: 100%;
    flex-shrink: 0;
  }

  .main-menu .header-btn a {
    display: block;
    text-align: center;
  }
}

/* Toggle button - match Soilux .slicknav_btn (already styled in custom.css) */
.navbar-toggle button.slicknav_btn {
  border: none;
  cursor: pointer;
  background: transparent;
}

/* Hamburger → X when menu open (custom.css targets `a`, we use `button`) */
@media only screen and (max-width: 991px) {
  .navbar-toggle button.slicknav_btn.slicknav_open .slicknav_icon span.slicknav_icon-bar:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 5px);
  }
  .navbar-toggle button.slicknav_btn.slicknav_open .slicknav_icon span.slicknav_icon-bar:nth-child(2) {
    opacity: 0;
  }
  .navbar-toggle button.slicknav_btn.slicknav_open .slicknav_icon span.slicknav_icon-bar:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -5px);
  }
}
