/* Enhanced Service Dropdown - Brand Variables */

/* Main wrapper container */
.service-dropdown-wrapper {
  position: relative;
  width: 100%;
  z-index: 10;
}

/* Input container with icon */
.service-dropdown-input-container {
  position: relative;
  display: flex;
  align-items: center;
}

/* Main input field */
.service-dropdown-input {
  width: 100%;
  padding: 12px 16px 12px 12px;
  padding-right: 40px; /* Space for dropdown icon */
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.5;
  transition: all 0.15s ease;
  min-height: 48px;
  box-sizing: border-box;
}

.service-dropdown-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-10);
}

.service-dropdown-input::placeholder {
  color: var(--text-muted);
}

.service-dropdown-input.has-selection {
  background: var(--brand-primary-10);
  border-color: var(--brand-primary);
  font-weight: 500;
}

/* Dropdown toggle icon */
.service-dropdown-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1;
  padding: 4px;
  transition: transform 0.15s ease, color 0.15s ease;
  z-index: 1;
  pointer-events: auto;
}

.service-dropdown-wrapper.is-open .service-dropdown-icon {
  transform: translateY(-50%) rotate(180deg);
  color: var(--brand-primary);
}

/* Options container */
.service-dropdown-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg);
  border: 2px solid var(--brand-primary);
  border-top: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  z-index: 100;
  max-height: 320px;
  overflow-y: auto;
  margin-top: 2px;
}

.service-dropdown-wrapper.dropup .service-dropdown-options {
  bottom: 100%;
  top: auto;
  border-radius: 8px 8px 0 0;
  border-top: 2px solid var(--brand-primary);
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
  margin-top: 0;
}

/* Individual option */
.service-dropdown-option {
  padding: 12px 16px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.service-dropdown-option:last-child {
  border-bottom: none;
}

.service-dropdown-option:hover,
.service-dropdown-option.highlighted {
  background: var(--brand-primary-10);
  color: var(--brand-primary);
  transform: translateX(2px);
}

/* Service option content */
.service-option-content {
  width: 100%;
}

.service-option-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.service-option-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.service-option-label {
  flex: 1;
  font-weight: 500;
  font-size: 0.95rem;
}

.service-option-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-left: 28px;
  margin-top: 2px;
}

/* Popular badge */
.service-popular-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.4;
  border-radius: 12px;
  background: var(--brand-primary);
  color: white;
  margin-left: auto;
  flex-shrink: 0;
}

/* No results state */
.service-dropdown-no-results {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
}

.no-results-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.no-results-icon {
  font-size: 24px;
  opacity: 0.7;
}

/* Accessibility improvements */
.service-dropdown-wrapper:focus-within .service-dropdown-input {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-10);
}

/* Mobile optimizations */
@media (max-width: 640px) {
  .service-dropdown-input {
    padding: 10px 36px 10px 12px;
    font-size: 0.9rem;
    min-height: 44px;
  }
  
  .service-dropdown-option {
    padding: 10px 12px;
  }
  
  .service-dropdown-options {
    max-height: 280px;
  }
  
  .service-option-label {
    font-size: 0.9rem;
  }
  
  .service-option-description {
    font-size: 0.8rem;
    margin-left: 24px;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .service-dropdown-input {
    border-width: 3px;
  }
  
  .service-dropdown-options {
    border-width: 3px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .service-dropdown-input,
  .service-dropdown-icon,
  .service-dropdown-option {
    transition: none;
  }
}

/* Loading state */
.service-dropdown-wrapper.loading .service-dropdown-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border: 2px solid var(--border);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error state */
.service-dropdown-wrapper.error .service-dropdown-input {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* Z-index management */
#service-group {
  position: relative;
  z-index: 10;
}

.quote-form,
.form-step {
  overflow: visible;
}

/* Ensure proper stacking context */
.service-dropdown-wrapper {
  z-index: 10;
}

.service-dropdown-options {
  z-index: 100;
}

/* Custom scrollbar for options */
.service-dropdown-options {
  scrollbar-width: thin;
  scrollbar-color: var(--brand-primary) var(--bg);
}

.service-dropdown-options::-webkit-scrollbar {
  width: 6px;
}

.service-dropdown-options::-webkit-scrollbar-track {
  background: var(--bg);
}

.service-dropdown-options::-webkit-scrollbar-thumb {
  background-color: var(--brand-primary);
  border-radius: 3px;
}

.service-dropdown-options::-webkit-scrollbar-thumb:hover {
  background-color: var(--brand-primary-dark);
}
/* CLEAN4U-QUOTE-UX-POLISH: dropdown icon + panel refresh */
.service-dropdown-input-container {
  border-radius: var(--radius, 14px);
}

.service-dropdown-input {
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: var(--radius, 14px);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 13px 48px 13px 14px;
}

.service-dropdown-input:hover {
  border-color: color-mix(in srgb, var(--brand-primary) 45%, var(--border));
}

.service-dropdown-input:focus,
.service-dropdown-wrapper:focus-within .service-dropdown-input {
  border-color: var(--brand-primary);
  box-shadow: var(--focus-ring, 0 0 0 4px var(--brand-primary-10));
}

.service-dropdown-icon {
  right: 14px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--brand-primary-10);
  color: var(--brand-primary);
  font-size: 0;
}

.service-dropdown-icon svg,
.service-option-icon svg,
.no-results-icon svg {
  width: 1em;
  height: 1em;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.service-dropdown-icon svg {
  width: 16px;
  height: 16px;
}

.service-dropdown-options {
  border: 1px solid color-mix(in srgb, var(--brand-primary) 55%, var(--border));
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.18);
  margin-top: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(14px);
}

.service-dropdown-wrapper.dropup .service-dropdown-options {
  border: 1px solid color-mix(in srgb, var(--brand-primary) 55%, var(--border));
  border-radius: 18px;
  margin-bottom: 8px;
}

.service-dropdown-option {
  border: 0;
  border-radius: 14px;
  padding: 12px;
  background: transparent;
}

.service-dropdown-option + .service-dropdown-option {
  margin-top: 2px;
}

.service-dropdown-option:hover,
.service-dropdown-option.highlighted {
  background: var(--brand-primary-10);
  color: var(--text-primary);
  transform: none;
}

.service-option-header {
  gap: 10px;
}

.service-option-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--brand-primary-10);
  color: var(--brand-primary);
  font-size: 18px;
}

.service-option-label {
  font-weight: 700;
  color: var(--text-primary);
}

.service-option-description {
  margin-left: 44px;
}

.service-popular-badge {
  border: 1px solid color-mix(in srgb, var(--brand-primary) 35%, transparent);
  background: var(--brand-primary-10);
  color: var(--brand-primary);
  font-weight: 800;
}

.no-results-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--brand-primary-10);
  color: var(--brand-primary);
  font-size: 22px;
}