/* ============================================================
   VPS Configurator — noUiSlider styling + country dropdown
   ============================================================ */

/* ---- noUiSlider base (subset of v15.6 stylesheet, custom-skinned) ---- */
.noUi-target,
.noUi-target * {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -ms-touch-action: none;
  touch-action: none;
  box-sizing: border-box;
}
.noUi-target {
  position: relative;
}
.noUi-base,
.noUi-connects {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}
.noUi-connects {
  overflow: hidden;
  z-index: 0;
  border-radius: 9999px;
}
.noUi-connect,
.noUi-origin {
  will-change: transform;
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  height: 100%;
  width: 100%;
  -ms-transform-origin: 0 0;
  -webkit-transform-origin: 0 0;
  transform-origin: 0 0;
}
.noUi-horizontal .noUi-origin { height: 0; }
.noUi-handle {
  position: absolute;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.noUi-touch-area { height: 100%; width: 100%; }

/* ---- Custom skin (Figma: thin track, primary fill, white knob with primary border) ---- */
#range-cores-slider,
#range-ram-slider,
#range-disk-slider {
  height: 6px;
  background: #e7e7e7;
  border-radius: 9999px;
  border: 0;
  box-shadow: none;
  margin-block: 14px;   /* room for the handle ↑↓ */
  margin-inline: 8px;   /* room for the handle ← → so it doesn't overflow at min/max */
}
#range-cores-slider .noUi-connects,
#range-ram-slider .noUi-connects,
#range-disk-slider .noUi-connects {
  background: transparent;
}
#range-cores-slider .noui-connect-progress,
#range-ram-slider .noui-connect-progress,
#range-disk-slider .noui-connect-progress {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  background: #20f796;
  border-radius: 9999px;
  pointer-events: none;
}
.noUi-handle {
  width: 16px !important;
  height: 16px !important;
  top: -5px !important;
  right: -8px !important; /* center 16px handle on origin */
  border-radius: 9999px;
  background: #ffffff;
  border: 2px solid #20f796;
  box-shadow: 0 1px 4px rgba(30, 32, 61, .15);
  cursor: grab;
}
.noUi-handle:focus { outline: none; }
.noUi-handle.noUi-active { cursor: grabbing; box-shadow: 0 0 0 6px rgba(32, 247, 150, .15); }
.noUi-handle::before,
.noUi-handle::after { display: none; }

/* ---- Country dropdown visibility (avoid Tailwind `hidden`/`flex` clash) ---- */
.filter-dropdown-country__list {
  display: none;
  flex-direction: column;
}
.filter-dropdown-country__list.filter-dropdown-country__list--visible {
  display: flex;
}
.filter-dropdown-country__item--hidden { display: none; }
.filter-dropdown-country__item--selected { background: #e7e7e7; }
.filter-dropdown-country__list--not-found::before {
  content: attr(data-text-not-found);
  display: block;
  padding: 8px 12px;
  color: #888;
  font-size: 14px;
}

/* ---- OS tile peer-checked styling ---- */
.config-os__label:has(.config-os__radio:checked) {
  background: #ffffff;
  border-color: #20f796;
}

/* ---- OS tile version dropdown (toggled by JS via `.open` class) ---- */
.config-os__dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 12px;   /* aligns with text column inside the tile */
  right: 12px;
  z-index: 30;
  margin-top: 4px;
  background: #ffffff;
  border: 1px solid #b0b0b0;
  border-radius: 10px;
  padding: 4px;
  box-shadow: 0 8px 24px rgba(30, 32, 61, .12);
  flex-direction: column;
  gap: 2px;
}
.config-os__dropdown.open { display: flex; }

.config-os__dropdown-button {
  text-align: left;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 20px;
  font-family: 'Ki', 'Manrope', system-ui;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #1e203d;
  cursor: pointer;
  white-space: nowrap;
}
.config-os__dropdown-button:hover { background: #f3f3f3; }
.config-os__dropdown-button.active {
  background: rgba(32, 247, 150, .15);
  color: #00351f;
  font-weight: 500;
}

/* Rotate the chevron when dropdown is open */
.config-os__button-change svg { transition: transform .2s; }
.config-os__button-change.open svg { transform: rotate(180deg); }
