<!-- Save this as css/cascading-dropdown.css -->
<style>
/* Cascading Dropdown Menu Styles */
.car-search-container {
  width: 100%;
  position: relative;
  z-index: 999; /* Lower than the fixed header */

}



/* Header Styling */
.header-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background-color: #000000;
  color: #ffffff;
  position: relative;
  z-index: 99999;
  transition: background-color 0.3s, color 0.3s;
}

.header-section.inverted {
  background-color: #ffffff;
  color: #000000;
  z-index: 99999;

}

.logo img {
  max-height: 50px;
}

/* Menu Toggle Button */
.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
}

.menu-icon {
  width: 30px;
  height: 2px;
  background-color: #ffffff;
  position: relative;
  transition: background-color 0.3s;
}

.menu-icon::before,
.menu-icon::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 2px;
  background-color: #ffffff;
  transition: transform 0.3s, background-color 0.3s;
  left: 0;
}

.menu-icon::before {
  top: -8px;
}

.menu-icon::after {
  top: 8px;
}

/* Inverted toggle button */
.header-section.inverted .menu-icon,
.header-section.inverted .menu-icon::before,
.header-section.inverted .menu-icon::after {
  background-color: #000000;
}

/* Active state for menu toggle */
.menu-toggle.active .menu-icon {
  background-color: transparent;
}

.menu-toggle.active .menu-icon::before {
  transform: rotate(45deg);
  top: 0;
}

.menu-toggle.active .menu-icon::after {
  transform: rotate(-45deg);
  top: 0;
}

/* Dropdown Menu Styling */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 70px;
  left: 0;
  width: 100%;
  background-color: #000000;
  color: #ffffff;
  z-index: 1000;
  padding: 30px 20px;
  box-sizing: border-box;
}

.dropdown-menu.active {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

/* Car Search Form */
.car-search-form {
  flex: 1;
  max-width: 400px;
  margin-right: 40px;
}

.car-search-form h2 {
  color: white;
  margin-bottom: 20px;
}

.car-search {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

/* Select Group Styling */
.select-group {
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Custom Select Styling */
.custom-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: transparent;
  color: white !important;
  border: none;
  border-bottom: 2px solid white;
  padding: 10px 5px;
  font-size: 16px;
  width: 100%;
  cursor: pointer;
}

.custom-select option {
  background-color: #000000;
  color: white;
}

.custom-select::-webkit-scrollbar {
  width: 10px;
}

.custom-select::-webkit-scrollbar-track {
  background: #000000;
}

.custom-select::-webkit-scrollbar-thumb {
  background: #555555;
}

/* Down arrow indicator */
.select-group:after {
  content: '▼';
  font-size: 12px;
  color: white;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Disabled state */
.custom-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Focus state */
.custom-select:focus {
  outline: none;
  border-bottom-color: #ffffff;
}

/* Tune Button */
.tune-button {
  margin-top: 20px;
  padding: 12px 20px;
  background-color: transparent;
  color: white;
  border: 2px solid white;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s, color 0.3s;
}

.tune-button:hover:not(:disabled) {
  background-color: white;
  color: black;
}

.tune-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Car Search Description */
.car-search-description {
  flex: 1;
  max-width: 500px;
}

.car-search-description h2 {
  color: white;
  margin-bottom: 20px;
}

.car-search-description p {
  line-height: 1.6;
  font-size: 16px;
}

/* Overlay */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.7);
  z-index: 999;
}

.overlay.active {
  display: block;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .dropdown-menu.active {
    flex-direction: column;
  }
  
  .car-search-form,
  .car-search-description {
    max-width: 100%;
    margin-right: 0;
  }
  
  .car-search-description {
    margin-top: 40px;
  }
}

/* Divi-specific dropdown positioning fix */
#main-header {
  z-index: 99999 !important;
}

.et-fixed-header {
  z-index: 99999 !important;
}

/* Position the dropdown below Divi's fixed header */
.dropdown-menu {
  position: fixed !important;
  top: 80px !important; /* Adjust this to match your Divi header height exactly */
  left: 0 !important;
  width: 100% !important;
  z-index: 99998 !important;
  background-color: #000000 !important;
  box-shadow: 0 5px 10px rgba(0,0,0,0.2) !important;
  display: none !important;
}

.dropdown-menu.active {
  display: block !important;
}

/* Overlay styling */
.overlay {
  z-index: 99997 !important;
}

/* Force Divi to respect our styles */
.et_pb_section {
  z-index: auto !important;
}

/* Ensure dropdown content is visible */
.car-search-form,
.car-search-description {
  position: relative !important;
  z-index: 99998 !important;
}

/* Divi-specific dropdown positioning fix */
#main-header {
  z-index: 99999 !important;
}

.et-fixed-header {
  z-index: 99999 !important;
}

/* Position the dropdown below Divi's fixed header */
.dropdown-menu {
  position: fixed !important;
  top: 80px !important; /* Adjust this to match your Divi header height exactly */
  left: 0 !important;
  width: 100% !important;
  z-index: 99998 !important;
  background-color: #000000 !important;
  box-shadow: 0 5px 10px rgba(0,0,0,0.2) !important;
  display: none !important;
}

.dropdown-menu.active {
  display: block !important;
}

/* Overlay styling */
.overlay {
  z-index: 99997 !important;
}

/* Force Divi to respect our styles */
.et_pb_section {
  z-index: auto !important;
}

/* Ensure dropdown content is visible */
.car-search-form,
.car-search-description {
  position: relative !important;
  z-index: 1 !important;
}

#main-header,
.et-fixed-header {
    z-index: 99999 !important;
}
.dropdown-menu {
    z-index: 99998 !important;
}
.overlay {
    z-index: 99997 !important;
}
.car-search-container {
    z-index: 99996 !important;
}
.et_pb_section {
    z-index: auto !important;
}

/* Only visual changes to position the modal in the center */
.dropdown-menu {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 400px !important;
  max-width: 90% !important;
  background-color: rgba(0, 0, 0, 0.95) !important;
  z-index: 100000 !important;
}

/* Make overlay slightly lighter */
.overlay {
  background-color: rgba(255, 255, 255, 0.3) !important;
}
</style>