.select_options,
.select_options_marka,
.select_options_price {
  top: calc(100% + 12px);
}

.select_options.opacity-0,
.select_options_marka.opacity-0 {
  pointer-events: none;
}
.select_options,
.select_options_marka {
  pointer-events: auto;
}

.select_options_marka {
  padding: 20px 25px;
  grid-gap: 21px;
  display: -ms-grid;
  max-height: 440px;
  margin-right: -18px;
  /*overflow-y: auto;*/
  /*overflow-x: hidden;*/
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px 40px;
}
.select_options_marka img {
  max-height: 30px;
  filter: grayscale(100%);
  object-fit: contain;
}
.marka_item {
  display: -ms-grid;
  display: grid;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -ms-grid-columns: 1fr 15px auto;
  grid-gap: 10px;
  margin: 0;
  cursor: pointer;
  height: 24px;
  align-content: center;
  grid-template-columns: 23px auto 1fr;
}
.select_options::before,
.select_options_marka::before,
.select_options_price::before {
  content: "";
  display: block;
  position: absolute;
  left: 23px;
  bottom: 100%;
  width: 0;
  height: 0;
  border: 0 solid transparent;
  border-right-width: 23px;
  border-left-width: 23px;
  border-bottom: 6px solid #303030;
}
.marka_item span:nth-of-type(1) {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  line-height: 1;
  flex-grow: 1;
  transition: all 0.5s;
  letter-spacing: 1px;
  text-wrap-mode: nowrap;
}
.from_price::before {
  content: attr(data-suffix);
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  z-index: 2;
}
.from_price::after {
  content: attr(data-prefix);
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  z-index: 2;
}
.mosnost_wrapper .from_price::after,
.mosnost_wrapper .to_price::after {
  content: attr(data-prefix-mosnost) !important;
}
.to_price::before {
  content: attr(data-suffix);
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  z-index: 2;
}
.to_price::after {
  content: attr(data-prefix);
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  z-index: 2;
}
.price_search {
  letter-spacing: 3px;
}

/* Hide default range styling */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  position: absolute;
  background: transparent;
  pointer-events: none;
  z-index: 2;
  bottom: -10px;
}

/* Custom track (hidden default) */
input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
}

/* Custom thumb styling (Centered) */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  background: white;
  border: 3px solid white;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 3;
  transform: translateY(-40%);
}

input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  background: white;
  border: 3px solid white;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  z-index: 3;
  transform: translateY(-20%);
}

/* Centering the range input itself */
.slider-container {
  position: relative;
  height: 2px; /* Adjust height to fit thumb */
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type="number"] {
  -moz-appearance: textfield;
}
.class_btn.active,
.marka_btn.active,
.price_btn.active {
  border-color: #fff;
}

.advanced_search_btn.active {
  border-color: #fff;
}

/* Advanced filter option buttons (drive/engine, etc.) */
.privod_wrapper button.active,
.dviqatelya_wrapper button.active {
  border-color: #fff;
  color: #fff;
}

/* Advanced filters counter badge */
.advanced_filter_counter {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  color: #141414;
  font-size: 12px;
  line-height: 1;
}
.advanced_filter_counter.active {
  display: inline-flex;
}

/* advanced search */
.input-btns {
  display: flex;
  gap: 10px;
  align-items: center;
  align-content: flex-start;
  justify-content: flex-start;
  max-width: 100%;
  flex-wrap: wrap;
}
._new-filter {
  width: 100%;
}
._new-filter .select__options._grid .select__options > .input-btns {
  height: 100%;
  max-width: 100%;
}
label {
  display: inline-block;
  margin-bottom: 0.5rem;
}
label {
  color: #fff;
  font-size: 18px;
  margin-bottom: 10px;
  margin-top: 15px;
  font-weight: 300;
}
.input-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  border-radius: 5px;
  border: 1px solid #3c3c3c;
  font-size: 18px;
  line-height: 20px;
  padding: 10px 5px;
  text-align: center;
  transition: all 0.5s;
  color: #bbb;
  margin: 0;
  cursor: pointer;
  position: relative;
}
.input-btn:hover {
    border-color: #fff;
}
.input-btn:has(img) {
  justify-content: flex-start;
}
.input-btn:has(input:checked) {
  border-color: #fff;
  color: #fff;
}
.input-btn.active {
  border-color: #fff;
  color: #fff;
}
.input-btn__img {
  width: 34px;
  height: 20px;
  object-fit: contain;
}
.section img {
  max-width: 100%;
}
.input-btn__img.large {
  width: 52px;
  height: 22px;
}
._new-filter .select._choosed img {
  margin: -1px 0;
}
._new-filter-overlay {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: #000000b3;
    transition: all .3s ease-in-out;
    z-index: 19;
}
.input-btn input {
  display: none;
}
.input-btns .input-btn {
  padding: 10px 15px;
  width: 48%;
  font-size: 16px;
}
.marka_wrap_box .input-btn {
  width: 24%;
}


/*sort filter*/
.select._sort .select__main{
    min-height: 45px !important;
    width: 40px;
    display: flex;
    align-items: center;
}

@supports (-webkit-hyphens: none) {
  .select._sort .select__main {
    min-width: -webkit-max-content;
    min-width: max-content;
    width: -webkit-fit-content !important;
    width: fit-content !important;
  }
}

.select__main {
    display: flex;
    flex-flow: row nowrap;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 16;
    overflow: hidden;
    border: 1px solid transparent;
    background: #232323;
    cursor: pointer;
    -webkit-transition: all .5s;
    -o-transition: all .5s;
    transition: all .5s;
    padding: 6px 20px;
    min-height: 35px;
    border-radius: 5px;
    min-width: max-content;
    flex-grow: 1;
    white-space: nowrap;
    background: 0 0;
    border: none;
    padding: 0;
    align-items: flex-end;
}
.select__value {
    display: flex;
    gap: 10px;
    flex-flow: row nowrap;
    justify-content: center;
    align-items: center;
    font-size: 17px;
    line-height: 23px;
    flex-grow: 1;
    position: relative;
}
.select__value>span {
    border-bottom: 1px dashed #fff;
    color: #fff;
    font-weight: 100;
}
.select__input {
    display: none !important;
}
.select__options {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    min-width: 100%;
    flex-direction: column;
    background: #1f1f1f;
    box-shadow: 0 0 10px 8px rgba(0, 0, 0, .4);
    transition: all .25s;
    border-radius: 5px;
    padding: 20px 25px;
    display: none;
    z-index: 15;
    border-top: none;
    width: max-content;
    left: 0;
    padding: 15px 30px 20px 34px;
    min-width: 100% !important;
}
.checkbox-list {
    grid-gap: 21px;
    display: -ms-grid;
    max-height: 440px;
    padding: 0 18px 5px 0;
    margin-right: -18px;
    display: grid;
    margin: 0;
    padding: 0;
}
.checkbox {
    color: #fff;
    font-size: 18px;
    margin-bottom: 10px;
    margin-top: 15px;
    font-weight: 300;
    display: -ms-grid;
    display: grid;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -ms-grid-columns: 1fr 15px auto;
    grid-template-columns: 1fr auto;
    grid-gap: 10px;
    margin: 0;
    cursor: pointer;
    height: 24px;
    align-content: center;
    grid-template-columns: 1fr;
}
.checkbox__input {
    display: none;
}
.select__value::after {
    content: '';
    display: block;
    width: 11px;
    height: 11px;
    background: url(/img/arrow.svg) no-repeat center;
    background-size: cover;
    transform-origin: 50% 66%;
    transition: transform .25s;
    margin-left: auto;
    margin-left: 4px;
}
._new-filter .select._active .select__options {
        display: flex;
}
.select._sort {
    position: relative;
}
.select__options {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    min-width: 100%;
    flex-direction: column;
    background: #1f1f1f;
    box-shadow: 0 0 10px 8px rgba(0, 0, 0, .4);
    transition: all .25s;
    border-radius: 5px;
    padding: 20px 25px;
    display: none;
    z-index: 15;
    border-top: none;
    width: max-content;
    left: 0;
    padding: 15px 30px 20px 34px;
    min-width: 100% !important;
}
/* Safari sort dropdown overflow fix */
.select._sort.select--sort {
  position: relative;
  max-width: 100%;
}

.select._sort.select--sort .select__options {
  left: auto !important;
  right: 0 !important;
  width: auto !important;
  min-width: max-content !important;
  max-width: calc(100vw - 24px) !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

.select._sort.select--sort._active .select__options {
  display: flex !important;
  left: auto !important;
  right: 0 !important;
}
.checkbox__label {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    font-size: 18px;
    line-height: 1;
    flex-grow: 1;
    color: #bbb;
    transition: all .3s ease-in-out;
    letter-spacing: 1px;
}
.select__options .checkbox__input:checked~.checkbox__label {
    color: #fff;
}
.price_button.active {
    background: #fff;
    color: black;
}

.loader_wrapper .loader svg path,
.loader_wrapper .loader svg rect{
  fill: #FF6700;
}
.advanced_filter_wrapper {
    width: calc(100% - 50px);
}

/* ================================
   FULL MOBILE RESPONSIVE FILTER CSS
   Add this at the END of your CSS
================================ */

/* Tablet + Mobile */
@media (max-width: 991px) {
  html,
  body {
    overflow-x: hidden;
  }

  /* Main filter container */
  section .container.relative.z-\[20\] {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    z-index: 9991 !important;
  }

    .adv_arrow_btm,
    .adv_filter_title,
    .select__value::after,
    .checked_value{
        display: none;
    }
    
#more_filter_button {
    order: 1;
}
.select._sort {
    order: 2;
}
#all_cars {
    order: 3;
}
#class_filter_sections {
    order: 4;
}
#marka_filter_sections {
    order: 5;
}
#price_filter_sections {
    order: 6;
}

  section .container.relative.z-\[20\] .relative,
  .first_price_filter {
    width: 100% !important;
  }

  /* All main filter buttons */
  #all_cars,
  .class_btn,
  .marka_btn,
  .price_btn,
  .advanced_search_btn {
    width: 100% !important;
    min-height: 42px !important;
    padding: 10px 12px !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    white-space: nowrap !important;
    border-radius: 8px !important;
  }

  .class_btn span,
  .marka_btn span,
  .price_btn span,
  .advanced_search_btn span {
    min-width: 0;
  }

  .advanced_filter_counter,
  #class_counter,
  #marka_counter {
    min-width: 20px !important;
    width: 20px !important;
    height: 20px !important;
    flex: 0 0 20px !important;
    font-size: 12px !important;
  }



  /* Overlay */
  ._new-filter-overlay {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9990 !important;
    background: rgba(0, 0, 0, 0.72) !important;
  }

  /* Hidden state protection */
  .select_options.opacity-0,
  .select_options_marka.opacity-0 {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .select_options:not(.opacity-0),
  .select_options_marka:not(.opacity-0) {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .select_options_price.hidden,
  .advanced_filter_wrapper.hidden {
    display: none !important;
  }

  /* All opened dropdowns / panels centered on screen */
  .select_options,
  .select_options_marka,
  .select_options_price,
  .advanced_filter_wrapper,
  .select._sort.select--sort._active .select__options {
    position: fixed !important;
    left: 50% !important;
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
    width: min(94vw, 560px) !important;
    max-width: calc(100vw - 24px) !important;
    max-height: 78vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    z-index: 10000 !important;
    background: #303030 !important;
    border-radius: 14px !important;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55) !important;
  }

  /* Remove desktop dropdown arrows */
  .select_options::before,
  .select_options_marka::before,
  .select_options_price::before,
  .select__options::before {
    display: none !important;
  }

  /* Close button inside all panels */
  .close_filter {
    position: sticky !important;
    top: 0 !important;
    right: 0 !important;
    margin-left: auto !important;
    transform: none !important;
    z-index: 10002 !important;
  }

  .select_options .close_filter,
  .select_options_marka .close_filter,
  .select_options_price .close_filter,
  .advanced_filter_wrapper .close_filter {
    position: sticky !important;
    top: 8px !important;
    right: 8px !important;
    float: right !important;
  }

  /* Class dropdown */
  .select_options {
    padding: 16px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  .class_item {
    width: 100% !important;
    min-height: 42px !important;
    padding: 8px 36px 8px 8px !important;
    font-size: 22px !important;
    gap: 10px !important;
    border-radius: 8px !important;
  }

  .class_item img {
    width: 34px !important;
    height: 34px !important;
    object-fit: contain !important;
    flex: 0 0 34px !important;
  }

  .class_item span {
    min-width: 0 !important;
  }

  .class_item .checker {
    flex: 0 0 18px !important;
  }

  /* Marka dropdown */
  .select_options_marka {
    padding: 18px 16px !important;
    margin-right: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px 14px !important;
  }

  .marka_item {
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 40px !important;
    display: grid !important;
    grid-template-columns: 30px minmax(0, 1fr) 18px !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 6px 4px !important;
    border-radius: 8px !important;
  }

  .marka_item img {
    width: 30px !important;
    height: 30px !important;
    max-height: 30px !important;
    object-fit: contain !important;
  }

  .marka_title {
    display: block !important;
    min-width: 0 !important;
    max-width: 100% !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .marka_item .checker {
    justify-self: end !important;
  }

  /* Price dropdown */
  .select_options_price {
    padding: 18px 16px 20px !important;
  }

  .select_options_price > .flex.items-center.gap-3.flex-wrap {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    margin-bottom: 14px !important;
  }

  .price_button {
    width: 100% !important;
    min-height: 38px !important;
    padding: 8px 10px !important;
    font-size: 13px !important;
    text-align: center !important;
    border-radius: 8px !important;
  }
  .select_options_price .close_filter {
      margin-bottom: 15px;
  }

  .select_options_price .flex.items-center.gap-4,
  .select_options_price .flex.items-center.gap-3 {
    width: 100% !important;
  }

  .from_price,
  .to_price {
    width: 100% !important;
    min-width: 0 !important;
  }

  .from_price input,
  .to_price input,
  #minValue,
  #maxValue,
  #advancedMinValue,
  #advancedMaxValue,
  #mosnostMinValue,
  #mosnostMaxValue,
  #engineVolumeMin,
  #engineVolumeMax {
    width: 100% !important;
    min-height: 42px !important;
    font-size: 14px !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
  }
  
  #all_filter_sections_wrapper {
    overflow-x: auto !important;
    /*overflow-y: auto !important;*/
    /*-webkit-overflow-scrolling: touch;*/
    /*overscroll-behavior-x: contain;*/
    /*scrollbar-width: none !important;*/
  }

  .slider-container {
    width: 100% !important;
    margin-top: 18px !important;
  }

  /* Sort */
  .advanced_search_btn {
      min-width: 40px !important;
      padding: 5px !important;
      border-radius: 5px !important;
  }
  .textin {
      width: 75% !important;
  }
  .advanced_search_btn:has(.advanced_filter_counter.active) {
      min-width: 90px !important;
  }
  #all_filter_sections_wrapper button {
    border-radius: 5px !important;
    font-size: 13px !important;
    min-height: 45px !important;
  }
  

  .select__main {
    width: 100% !important;
    justify-content: center !important;
    padding: 5px !important;
    border-radius: 5px !important;
    background: #303030 !important;
  }

  .select__value {
    width: 100% !important;
    justify-content: center !important;
    font-size: 18px !important;
  }

  .select._sort.select--sort._active .select__options {
    display: flex !important;
    flex-direction: column !important;
    width: min(92vw, 360px) !important;
    padding: 18px 16px !important;
    background: #303030 !important;
  }

  .checkbox-list {
    width: 100% !important;
    display: grid !important;
    gap: 12px !important;
  }

  .checkbox {
    width: 100% !important;
    min-height: 36px !important;
    margin: 0 !important;
  }

  .checkbox__label {
    width: 100% !important;
    font-size: 22px !important;
    line-height: 1.25 !important;
  }
  .select__options .close_filter {
      margin-bottom: -35px;
  }

  /* Advanced filter main panel */
  .advanced_filter_wrapper {
    width: min(94vw, 720px) !important;
    padding: 18px 14px 20px !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 30px !important;
  }

  .advanced_filter_wrapper > div {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    padding: 0px !important;
    box-sizing: border-box !important;
  }

  .advanced_filter_wrapper > div.close_filter {
        width: fit-content !important;
        height: 40px !important;
        padding: 10px !important;
        margin-bottom: -20px !important;
        align-self: flex-end !important
  }
  .close_filter {
      width: 40px !important;
    height: 40px !important;
  }
  .select_options_marka .close_filter,
  .select_classes .close_filter{
      margin-bottom: -40px !important;
  }

  .advanced_filter_wrapper span.text-\[18px\],
  .advanced_filter_wrapper > div > span {
    display: block !important;
    line-height: 1.25 !important;
    margin-bottom: 12px !important;
  }

  /* Advanced class/brand buttons */
  .input-btns {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .input-btns .input-btn,
  .marka_wrap_box .input-btn {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 42px !important;
    padding: 10px 12px !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    justify-content: flex-start !important;
    border-radius: 8px !important;
  }

  .input-btn__img {
    width: 28px !important;
    height: 22px !important;
    object-fit: contain !important;
    flex: 0 0 28px !important;
  }

  .input-btn__img.large {
    display: none;
  }

  .input-btn__text {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  /* Advanced price/power inputs */
  .advanced_price_wrapper > .flex,
  .advanced_price_inputs,
  .mosnost_inputs,
  .engine_volume_inputs {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    align-items: stretch !important;
  }

  .advanced_price_wrapper > .flex:first-child {
    grid-template-columns: 1fr !important;
  }

  .advanced_price_wrapper > .flex:first-child .flex {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  /* Drive buttons */
  .privod_wrapper > .flex {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .privod_wrapper button {
    width: 100% !important;
    min-height: 42px !important;
    padding: 10px 8px !important;
    font-size: 13px !important;
    border-radius: 8px !important;
  }

  /* Engine type buttons */
  .dviqatelya_buttons {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .dviqatelya_buttons button {
    width: 100% !important;
    min-height: 42px !important;
    padding: 10px 8px !important;
    font-size: 13px !important;
    border-radius: 8px !important;
  }

  /* Available today block */
  .daily_empty_autos label {
    width: 100% !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px !important;
    font-size: 14px !important;
    line-height: 1.35 !important;
    margin: 0 !important;
  }

  .daily_empty_autos input[type="checkbox"] {
    flex: 0 0 auto !important;
    margin-top: 3px !important;
  }

  /* Advanced submit / clear buttons */
  .advanced_filter_wrapper > div:last-child {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    align-items: stretch !important;
  }

  #search_advc_btn,
  #clear_all_button_items {
    width: 100% !important;
    margin-left: 0 !important;
    min-height: 44px !important;
    padding: 12px 10px !important;
    font-size: 13px !important;
    border-radius: 8px !important;
  }

  /* Range thumbs easier for mobile */
  input[type="range"]::-webkit-slider-thumb {
    width: 18px !important;
    height: 18px !important;
  }

  input[type="range"]::-moz-range-thumb {
    width: 18px !important;
    height: 18px !important;
  }
  .cars-list-auto-park {
      margin-top: 80px;
  }
  .box_in  {
      position: absolute;
      bottom: -55px;
      left: 10px;
      right: 10px;
      overflow: visible;
      width: 95%;
  }
  #search_button_car {
      border-radius: 5px !important;
      font-size: 13px !important;
      width: 120px;
  }
  
  .select_options_price .to_price,
  .select_options_price .from_price{
      width: 49% !important;
  }
}

/* Small phones */
@media (max-width: 575px) {
  section .container.relative.z-\[20\] {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .select_options,
  .select_options_marka,
  .select_options_price,
  .advanced_filter_wrapper,
  .select._sort.select--sort._active .select__options {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    max-height: 82vh !important;
    border-radius: 12px !important;
  }

  .select_options_marka {
    grid-template-columns: 1fr !important;
  }

  .advanced_filter_wrapper > div:last-child {
    grid-template-columns: 1fr !important;
  }

  .class_item,
  .marka_item,
  .input-btns .input-btn,
  .marka_wrap_box .input-btn,
  .privod_wrapper button,
  .dviqatelya_buttons button {
    min-height: 44px !important;
  }

  .from_price input,
  .to_price input,
  #minValue,
  #maxValue,
  #advancedMinValue,
  #advancedMaxValue,
  #mosnostMinValue,
  #mosnostMaxValue,
  #engineVolumeMin,
  #engineVolumeMax {
    min-height: 44px !important;
  }
}

/* Very small phones */
@media (max-width: 380px) {
  .class_btn,
  .marka_btn,
  .price_btn,
  .advanced_search_btn,
  #all_cars,
  .bbcodes {
    font-size: 18px !important;
  }

  .select_options,
  .select_options_marka,
  .select_options_price,
  .advanced_filter_wrapper {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .marka_title,
  .input-btn__text {
    font-size: 18px !important;
  }
}


/* Mobile hover fix for .input-btn group */
@media (hover: none), (pointer: coarse) {
  .input-btn:hover {
    border-color: #3c3c3c !important;
    color: #bbb !important;
  }

  .input-btn.active,
  .input-btn:has(input:checked) {
    border-color: #fff !important;
    color: #fff !important;
    border-width: 2px;
  }

  .input-btn > div.absolute {
    pointer-events: none !important;
    transform: translate(-50%, -50%) scale(0) !important;
  }

  .input-btn.active > div.absolute:nth-of-type(1),
  .input-btn:has(input:checked) > div.absolute:nth-of-type(1) {
    transform: translate(-50%, -50%) scale(1.05) !important;
  }

  .input-btn.active > div.absolute:nth-of-type(2),
  .input-btn:has(input:checked) > div.absolute:nth-of-type(2) {
    transform: translate(-50%, -50%) scale(1.1) !important;
  }

  .input-btn:not(.active):not(:has(input:checked)) > div.absolute {
    transform: translate(-50%, -50%) scale(0) !important;
  }
}





/* ================================
   Safari / iOS Safari compatibility fixes
   Add-on block: safe to keep at the END of CSS
================================ */

/* Prevent iOS Safari text auto-resizing and unwanted horizontal jumps */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  max-width: 100%;
}

/* Safari fallback for non-standard text-wrap-mode */
.marka_item span:nth-of-type(1),
.marka_title,
.input-btn__text,
.select__value,
.class_btn span,
.marka_btn span,
.price_btn span,
.advanced_search_btn span {
  white-space: nowrap;
}

/* Safari prefix for image filters */
.select_options_marka img,
.input-btn__img,
.class_item img,
.marka_item img {
  -webkit-filter: grayscale(100%);
}

/* Safari-safe intrinsic sizing on desktop */
@media (min-width: 992px) {
  .select._sort .select__main {
    min-width: -webkit-max-content;
    min-width: max-content;
    max-width: fit-content;
  }

  .select__options {
    width: -webkit-max-content;
    width: max-content;
  }
}

/* Form controls: iOS Safari default rounded/inner styling fix */
button,
input[type="button"],
input[type="submit"],
input[type="reset"],
input[type="text"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="email"] {
  -webkit-appearance: none;
  appearance: none;
}

button,
.input-btn,
.class_btn,
.marka_btn,
.price_btn,
.advanced_search_btn,
.price_button,
#search_advc_btn,
#clear_all_button_items,
#search_button_car {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Range input fixes for Safari: keeps thumb centered and draggable */
input[type="range"] {
  -webkit-appearance: none !important;
  appearance: none !important;
  height: 18px;
  padding: 0;
  border: 0;
  outline: 0;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: transparent;
  border: 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  appearance: none !important;
  margin-top: -6.5px !important;
  -webkit-transform: none !important;
  transform: none !important;
}

/* Number input arrows: extra Safari/iOS protection */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Fixed modal panels in iOS Safari: dynamic viewport, smooth scroll and GPU-safe transform */
@media (max-width: 991px) {
  ._new-filter-overlay {
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    min-height: 100vh !important;
    min-height: -webkit-fill-available !important;
  }

  .select_options,
  .select_options_marka,
  .select_options_price,
  .advanced_filter_wrapper,
  .select._sort.select--sort._active .select__options {
    width: 94vw !important;
    max-width: calc(100vw - 24px) !important;
    max-height: 78vh !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain;
    -webkit-transform: translate3d(-50%, -50%, 0) !important;
    transform: translate3d(-50%, -50%, 0) !important;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }

  @supports (height: 100dvh) {
    ._new-filter-overlay {
      min-height: 100dvh !important;
      height: 100dvh !important;
    }

    .select_options,
    .select_options_marka,
    .select_options_price,
    .advanced_filter_wrapper,
    .select._sort.select--sort._active .select__options {
      max-height: 78dvh !important;
    }
  }

  @supports (width: min(94vw, 560px)) {
    .select_options,
    .select_options_marka,
    .select_options_price,
    .advanced_filter_wrapper {
      width: min(94vw, 560px) !important;
    }

    .select._sort.select--sort._active .select__options {
      width: min(92vw, 360px) !important;
    }

    .advanced_filter_wrapper {
      width: min(94vw, 720px) !important;
    }
  }

  .close_filter,
  .select_options .close_filter,
  .select_options_marka .close_filter,
  .select_options_price .close_filter,
  .advanced_filter_wrapper .close_filter {
    position: -webkit-sticky !important;
    position: sticky !important;
  }

  /* Prevent iOS Safari zoom on focus: keep inputs at least 16px */
  .from_price input,
  .to_price input,
  #minValue,
  #maxValue,
  #advancedMinValue,
  #advancedMaxValue,
  #mosnostMinValue,
  #mosnostMaxValue,
  #engineVolumeMin,
  #engineVolumeMax {
    font-size: 16px !important;
  }

  input[type="range"]::-webkit-slider-thumb {
    margin-top: -8px !important;
  }

  .slider-container {
    min-height: 18px;
  }
}

@media (max-width: 575px) {
  .select_options,
  .select_options_marka,
  .select_options_price,
  .advanced_filter_wrapper,
  .select._sort.select--sort._active .select__options {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    max-height: 82vh !important;
  }

  @supports (height: 100dvh) {
    .select_options,
    .select_options_marka,
    .select_options_price,
    .advanced_filter_wrapper,
    .select._sort.select--sort._active .select__options {
      max-height: 82dvh !important;
    }
  }
}

/* Safari < 15.4 does not support :has().
   CSS cannot select a parent from a checked child there, so keep/add .active or .is-checked from JS. */
@supports not selector(.input-btn:has(input:checked)) {
  .input-btn.active,
  .input-btn.is-checked,
  .input-btn[aria-pressed="true"] {
    border-color: #fff !important;
    color: #fff !important;
  }

  .input-btn.active > div.absolute:nth-of-type(1),
  .input-btn.is-checked > div.absolute:nth-of-type(1),
  .input-btn[aria-pressed="true"] > div.absolute:nth-of-type(1) {
    -webkit-transform: translate(-50%, -50%) scale(1.05) !important;
    transform: translate(-50%, -50%) scale(1.05) !important;
  }

  .input-btn.active > div.absolute:nth-of-type(2),
  .input-btn.is-checked > div.absolute:nth-of-type(2),
  .input-btn[aria-pressed="true"] > div.absolute:nth-of-type(2) {
    -webkit-transform: translate(-50%, -50%) scale(1.1) !important;
    transform: translate(-50%, -50%) scale(1.1) !important;
  }
}