/*--------------------------------------------------------------
	Fixed Navbar CSS - Mobile Friendly Version
	Updated to integrate with base CSS variables
--------------------------------------------------------------*/

/* 1. Main Navigation Container */
.dac-nav {
  background-color: var(--bg-white);
  border: 0;
  border-radius: 0;
  border-bottom: 3px solid var(--primary-color);
  z-index: var(--z-fixed);
  font-family: var(--font-main);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 13px;
  transition: background, padding 0.4s ease-in-out 0s;
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  min-height: 50px;
  margin-bottom: 20px;
}

.dac-nav-container {
  padding-right: 100px;
  padding-left: 100px;
  margin-right: auto;
  margin-left: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 50px;
  flex-wrap: nowrap;
  width: 100%;
  gap: 5px;
}

/* 2. Navigation Header & Brand */
.dac-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 50px;
}

.dac-nav-brand {
  padding: 0;
  font-size: 22px;
  line-height: 20px;
  height: 50px;
  letter-spacing: 4px;
  font-weight: 400;
  color: var(--text-dark);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 1;
  margin-bottom: 0;
}

.dac-nav-logo {
  height: 60px;
  width: 250px;
  max-height: 100%;
  object-fit: contain;
  margin-bottom: 0;
}

/* Mobile Menu Toggle Button */
.dac-nav-toggle {
  display: none;
  background: var(--primary-color);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  padding: 12px 10px;
  flex-direction: column;
  justify-content: space-between;
  width: 44px;
  height: 44px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  margin-left: auto;
}

.dac-nav-toggle:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.dac-nav-toggle:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.dac-nav-toggle-bar {
  display: block;
  height: 3px;
  width: 100%;
  background-color: var(--text-color);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* 3. Navigation Menu */
.dac-nav-menu {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  transition: all 0.3s ease;
  height: 50px;
  align-items: center;
  flex: 1 1 auto;
  justify-content: flex-end;
  margin-bottom: 0;
}

.dac-nav-menu-list {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  margin-bottom: 0;
  padding-left: 0;
}

.dac-nav-item {
  position: relative;
  width: 180px;
  text-align: center;
  height: 50px;
  display: flex;
  align-items: center;
  margin-bottom: 0;
}

.dac-nav-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  color: var(--text-dark);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
  line-height: 20px;
  width: 100%;
  box-sizing: border-box;
  white-space: nowrap;
  height: 100%;
  margin-bottom: 0;
  border-bottom: none;
}

.dac-nav-link:hover {
  background-color: rgba(0, 123, 255, 0.1);
  color: var(--primary-color);
  border-bottom: none;
}

.dac-nav-link.dac-dropdown-toggle::after {
  content: "▼";
  font-size: 9px;
  margin-left: 4px;
  display: inline-block;
}

/* 4. Dropdown System */
.dac-dropdown {
  position: relative;
}

.dac-dropdown-toggle {
  cursor: pointer;
}

/* First Level Dropdown */
.dac-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: var(--z-dropdown);
  min-width: 120px;
  width: max-content;
  padding: 0;
  margin: 0;
  font-size: 14px;
  text-align: left;
  list-style: none;
  background-color: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: var(--shadow-lg);
}

.dac-dropdown-menu-right {
  right: 0;
  left: auto;
}

/* Second Level Dropdown - wraps around text */
.dac-dropdown-nested .dac-dropdown-menu {
  top: 0;
  left: 100%;
  margin-top: -1px;
  margin-left: -1px;
  min-width: auto;
  width: max-content;
  white-space: nowrap;
}

/* Third Level Dropdown - same as second level */
.dac-dropdown-nested .dac-dropdown-nested .dac-dropdown-menu {
  top: 0;
  left: 100%;
  margin-top: -1px;
  margin-left: -1px;
  min-width: auto;
  width: max-content;
  white-space: nowrap;
}

/* Desktop Hover Behavior */
@media (min-width: 768px) {
  .dac-dropdown:hover > .dac-dropdown-menu,
  .dac-dropdown.dac-dropdown-nested:hover > .dac-dropdown-menu {
    display: block;
  }
  
  .dac-dropdown-menu .dac-dropdown:hover > .dac-dropdown-menu,
  .dac-dropdown-menu .dac-dropdown-nested:hover > .dac-dropdown-menu {
    display: block;
  }
}

/* Mobile Click Behavior */
.dac-dropdown.open > .dac-dropdown-menu,
.dac-dropdown.dac-dropdown-nested.open > .dac-dropdown-menu {
  display: block;
}

/* Dropdown Items - FIXED SPACING */
.dac-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 12px;
  font-weight: normal;
  color: var(--primary-color);
  text-align: left;
  white-space: nowrap;
  background: none;
  border: 0;
  border-bottom: 1px solid rgba(0, 123, 255, 0.1);
  text-decoration: none;
  letter-spacing: 1px;
  font-size: 13px;
  line-height: 1 !important;
  transition: all 0.2s ease;
  cursor: pointer;
  margin-bottom: 0 !important;
  min-height: 44px;
  box-sizing: border-box;
}

.dac-dropdown-item:last-child {
  border-bottom: none;
}

/* Second & Third Level Dropdown Items */
.dac-dropdown-nested .dac-dropdown-item,
.dac-dropdown-nested .dac-dropdown-nested .dac-dropdown-item {
  min-width: max-content;
  line-height: 1 !important;
  margin-bottom: 0 !important;
}

/* Hover effects */
.dac-dropdown-item:hover {
  background-color: rgba(0, 123, 255, 0.1);
  color: var(--primary-dark);
  padding-left: 16px;
}

/* Arrow styling */
.dac-dropdown-item.dac-dropdown-toggle::after {
  content: "▶";
  font-size: 7px;
  color: var(--primary-color);
  transition: transform 0.3s ease;
  margin-left: 8px;
  flex-shrink: 0;
}

/* Second & Third level arrows */
.dac-dropdown-nested .dac-dropdown-item.dac-dropdown-toggle::after,
.dac-dropdown-nested .dac-dropdown-nested .dac-dropdown-item.dac-dropdown-toggle::after {
  margin-left: 12px;
}

.dac-dropdown.open > .dac-dropdown-toggle::after,
.dac-dropdown.dac-dropdown-nested.open > .dac-dropdown-toggle::after {
  transform: rotate(90deg);
}

.dac-dropdown-item:hover::after {
  color: var(--primary-dark);
}

/* 5. Product Category Styling - FIXED SPACING */
.dac-nav-product-category {
  font-weight: 600;
  color: var(--primary-color);
  border-left: 3px solid var(--primary-color);
  background-color: rgba(0, 123, 255, 0.05);
  font-size: 14px;
  padding: 12px 12px;
  margin-left: -1px;
  line-height: 1 !important;
  border-bottom: 1px solid rgba(0, 123, 255, 0.1);
  margin-bottom: 0 !important;
  min-height: 44px;
}

.dac-nav-product-subcategory {
  font-weight: 500;
  color: var(--primary-dark);
  font-size: 13px;
  padding: 12px 12px 12px 16px;
  line-height: 1 !important;
  border-bottom: 1px solid rgba(0, 123, 255, 0.1);
  margin-bottom: 0 !important;
  min-height: 44px;
}

.dac-nav-product-item {
  color: var(--primary-color);
  font-size: 12px;
  padding: 12px 12px 12px 20px;
  line-height: 1 !important;
  border-bottom: 1px solid rgba(0, 123, 255, 0.1);
  margin-bottom: 0 !important;
  min-height: 44px;
}

/* 6. Mobile Responsive - RESTORED MOBILE DESIGN */
@media (max-width: 767px) {
  .dac-nav-container {
    padding-right: 20px; /* Much smaller on mobile */
    padding-left: 20px;
    flex-wrap: wrap; /* Allow wrapping on mobile */
    height: auto; /* Auto height for mobile */
    min-height: 50px; /* Minimum height */
  }

  .dac-nav-header {
    flex-wrap: nowrap;
    height: 50px;
    padding: 0 10px !important; /* Force wider padding */
    width: 100% !important;
    margin: 0 !important;
    gap: 10px;
    box-sizing: border-box;
  }

  .dac-nav-brand {
    padding: 0;
    height: 50px;
    justify-content: flex-start;
  }
  
  .dac-nav-toggle {
    display: flex;
    margin-left: auto;
  }
  
  .dac-nav-logo {
    height: 45px;
  }
  
  .dac-nav-menu {
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    background-color: var(--bg-white);
    flex-direction: column;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
    z-index: var(--z-sticky);
    align-items: flex-start;
    justify-content: flex-start;
  }
  
  .dac-nav-menu.active {
    max-height: calc(100vh - 50px);
    height: calc(100vh - 50px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .dac-nav-menu-list {
    flex-direction: column;
    width: 100%;
    min-height: min-content;
    padding-top: 0;
    margin-top: 0;
  }
  
  .dac-nav-item {
    float: none;
    width: 100% !important;
    text-align: left !important;
    height: auto;
    display: block;
    min-height: 44px;
    position: static;
    margin: 0;
    padding: 0;
  }
  
  .dac-nav-link {
    padding: 12px 18px !important;
    text-align: left !important;
    white-space: normal !important;
    border-bottom: 1px solid var(--border-light);
    height: auto;
    display: block;
    min-height: 44px;
    display: flex;
    align-items: center;
    font-size: 12px;
    margin-bottom: 0;
    line-height: 1 !important;
  }

  .dac-dropdown {
    position: static;
  }

  .dac-dropdown-menu {
    position: static;
    float: none;
    width: 100%;
    margin: 0;
    box-shadow: none;
    border: none;
    border-top: 1px solid rgba(0, 123, 255, 0.1);
    min-width: auto !important;
    width: 100%;
    display: none;
    background-color: var(--bg-lighter);
  }
  
  .dac-dropdown.open > .dac-dropdown-menu {
    display: block !important;
  }
  
  .dac-dropdown-nested .dac-dropdown-menu {
    position: static;
    margin: 0;
    min-width: auto !important;
    width: 100%;
    display: none;
  }
  
  .dac-dropdown-nested.open > .dac-dropdown-menu {
    display: block !important;
  }

  .dac-dropdown-item {
    padding: 12px 18px 12px 24px !important;
    font-size: 12px;
    line-height: 1 !important;
    min-height: 44px;
    margin: 0 !important;
    display: flex;
    align-items: center;
  }

  .dac-nav-product-category {
    font-size: 13px !important;
    padding: 12px 18px 12px 18px !important;
    line-height: 1 !important;
    margin-bottom: 0;
  }
  
  .dac-nav-product-subcategory {
    font-size: 12px !important;
    padding: 12px 18px 12px 24px !important;
    line-height: 1 !important;
    margin-bottom: 0;
  }
  
  .dac-nav-product-item {
    font-size: 11px !important;
    padding: 12px 18px 12px 30px !important;
    line-height: 1 !important;
    margin-bottom: 0;
  }

  .dac-dropdown-item.dac-dropdown-toggle::after {
    margin-right: 6px;
    margin-top: 0;
    transform: none;
  }
  
  .dac-dropdown.open > .dac-dropdown-toggle::after,
  .dac-dropdown.dac-dropdown-nested.open > .dac-dropdown-toggle::after {
    transform: rotate(90deg);
  }
  
  .dac-nav-toggle.active .dac-nav-toggle-bar:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
  }
  
  .dac-nav-toggle.active .dac-nav-toggle-bar:nth-child(2) {
    opacity: 0;
  }
  
  .dac-nav-toggle.active .dac-nav-toggle-bar:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }
}

/* 7. Accessibility */
.dac-nav-link:focus,
.dac-dropdown-item:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: -2px;
}

/* 8. Prevent body scroll when mobile menu is open */
body.mobile-nav-open {
  overflow: hidden;
}

/* 9. Reset base styles - FIXED SPACING */
.dac-nav * {
  margin-bottom: 0 !important;
}

.dac-nav a {
  text-decoration: none;
  border-bottom: none;
}

.dac-nav li {
  margin-bottom: 0 !important;
}