.pm-tire-finder {
  --pm-border: #d7dee4;
  --pm-surface: #ffffff;
  --pm-surface-muted: #f7f9fa;
  --pm-text: #1d252c;
  --pm-muted: #65727d;
  --pm-accent: #c62032;
  --pm-accent-dark: #9f1625;
  --pm-focus: #275d9f;
  --pm-success: #1f7a49;

  box-sizing: border-box;
  width: 100%;
  color: var(--pm-text);
  background: var(--pm-surface);
  border: 1px solid var(--pm-border);
  border-radius: 8px;
  font-family: Arial, Helvetica, sans-serif;
  overflow: hidden;
}

.pm-tire-finder *,
.pm-tire-finder *::before,
.pm-tire-finder *::after {
  box-sizing: inherit;
}

.pm-tire-finder__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--pm-border);
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.95) 0, rgba(255, 255, 255, 0.95) 480px, rgba(255, 255, 255, 0) 560px),
    url('header.png');
  background-size: 100% 100%, cover;
  background-position: left top, center top;
  background-repeat: no-repeat, no-repeat;
}

.pm-tire-finder__title {
  margin: 0;
  color: #2b2b2b;
  font-size: 32px;
  font-weight: 900;
  line-height: 1.2;
  -webkit-text-stroke: 0.5px #2b2b2b;
}

.pm-tire-finder__subtitle {
  margin: 6px 0 0;
  color: #2b2b2b;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.45;
  -webkit-text-stroke: 0.5px #2b2b2b;
}

.pm-tire-finder__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-width: 92px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #c9d7ce;
  border-radius: 6px;
  color: var(--pm-success);
  background: #f3fbf6;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.pm-tire-finder__controls {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 12px;
  padding: 20px;
  background: var(--pm-surface-muted);
  border-right: 1px solid var(--pm-border);
}

.pm-tire-finder__field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}

.pm-tire-finder__label {
  color: #344550;
  font-size: 13px;
  font-weight: 700;
}

.pm-tire-finder__input,
.pm-tire-finder__select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--pm-border);
  border-radius: 6px;
  color: var(--pm-text);
  background: #ffffff;
  font: inherit;
}

.pm-tire-finder__select {
  appearance: auto;
  cursor: pointer;
}

.pm-tire-finder__input:focus,
.pm-tire-finder__select:focus {
  outline: 2px solid var(--pm-focus);
  outline-offset: 1px;
}

.pm-tire-finder__actions {
  display: flex;
  align-items: end;
  gap: 8px;
}

.pm-tire-finder__button {
  min-height: 40px;
  min-width: 112px;
  padding: 8px 18px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--pm-accent);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.pm-tire-finder__button:hover,
.pm-tire-finder__button:focus {
  background: var(--pm-accent-dark);
}

.pm-tire-finder__button--secondary {
  border-color: var(--pm-border);
  background: #ffffff;
  color: #243541;
}

.pm-tire-finder__button--secondary:hover,
.pm-tire-finder__button--secondary:focus {
  background: #eef2f4;
}

.pm-tire-finder__button--full {
  width: 100%;
  margin-top: 4px;
}

.pm-tire-finder__body {
  min-width: 0;
  padding: 20px;
}

.pm-tire-finder__workspace {
  display: grid;
  grid-template-columns: minmax(210px, 280px) minmax(0, 1fr);
  min-height: 360px;
}

.pm-tire-finder__result-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}

.pm-tire-finder__status {
  margin: 0;
  color: var(--pm-muted);
  font-size: 14px;
  line-height: 1.45;
}

.pm-tire-finder__part {
  color: var(--pm-accent-dark);
  font-weight: 700;
}

.pm-tire-finder__results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.pm-tire-finder__card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--pm-border);
  border-radius: 8px;
  background: #ffffff;
}

.pm-tire-finder__card-badges {
  display: flex;
  margin-bottom: 8px;
}

.pm-tire-finder__image-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1.35;
  margin-bottom: 10px;
  border: 1px solid #e2e8ed;
  border-radius: 6px;
  background: #f7f9fa;
  overflow: hidden;
}

.pm-tire-finder__image-link--missing {
  display: none;
}

.pm-tire-finder__image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.pm-tire-finder__link {
  display: inline-block;
  color: var(--pm-accent-dark);
  font-weight: 700;
  text-decoration: none;
  line-height: 1.3;
}

.pm-tire-finder__link:hover,
.pm-tire-finder__link:focus {
  text-decoration: underline;
}

.pm-tire-finder__source {
  display: inline-block;
  margin-top: 8px;
  color: #38566e;
  font-size: 12px;
  text-decoration: none;
}

.pm-tire-finder__product-title {
  margin-top: 4px;
  color: #263640;
  font-size: 13px;
  line-height: 1.35;
}

.pm-tire-finder__summary {
  margin-top: 8px;
  color: var(--pm-muted);
  font-size: 12px;
  line-height: 1.35;
}

.pm-tire-finder__source:hover,
.pm-tire-finder__source:focus {
  text-decoration: underline;
}

.pm-tire-finder__badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef5ff;
  color: #214d82;
  font-size: 12px;
  font-weight: 700;
}

.pm-tire-finder__badge--exact {
  background: #edf8f1;
  color: var(--pm-success);
}

.pm-tire-finder__empty,
.pm-tire-finder__error,
.pm-tire-finder__loading {
  padding: 18px;
  border: 1px dashed var(--pm-border);
  border-radius: 8px;
  color: var(--pm-muted);
  background: #ffffff;
  font-size: 14px;
  line-height: 1.45;
}

.pm-tire-finder__loading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 96px;
}

.pm-tire-finder__spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 3px solid #d8e1e7;
  border-top-color: var(--pm-accent);
  border-radius: 50%;
  animation: pm-tire-finder-spin 0.8s linear infinite;
}

@keyframes pm-tire-finder-spin {
  to {
    transform: rotate(360deg);
  }
}

.pm-tire-finder__error {
  border-color: #e4b8bd;
  color: #7b1823;
  background: #fff6f7;
}

.pm-tire-finder__footer {
  padding: 12px 20px;
  border-top: 1px solid var(--pm-border);
  background: var(--pm-surface-muted);
  color: var(--pm-muted);
  font-size: 13px;
  text-align: center;
}

.pm-tire-finder__footer a {
  color: var(--pm-focus);
  font-weight: 700;
  text-decoration: none;
}

.pm-tire-finder__footer a:hover,
.pm-tire-finder__footer a:focus {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .pm-tire-finder__workspace {
    grid-template-columns: 1fr;
  }

  .pm-tire-finder__controls {
    border-right: 0;
    border-bottom: 1px solid var(--pm-border);
  }
}

@media (max-width: 620px) {
  .pm-demo-page {
    padding: 16px 10px;
  }

  .pm-tire-finder__header {
    display: flex;
    flex-direction: column;
  }

  .pm-tire-finder__count {
    display: inline-block;
  }

  .pm-tire-finder__controls {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .pm-tire-finder__body {
    padding: 16px;
  }

  .pm-tire-finder__actions {
    align-items: stretch;
  }

  .pm-tire-finder__button {
    flex: 1 1 auto;
  }
}
