:root {
  --font-family: "Cygre-Bold", sans-serif;
  --primary-color: #407e5f;
  --selected-color: #56a47d;
  --text-color: #232323;
  --label-color: #6d747a;
  --border-color: #bdbdbd;
  --bg-color: #faf7fc;
}

form[id="tire-finder-form tire-filter"], form[id="car-finder-form"] {
  display: grid;
  gap: 20px;
  width: 100%;
}

.car-finder-form > .actions-row {
	grid-template-columns: 1fr !important;
}

.car-finder-form > .filter-row > .model-filter {
	margin-bottom: 0 !important;
}

/* Общие стили для фильтр-рядов */
.filter-row {
  display: grid;
  gap: 20px;
  width: 100%;
}

@media(min-width: 1024px){
	.actions-row {
		margin-top: -4px;
	}
	.mobile-only{
		display: none;
	}
}

.tire-finder-size-mode {
	margin-top: -20px;
}

.tire-finder-switch{
	display: flex;
	gap: 20px;
	margin-bottom: 20px;
	justify-content: center;
}

.switch-button {
	font-family: var(--font-family);
	font-weight: 700;
	font-size: 18px;
	letter-spacing: -0.04em;
	height: 60px;
	border-radius: 5px;
	width: 100%;
	cursor: pointer;
	background-color: #faf7fc;
	border: none;
	color: var(--label-color);
}

.switch-button.active {
	background: var(--primary-color);
	color: #faf7fc;
}

.switch-button:hover {
	background-color:;
	color:;
}

/* Стили для фильтр-блоков */
.filter-item {
  position: relative;
  height: 60px;
  border-radius: 5px;
  width: 100%;
  display: flex;
  align-items: center;
  padding: 0 19px;
  background-color: #faf7fc;
}

.filter-item label {
  position: absolute;
  left: 19px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.04em;
  color: var(--label-color);
  pointer-events: none;
  margin: 0;
}

.right-content {
  position: absolute;
  right: 19px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
}

.selected-value {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.04em;
  color: var(--text-color);
  margin: 0;
}

.filter-arrow {
  width: 8px;
  height: 6px;
  transition: transform 0.3s, fill 0.3s;
  flex-shrink: 0;
}

.filter-item.active .filter-arrow {
  transform: translateY(-50%) rotate(180deg);
  fill: var(--primary-color);
}

/* Стили для dropdown menu */
.dropdown-menu {
  position: absolute;
  top: 90%;
  right: 0;
  width: 100%;
  background: #faf7fc;
  border-radius: 0 0 5px 5px;
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  display: none;
}

.filter-item.active .dropdown-menu {
  display: block;
}

.dropdown-option {
  padding: 10px 19px;
  font-size: 18px;
  cursor: pointer;
  position: relative;
  line-height: 1.5;
}

.dropdown-option:hover,
.dropdown-option.selected {
  background-color: #cecece;
}

/* Стили для checkboxes сезонов */
.seasons-container,
.season-selector {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: center;
}

.season-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  cursor: pointer;
}

.season-checkbox-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.season-checkbox {
  display: none;
}

.season-icon {
  position: relative;
  width: 41px;
  height: 41px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.season-icon img {
  width: 100%;
  height: 100%;
  transition: opacity 0.3s;
}

.season-icon-active {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
}

.season-checkbox:checked ~ .season-icon .season-icon-default {
  opacity: 0;
}

.season-checkbox:checked ~ .season-icon .season-icon-active {
  opacity: 1;
}

.season-name {
  font-weight: 700;
  font-size: 13.6845px;
  line-height: 23px;
  letter-spacing: -0.04em;
  color: #6d747a;
  text-align: center;
}

/* Desktop стили */
@media (min-width: 1024px) {
  .seasons-container {
    justify-content: center;
  }
}

/* Mobile стили */
@media (max-width: 1023px) {
  .season-selector {
    justify-content: center;
    gap: 16px;
  }

  .season-icon {
    width: 36px;
    height: 36px;
  }

  .season-name {
    font-size: 12px;
  }
}

/* Стили для кнопки "Найти" */
.find-button {
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.04em;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  border-radius: 5px;
  width: 100%;
  height: 60px;
  background: none;
  cursor: pointer;
  transition: all 0.3s;
}

.find-button:hover {
  background-color: var(--primary-color);
  color: white;
}

body:not(.post-type-archive-product) .brand-row, body:not(.post-type-archive-product) .actions-row {
  order: 1;
}
body:is(.post-type-archive-product) .size-row {
  order: -1;
}

/* Desktop layout */
@media (min-width: 1025px) {
  .filter-row.size-row {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .filter-row.index-row {
    grid-template-columns: 1fr 1fr;
  }

  .filter-row.actions-row {
    grid-template-columns: 1fr 1fr;
  }

  .find-button {
    width: 100%;
  }
}

/* Mobile layout */
@media (max-width: 1024px) {
  .tire-filter {
    gap: 12px;
  }

  .filter-item,  .find-button, .switch-button {
    height: 48px;
  }

  .filter-item label,
  .selected-value,
  .dropdown-option {
    font-size: 14px;
  }

  .filter-item label {
    left: 20px;
  }

  .filter-arrow {
    right: 20px;
    width: 7px;
    height: 5px;
  }

  .filter-row.size-row {
    grid-template-columns: 1fr 1fr 1fr;
    /* order: -1; */
  }

  .filter-row.diameter-season-row {
    grid-template-columns: 1fr 1fr;
  }
  body:not(.post-type-archive-product) .brand-row, body:not(.post-type-archive-product) .actions-row {
    order: inherit;
  }
  .dropdown-option {
    padding: 8px 20px;
  }
}

@media(max-width: 480px) {
  .filter-row.size-row {
    grid-template-columns: 1fr;
  }
}
