/* ============================================================
   DR. FOSTER'S ESSENTIALS — NAVIGATION STYLESHEET
   df_nav.css
   Covers: top search bar, desktop dropdown nav, hamburger menu,
           mobile full-screen overlay, mobile accordions
   Last updated: July 2026
   ============================================================ */


/* ============================================================
   TOP NAV BAR WRAPPER
   The #top_nav div already exists in your templates
   ============================================================ */

#top_nav {
  background-color: #1a4b8f;
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  box-sizing: border-box;
  position: relative;
  z-index: 500;
}


/* ============================================================
   TOP SEARCH BAR (top_search.php)
   Sits on the RIGHT side of the nav bar on desktop
   ============================================================ */

 #top-search-form {
  display: flex;
  align-items: center;
}

 #top-search-inner {
  display: flex;
  align-items: center;
  gap: 0;
}

 #top-search-input {
  height: 28px;
  padding: 0 8px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  border: none;
  border-radius: 3px 0 0 3px;
  outline: none;
  width: 160px;
  background: #ffffff;
  color: #1a4b8f;
  box-sizing: border-box;
}

 #top-search-input:focus {
  box-shadow: 0 0 0 2px #cc9731;
}

 #top-search-btn {
  height: 28px;
  padding: 0 10px;
  background-color: #cc9731;
  color: #ffffff;
  border: none;
  border-radius: 0 3px 3px 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s ease;
}

 #top-search-btn:hover {
  background-color: #b8841f;
}


/* ============================================================
   DESKTOP DROPDOWN NAV
   ============================================================ */

 #desktop-nav {
  display: flex;
  align-items: center;
  height: 40px;
  flex: 1;
}

.dd-wrap {
  position: relative;
  height: 40px;
  display: flex;
  align-items: center;
}

.dd-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: bold;
  padding: 0 12px;
  height: 40px;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background-color 0.2s ease;
}

.dd-btn:hover,
.dd-wrap.open .dd-btn {
  background-color: #4a7bc4;
}

.dd-arrow {
  font-size: 8px;
  transition: transform 0.2s ease;
}

.dd-wrap.open .dd-arrow {
  transform: rotate(180deg);
}

/* Dropdown menus */
.dd-menu {
  display: none;
  position: absolute;
  top: 40px;
  left: 0;
  background-color: #1a4b8f;
  border: 1px solid #4a7bc4;
  border-top: none;
  min-width: 220px;
  list-style: none;
  padding: 4px 0;
  margin: 0;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

/* Last dropdown opens to the left so it doesn't go off-screen */
.dd-menu-right {
  left: auto;
  right: 0;
}

/* Scrollable dropdown for long lists */
.dd-menu-scroll {
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
}

.dd-wrap.open .dd-menu {
  display: block;
}

.dd-menu li {
  margin: 0;
  padding: 0;
}

.dd-menu a {
  display: block;
  padding: 7px 16px;
  color: #ffffff !important;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: normal !important;
  text-decoration: none !important;
  transition: background-color 0.15s ease;
  line-height: 1.4;
}

.dd-menu a:hover {
  background-color: #dde8f7;
  color: #1a4b8f !important;
}

.dd-see-all {
  font-weight: bold !important;
  color: #cc9731 !important;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  margin-bottom: 4px;
}

.dd-see-all:hover {
  color: #1a4b8f !important;
}

/* Scrollbar styling for long dropdowns */
.dd-menu-scroll::-webkit-scrollbar {
  width: 6px;
}
.dd-menu-scroll::-webkit-scrollbar-track {
  background: #1a4b8f;
}
.dd-menu-scroll::-webkit-scrollbar-thumb {
  background: #4a7bc4;
  border-radius: 3px;
}


/* ============================================================
   HAMBURGER BUTTON
   Hidden on desktop, visible on mobile
   ============================================================ */

 #hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  width: 40px;
  height: 40px;
}

 #hamburger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: #ffffff;
  border-radius: 1px;
  transition: all 0.3s ease;
}

 #hamburger-btn.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
 #hamburger-btn.open span:nth-child(2) {
  opacity: 0;
}
 #hamburger-btn.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}


/* ============================================================
   MOBILE FULL-SCREEN OVERLAY
   ============================================================ */

 #mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #1a4b8f;
  z-index: 2000;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.3s ease;
  overflow: hidden;
}

 #mobile-overlay.open {
  display: flex;
  opacity: 1;
}

 #mobile-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 50px;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
}

 #mobile-overlay-header span {
  color: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: bold;
}

 #mobile-close-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

 #mobile-overlay-content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 24px;
}

/* Mobile search */
 #mobile-search {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

.mobile-search-row {
  display: flex;
  gap: 0;
}

.mobile-search-row input[type="text"] {
  flex: 1;
  height: 36px;
  padding: 0 10px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  border: none;
  border-radius: 3px 0 0 3px;
  outline: none;
  background: #ffffff;
  color: #1a4b8f;
}

.mobile-search-btn {
  height: 36px;
  padding: 0 14px;
  background-color: #cc9731;
  color: #ffffff;
  border: none;
  border-radius: 0 3px 3px 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
}

/* Mobile sections */
.mob-section {
  border-bottom: 1px solid rgba(255,255,255,0.15);
  padding-bottom: 8px;
  margin-bottom: 0;
}

.mob-section-head {
  padding: 14px 16px 6px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: bold;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Mobile plain links */
.mob-link {
  display: block;
  padding: 12px 16px;
  color: #ffffff !important;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  font-weight: normal !important;
  text-decoration: none !important;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: background-color 0.15s ease;
}

.mob-link:hover {
  background-color: rgba(255,255,255,0.1);
}

/* Featured link (Start Here, Shop All) */
.mob-link-featured {
  color: #cc9731 !important;
  font-weight: bold !important;
}

/* Mobile accordion buttons */
.mob-accordion-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  font-weight: normal;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease;
}

.mob-accordion-btn:hover,
.mob-accordion-btn.open {
  background-color: rgba(255,255,255,0.08);
}

.mob-arrow {
  font-size: 10px;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 8px;
}

.mob-accordion-btn.open .mob-arrow {
  transform: rotate(180deg);
}

/* Mobile accordion lists */
.mob-accordion-list {
  list-style: none;
  padding: 0;
  margin: 0;
  background-color: rgba(0,0,0,0.2);
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.mob-accordion-scroll {
  max-height: 300px !important;
  overflow-y: auto !important;
}

.mob-accordion-list li {
  margin: 0;
  padding: 0;
}

.mob-accordion-list a {
  display: block;
  padding: 10px 24px;
  color: #dde8f7 !important;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: normal !important;
  text-decoration: none !important;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background-color 0.15s ease;
}

.mob-accordion-list a:hover {
  background-color: rgba(255,255,255,0.1);
  color: #ffffff !important;
}

.mob-see-all {
  color: #cc9731 !important;
  font-weight: bold !important;
}


/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Tablet and below — switch to hamburger */
@media (max-width: 768px) {
   #desktop-nav {
    display: none !important;
  }

   #hamburger-btn {
    display: flex !important;
  }

   #top_nav {
    height: 44px;
    justify-content: space-between;
    padding: 0 12px;
  }

   #top-search-form {
    display: none;
  }

   #top_left_search_container {
    display: none !important;
  }
}

/* Desktop — hide hamburger and overlay */
@media (min-width: 769px) {
   #hamburger-btn {
    display: none !important;
  }

   #mobile-overlay {
    display: none !important;
  }
}

/* Large desktop — slightly larger nav text */
@media (min-width: 1024px) {
  .dd-btn {
    font-size: 13px;
    padding: 0 14px;
  }
}


/* ============================================================
   DOCU-CLASSES FEATURED BUTTON
   Gold highlight to make it stand out in the nav bar
   ============================================================ */

.dd-btn-featured {
  color: #cc9731 !important;
  font-weight: bold;
}

.dd-btn-featured:hover,
.dd-wrap:has(.dd-btn-featured).open .dd-btn-featured {
  background-color: #cc9731 !important;
  color: #ffffff !important;
}

/* Mobile Docu-Classes section header — also gold */
.mob-section:has(.mob-link[href*="docu"]) .mob-section-head,
.mob-section:has(.mob-link[href*="detox"]) .mob-section-head {
  color: #cc9731;
}

/* Override legacy absolute positioning from df_main.css */
#top_left_search_container {
  position: relative !important;
  left: auto !important;
  width: auto !important;
  height: auto !important;
  display: flex !important;
  align-items: center !important;
}

#small_top_win {
  display: none !important;
}

#small_top_win2 {
  display: none !important;
}

/* Move search to right side */
#top_nav {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 8px !important;
  box-sizing: border-box !important;
}

/* Desktop nav takes up available space */
#desktop-nav {
  flex: 1 !important;
  display: flex !important;
  align-items: center !important;
  height: 40px !important;
}

/* Search form stays on right */
#top-search-form {
  margin-left: auto !important;
  flex-shrink: 0 !important;
}

/* Force correct order - nav left, search right */
#top_nav {
  flex-direction: row !important;
}

#top-search-form {
  order: 2 !important;
  margin-left: auto !important;
}

#desktop-nav {
  order: 1 !important;
}

/* Hide small_top_win completely */
#small_top_win,
#small_top_win2 {
  display: none !important;
}

.dd-btn {
  padding: 0 8px !important;
  font-size: 12px !important;
}

/* Fix search box position */
#top_nav {
  position: relative !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  height: 40px !important;
  overflow: visible !important;
}

#top-search-form {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  order: 3 !important;
  margin-left: auto !important;
  z-index: 600 !important;
  flex-shrink: 0 !important;
}

#desktop-nav {
  position: relative !important;
  z-index: 600 !important;
  order: 1 !important;
  flex: 1 !important;
  overflow: visible !important;
}

/* Fix dropdown z-index so they appear above everything */
.dd-menu {
  z-index: 1000 !important;
  position: absolute !important;
}

.dd-wrap {
  position: relative !important;
  overflow: visible !important;
}

#top_nav,
#top,
#wrap {
  overflow: visible !important;
}

