/* Карточка СТО в списке */
.sto-card {
  --sto-card-red: #f93f20;
  --sto-card-green: #24c64d;
  --sto-card-blue: #2563c9;
  --sto-card-star: #ffb400;
  --sto-card-text: #1c1c1e;
  --sto-card-muted: #8e8e93;
  --sto-card-line: #e5e5ea;
  --sto-card-chip: #f2f2f7;
  --sto-card-radius: 12px;

  display: flex;
  align-items: stretch;
  background: #fff;
  border: 1px solid var(--sto-card-line);
  border-radius: var(--sto-card-radius);
  box-shadow: 0 2px 10px rgba(28, 28, 30, 0.08);
  overflow: hidden;
  margin: 0 0 12px;
  min-width: 0;
}

.sto-card__media {
  position: relative;
  flex: 0 0 248px;
  width: 248px;
  align-self: stretch;
  min-height: 200px;
  background: var(--sto-card-chip);
  overflow: hidden;
}

.sto-card__media-link {
  display: block;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.sto-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sto-card__photos {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(28, 28, 30, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  pointer-events: none;
}

.sto-card__photos-icon {
  display: block;
  flex-shrink: 0;
}

.sto-card__body {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  padding: 14px 0 14px 16px;
}

.sto-card__main {
  flex: 1 1 auto;
  min-width: 0;
  padding-right: 16px;
}

.sto-card__title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 0 0 6px;
}

.sto-card__title {
  margin: 0;
  color: var(--sto-card-text);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.sto-card__title-link {
  color: inherit;
  text-decoration: none;
}

.sto-card__title-link:hover {
  color: var(--sto-card-red);
}

.sto-card__verified {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--sto-card-green);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.sto-card__verified-icon {
  display: block;
  flex-shrink: 0;
}

.sto-card__rating {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
  color: var(--sto-card-text);
  font-size: 13px;
  line-height: 1.2;
}

.sto-card__stars {
  display: inline-flex;
  gap: 2px;
}

.sto-card__star {
  width: 14px;
  height: 14px;
  background: url(src/img/star-gray.svg) no-repeat center / contain;
}

.sto-card__star.is-active {
  background-image: url(src/img/star-yellow.svg);
}

.sto-card__rating-value,
.sto-card__rating-sep,
.sto-card__rating-count {
  color: var(--sto-card-muted);
}

.sto-card__rating-value {
  font-weight: 600;
}

.sto-card__meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 14px;
}

.sto-card__address,
.sto-card__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  line-height: 1.4;
}

.sto-card__address {
  color: var(--sto-card-muted);
}

.sto-card__address-icon {
  display: block;
  flex-shrink: 0;
  opacity: 0.75;
}

.sto-card__status {
  font-weight: 600;
}

.sto-card__status--open {
  color: var(--sto-card-green);
}

.sto-card__status--closed {
  color: #ef7f1a;
}

.sto-card__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.sto-card__active-car {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--sto-card-text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.sto-card__active-car-badge {
  display: inline-flex;
  flex-shrink: 0;
  line-height: 0;
  color: var(--sto-card-blue);
}

.sto-card__active-car-badge-icon {
  display: block;
}

.sto-card__active-car-name {
  min-width: 0;
}

.sto-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.sto-card__chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--sto-card-chip);
  color: #3a3a3c;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}

.sto-card__chip.is-active {
  background: var(--sto-card-red);
  color: #fff;
}

.sto-card__chip--more {
  cursor: pointer;
  color: var(--sto-card-muted);
}

.sto-card__chip--more:hover {
  color: var(--sto-card-red);
}

.sto-card__services {
  min-width: 0;
}

.sto-card__services-label {
  margin: 0 0 10px;
  color: var(--sto-card-muted);
  font-size: 12px;
  line-height: 1.2;
}

.sto-card__services-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sto-card__service {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid #f0c4c0;
  border-radius: 6px;
  color: var(--sto-card-text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  background: #fff;
  white-space: nowrap;
}

.sto-card__service.is-active {
  border-color: var(--sto-card-red);
  background: var(--sto-card-red);
  color: #fff;
}

.sto-card__service-more {
  display: inline-flex;
  align-items: center;
  padding: 5px 4px;
  color: var(--sto-card-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}

.sto-card__service-more:hover {
  color: var(--sto-card-red);
}

/* Попап марок / работ */
.sto-card-popup {
  position: fixed;
  inset: 0;
  z-index: 10100;
  display: none;
}

.sto-card-popup.is-open {
  display: block;
}

.sto-card-popup__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.sto-card-popup__dialog {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  margin: 24px auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sto-card-popup--form {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sto-card-popup--form .sto-card-popup__dialog {
  overflow: visible;
  max-height: none;
  margin: 16px auto 24px;
}

.sto-card-popup__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--sto-card-line, #e5e5ea);
}

.sto-card-popup__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #1c1c1e;
  min-width: 0;
  word-break: break-word;
}

.sto-card-popup__close {
  flex-shrink: 0;
  box-sizing: border-box;
  width: 30px !important;
  min-width: 30px !important;
  max-width: 30px !important;
  height: 30px !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  font-size: 0 !important;
  font-weight: normal !important;
  border: 0 !important;
  border-radius: 50%;
  background: transparent !important;
  color: inherit !important;
  position: relative;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.sto-card-popup__close:active {
  background: transparent !important;
  color: inherit !important;
}

.sto-card-popup__close::before,
.sto-card-popup__close::after {
  content: '';
  position: absolute;
  left: 7px;
  right: 7px;
  top: 14px;
  border-top: 2px solid #333;
}

.sto-card-popup__close::before {
  transform: rotate(45deg);
}

.sto-card-popup__close::after {
  transform: rotate(-45deg);
}

.sto-card-popup__body {
  padding: 8px 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.sto-card-popup--form .sto-card-popup__body {
  overflow: visible;
}

.sto-card-popup__marks,
.sto-card-popup__group-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sto-card-popup__mark,
.sto-card-popup__service {
  display: block;
  padding: 10px 16px;
  border-bottom: 1px solid #f2f2f2;
  color: #1c1c1e;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

.sto-card-popup__mark:last-child,
.sto-card-popup__service:last-child {
  border-bottom: none;
}

.sto-card-popup__groups {
  margin: 0;
  padding: 0;
}

.sto-card-popup__group {
  border-bottom: 1px solid #f2f2f2;
}

.sto-card-popup__group:last-child {
  border-bottom: none;
}

.sto-card-popup__group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 12px 16px;
  color: #1c1c1e;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  user-select: none;
}

.sto-card-popup__group-title:hover {
  background: #f8f8f8;
}

.sto-card-popup__group-title::after {
  content: '';
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: -3px;
  border-right: 2px solid #8e8e93;
  border-bottom: 2px solid #8e8e93;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.sto-card-popup__group.is-open .sto-card-popup__group-title::after {
  margin-top: 3px;
  transform: rotate(-135deg);
}

.sto-card-popup__group-list {
  display: none;
  background: #fafafa;
}

.sto-card-popup__group.is-open .sto-card-popup__group-list {
  display: block;
}

.sto-card-popup__group-list .sto-card-popup__service {
  padding-left: 24px;
  font-weight: 400;
  color: #3a3a3c;
}

.sto-card-popup__empty {
  padding: 16px;
  color: #8e8e93;
  font-size: 14px;
}

.sto-card__aside {
  flex: 0 0 248px;
  width: 248px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border-left: 1px dashed var(--sto-card-line);
  box-sizing: border-box;
}

.sto-card__offer-name {
  margin: 0;
  color: var(--sto-card-text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}

.sto-card__price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  color: var(--sto-card-text);
  line-height: 1;
}

.sto-card__price-from {
  font-size: 13px;
  font-weight: 500;
}

.sto-card__price-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sto-card__price-currency {
  font-size: 16px;
  font-weight: 700;
}

.sto-card__duration {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--sto-card-muted);
  font-size: 12px;
  line-height: 1.2;
  margin: -2px 0 2px;
}

.sto-card__duration-icon {
  display: block;
  flex-shrink: 0;
  opacity: 0.8;
}

.sto-card__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.sto-card__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 8px;
  box-sizing: border-box;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: 0.15s ease background-color, 0.15s ease color, 0.15s ease border-color;
}

.sto-card__btn[hidden] {
  display: none !important;
}

.sto-card__btn--primary {
  border: 1px solid var(--sto-card-red);
  background: var(--sto-card-red);
  color: #fff;
}

.sto-card__btn--primary:hover {
  background: #e2361a;
  border-color: #e2361a;
  color: #fff;
}

.sto-card__btn--secondary {
  border: 1px solid var(--sto-card-red);
  background: #fff;
  color: var(--sto-card-red);
}

.sto-card__btn--secondary:hover {
  background: rgba(249, 63, 32, 0.06);
  color: var(--sto-card-red);
}

.sto-card__phone {
  width: 100%;
  margin-top: 8px;
  padding: 6px 0;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--sto-card-text);
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.sto-card__phone[hidden] {
  display: none !important;
}

.sto-card__phone a {
  color: inherit;
  text-decoration: none;
}

.sto-card__phone a:hover {
  color: var(--sto-card-red);
}

@media all and (max-width: 1123px) {
  .sto-card {
    flex-direction: column;
  }

  .sto-card__media {
    flex: none;
    width: 100%;
    height: 180px;
    min-height: 180px;
  }

  .sto-card__body {
    flex-direction: column;
    padding: 14px;
  }

  .sto-card__main {
    padding-right: 0;
  }

  .sto-card__aside {
    flex: none;
    width: 100%;
    padding: 14px 0 0;
    border-left: none;
    border-top: 1px dashed var(--sto-card-line);
  }

  .sto-card__actions {
    flex-direction: row;
  }

  .sto-card__btn {
    flex: 1 1 0;
  }
}

@media all and (max-width: 480px) {
  .sto-card__title {
    font-size: 16px;
  }

  .sto-card__price-value {
    font-size: 24px;
  }

  .sto-card__actions {
    flex-direction: column;
  }
}

.sto-card-popup--form .sto-card-popup__body {
  padding: 16px;
}

.sto-book-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sto-book-form__section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px;
  border: 1px solid #e5e5ea;
  border-radius: 10px;
  background: #fafafa;
}

.sto-book-form__section-title {
  font-size: 14px;
  font-weight: 700;
  color: #1c1c1e;
}

.sto-book-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sto-book-form__label {
  font-size: 13px;
  font-weight: 600;
  color: #3a3a3c;
}

.sto-book-form__required {
  color: var(--sto-card-red, #f93f20);
}

.sto-book-form__control {
  width: 100%;
  max-width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #d1d1d6;
  border-radius: 8px;
  box-sizing: border-box;
  font: inherit;
  font-size: 14px;
  color: #1c1c1e;
  background: #fff;
  cursor: text;
}

select.sto-book-form__control {
  display: block;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238e8e93' d='M1.4.3L6 4.9 10.6.3 12 1.7 6 7.7 0 1.7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  padding-right: 36px;
}

.sto-book-form__control[type="date"] {
  cursor: pointer;
  color-scheme: light;
}

.sto-book-form__control::placeholder {
  color: #8e8e93;
  opacity: 1;
}

.sto-book-form__control.is-placeholder {
  color: #8e8e93;
}

.sto-book-form__control:not(.is-placeholder) {
  color: #1c1c1e;
}

.sto-book-form__control:focus {
  outline: none;
  border-color: var(--sto-card-red, #f93f20);
  box-shadow: 0 0 0 3px rgba(249, 63, 32, 0.12);
}

.sto-book-form__control.is-invalid {
  border-color: #dc3545;
}

.sto-book-form__control--textarea {
  min-height: 90px;
  resize: vertical;
}

.sto-book-form__error {
  font-size: 12px;
  color: #dc3545;
}

.sto-book-form__message {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.35;
}

.sto-book-form__message.is-success {
  background: #e8f8ec;
  color: #1b7a36;
}

.sto-book-form__message.is-error {
  background: #fdecea;
  color: #b42318;
}

.sto-book-form__actions {
  margin-top: 4px;
}

.sto-book-form__submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--sto-card-red, #f93f20);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.sto-book-form__submit:hover {
  background: #e2361a;
}

.sto-book-form__submit:disabled {
  cursor: wait;
  opacity: 0.85;
}

.sto-book-form__spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: sto-book-spin 0.7s linear infinite;
}

.sto-book-form__submit.is-loading .sto-book-form__submit-text {
  visibility: hidden;
}

.sto-book-form__submit.is-loading .sto-book-form__spinner {
  display: block;
  position: absolute;
}

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