/* Custom Dropdown Styles */
.custom-dropdown {
  position: relative;
  display: inline-block;
}

.custom-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: "General Sans", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  transition: all 0.2s ease;
  border-radius: 6px;
}

.custom-dropdown-trigger:hover {
  background: rgba(0, 0, 0, 0.05);
}

.custom-dropdown-trigger svg {
  transition: transform 0.2s ease;
}

.custom-dropdown.open .custom-dropdown-trigger svg {
  transform: rotate(180deg);
}

.custom-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
  overflow: hidden;
  pointer-events: none;
}

.custom-dropdown.open .custom-dropdown-menu,
.custom-dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.custom-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  cursor: pointer;
  font-family: "General Sans", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  transition: background 0.15s ease;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.custom-dropdown-item:hover {
  background: #f5f5f5;
}

.custom-dropdown-item.selected {
  background: #e3f2fd;
  color: #001f3f;
}

.custom-dropdown-item .flag {
  font-size: 18px;
}

/* Flag icons (circular images) */
.custom-dropdown-item .flag-icon,
.custom-dropdown-trigger .flag-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 8px;
}

.custom-dropdown-item .icon {
  width: 18px;
  height: 18px;
  color: #666;
}

/* Header variant - compact */
.custom-dropdown.header-dropdown .custom-dropdown-trigger {
  padding: 6px 10px;
  font-size: 14px;
}

.custom-dropdown.header-dropdown .custom-dropdown-menu {
  min-width: 160px;
}

/* Mobile: Hide text labels in header dropdowns, show only icons */
@media (max-width: 767px) {
  /* Show hamburger icon on mobile, hide home icon */
  #home-icon-link {
    display: none !important;
  }

  #hamburger-icon-visual {
    display: block !important;
  }

  /* Wrapper for mobile menu needs to allow positioning */
  #menu-icon-wrapper {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    width: 40px !important;
    height: 40px !important;
  }

  /* Position mobile menu dropdown wrapper to overlay hamburger */
  #menu-icon-wrapper .mobile-menu-dropdown {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    z-index: 100 !important;
    width: 40px !important;
    height: 40px !important;
    margin: 0 !important;
  }

  /* Hide mobile menu dropdown label */
  #menu-icon-wrapper .mobile-menu-dropdown .dropdown-label {
    display: none !important;
  }

  /* Hide mobile menu chevron */
  #menu-icon-wrapper .mobile-menu-dropdown .custom-dropdown-trigger svg {
    display: none !important;
  }

  /* Make mobile menu trigger transparent and overlay the hamburger */
  #menu-icon-wrapper .mobile-menu-dropdown .custom-dropdown-trigger {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 40px !important;
    height: 40px !important;
    z-index: 100 !important;
    pointer-events: all !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  #menu-icon-wrapper .mobile-menu-dropdown .custom-dropdown-trigger:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    border-radius: 4px;
  }

  /* For country dropdown: hide text, keep only emoji */
  #sticky-header .header-dropdown .country-text {
    display: none !important;
  }

  #sticky-header .header-dropdown .country-emoji {
    font-size: 24px !important;
  }

  /* For language dropdown: show only short code, hide globe icon */
  #sticky-header .language-dropdown-wrapper .globe-icon {
    display: none !important;
  }

  #sticky-header .language-dropdown-wrapper .custom-dropdown .dropdown-label {
    display: block !important;
    font-size: 14px !important;
    font-weight: 500 !important;
  }

  /* Adjust header dropdown triggers to be more compact */
  #sticky-header .custom-dropdown-trigger {
    padding: 8px !important;
    min-width: auto !important;
    gap: 0 !important;
  }

  /* Keep the globe icon visible and larger */
  #sticky-header .language-dropdown-wrapper .globe-icon {
    display: block;
    font-size: 20px;
  }

  /* Hide chevron icons on mobile in header dropdowns */
  #sticky-header .custom-dropdown-trigger svg {
    display: none !important;
  }
}

/* Desktop: Show home icon, hide hamburger */
@media (min-width: 768px) {
  #home-icon-link {
    display: flex !important;
  }

  #hamburger-icon-visual {
    display: none !important;
  }

  /* Hide mobile menu dropdown on desktop */
  #menu-icon-wrapper .mobile-menu-dropdown {
    display: none !important;
  }
}

/* Form variant - full width */
.custom-dropdown.form-dropdown {
  width: 100%;
}

.custom-dropdown.form-dropdown .custom-dropdown-trigger {
  width: 100%;
  justify-content: space-between;
  padding: 12px 16px;
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  color: #333;
}

.custom-dropdown.form-dropdown .custom-dropdown-trigger:hover {
  border-color: #ccc;
  background: white;
}

.custom-dropdown.form-dropdown .custom-dropdown-menu {
  width: 100%;
  top: calc(100% + 8px);
}

/* Language dropdown with icon */
.language-dropdown-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.language-dropdown-wrapper .globe-icon {
  font-size: 16px;
  color: #1a1a1a;
}

/* Country code dropdown in hero form */
.custom-dropdown.country-code-dropdown {
  flex: 0 0 auto;
  width: auto;
  max-width: 120px;
}

.custom-dropdown.country-code-dropdown .custom-dropdown-trigger {
  height: 100%;
  min-height: 60px;
  border: none;
  border-radius: 0;
  padding: 0 24px 0 38px;
  font-size: 14px;
  justify-content: flex-start;
  white-space: nowrap;
  width: auto;
  gap: 6px;
}

.custom-dropdown.country-code-dropdown .custom-dropdown-trigger:hover {
  background: white;
}

.custom-dropdown.country-code-dropdown .custom-dropdown-menu {
  min-width: 160px;
  position: absolute;
  z-index: 9999;
}

.custom-dropdown.country-code-dropdown .custom-dropdown-trigger svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.custom-dropdown.country-code-dropdown .dropdown-label {
  white-space: nowrap;
  font-size: 13px;
}

/* Hero form dropdowns (service type & location) */
.custom-dropdown.hero-form-dropdown {
  flex: 1 1 auto;
  min-width: 140px;
  max-width: 220px;
}

.custom-dropdown.hero-form-dropdown .custom-dropdown-trigger {
  height: 100%;
  min-height: 60px;
  border: none;
  border-radius: 0;
  padding: 0 32px 0 38px;
  font-size: 14px;
  justify-content: space-between;
  color: #333;
  gap: 8px;
}

.custom-dropdown.hero-form-dropdown .custom-dropdown-trigger:hover {
  background: white;
}

.custom-dropdown.hero-form-dropdown .custom-dropdown-menu {
  width: 100%;
  min-width: 200px;
  max-height: 300px;
  overflow-y: auto;
  position: absolute;
  z-index: 9999;
}

.custom-dropdown.hero-form-dropdown .custom-dropdown-trigger svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.custom-dropdown.hero-form-dropdown .dropdown-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* First dropdown should have left border radius */
.custom-dropdown.hero-form-dropdown:first-of-type .custom-dropdown-trigger {
  border-radius: 10px 0 0 10px;
}
