/* YMM Fitment storefront widget — inherits theme button tokens when available */
.ymm-fitment-mount {
  width: 100%;
  margin: 20px 0;
}

.ymm-fitment {
  --ymm-border: var(--color-border, #d9d9d9);
  --ymm-text: inherit;
  --ymm-muted: #666;
  --ymm-bg: transparent;
  --ymm-radius: var(--button-border-radius, var(--border-radius, 8px));

  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  color: var(--ymm-text);
  background: var(--ymm-bg);
  border: 1px solid var(--ymm-border);
  border-radius: var(--ymm-radius);
  padding: clamp(16px, 2.5vw, 24px);
  font: inherit;
}

.ymm-fitment *,
.ymm-fitment *::before,
.ymm-fitment *::after {
  box-sizing: border-box;
}

.ymm-fitment__heading {
  margin: 0 0 14px;
  font-size: clamp(15px, 2vw, 18px);
  font-weight: 600;
  line-height: 1.3;
}

.ymm-fitment__garage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: calc(var(--ymm-radius) - 2px);
  font-size: 13px;
}

.ymm-fitment__garage strong {
  font-weight: 600;
}

/* 宽屏：Year/Make/Model + 按钮尽量一行 */
.ymm-fitment__toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}

.ymm-fitment__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

@media (min-width: 560px) {
  .ymm-fitment__row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .ymm-fitment__toolbar {
    flex-direction: row;
    align-items: flex-end;
    gap: 12px;
  }

  .ymm-fitment__actions {
    margin-top: 0;
    flex: 0 0 auto;
    padding-bottom: 0;
  }
}

.ymm-fitment__field label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--ymm-muted);
}

.ymm-fitment__field select {
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--ymm-border);
  border-radius: calc(var(--ymm-radius) - 2px);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  box-shadow: none;
}

.ymm-fitment__field select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ymm-fitment__actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 0;
  align-items: center;
}

.ymm-fitment__btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 44px !important;
  padding: 0 22px !important;
  margin: 0 !important;
  border-radius: 4px !important;
  font: inherit !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  box-shadow: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
}

/* Search：强制实心 */
.ymm-fitment__btn:not(.ymm-fitment__btn--ghost) {
  background: #111111 !important;
  background-color: #111111 !important;
  color: #ffffff !important;
  border: 1px solid #111111 !important;
}

.ymm-fitment__btn:not(.ymm-fitment__btn--ghost):hover:not(:disabled) {
  background: #000000 !important;
  background-color: #000000 !important;
  color: #ffffff !important;
  opacity: 1 !important;
}

/* Clear：线框 */
.ymm-fitment__btn--ghost {
  background: transparent !important;
  background-color: transparent !important;
  color: #111111 !important;
  border: 1px solid #111111 !important;
}

.ymm-fitment__btn:disabled {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
}

.ymm-fitment__status {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ymm-muted);
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid transparent;
}

.ymm-fitment__status:empty {
  display: none;
  margin: 0;
  padding: 0;
  border: 0;
}

.ymm-fitment__status--error {
  color: #9b1c1c;
  background: #fde8e8;
  border-color: #f5b5b5;
  font-weight: 600;
}

.ymm-fitment__results {
  margin-top: 12px;
  font-size: 13px;
  word-break: break-word;
}

@media (max-width: 559px) {
  .ymm-fitment__actions {
    flex-direction: column;
    width: 100%;
  }

  .ymm-fitment__btn {
    width: 100%;
  }
}

.ymm-fitment-hidden-card,
.ymm-fitment-hidden-card[hidden] {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

/* —— 列表页 / 筛选结果：车型提示卡 —— */
/* banner 下 / 结果上：文档流通栏，不吸顶 */
/* 外层不限宽；内层套主题 .page-width 对齐有效内容宽 */
.ymm-garage-notice-slot {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  flex: 0 0 100% !important;
  grid-column: 1 / -1 !important;
  clear: both !important;
  float: none !important;
  margin: 0 !important;
  padding: 12px 0 !important;
  box-sizing: border-box;
  background: transparent;
  border-bottom: 1px solid var(--color-border, rgba(0, 0, 0, 0.08));
}

.ymm-garage-notice-slot .page-width,
.ymm-garage-notice-slot [data-ymm-page-width="1"] {
  width: 100%;
  box-sizing: border-box;
}

.ymm-garage-notice {
  --ymm-notice-accent: var(--color-button-background, var(--color-primary-button, currentColor));
  --ymm-notice-accent-text: var(--color-button-text, var(--color-primary-button-text, #ffffff));
  --ymm-notice-border: var(--color-border, rgba(0, 0, 0, 0.12));
  --ymm-notice-radius: var(--button-border-radius, var(--border-radius, 8px));
  --ymm-notice-muted: var(--color-text-secondary, #666);

  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--ymm-notice-border);
  border-radius: var(--ymm-notice-radius);
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  font: inherit;
  color: inherit;
}

.ymm-garage-notice__accent {
  flex: 0 0 4px;
  background: var(--ymm-notice-accent);
}

.ymm-garage-notice__body {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 12px 14px;
  min-width: 0;
}

.ymm-garage-notice__editor {
  width: 100%;
  border-top: 1px solid var(--ymm-notice-border);
  padding: 12px 14px 14px;
  box-sizing: border-box;
}

.ymm-garage-notice__editor-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: end;
}

@media (min-width: 720px) {
  .ymm-garage-notice__editor-row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  }
}

.ymm-garage-notice__editor-field label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--ymm-notice-muted);
}

.ymm-garage-notice__editor-field select {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--ymm-notice-border);
  border-radius: calc(var(--ymm-notice-radius) - 2px);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  box-shadow: none;
}

.ymm-garage-notice__editor-actions {
  display: flex;
  align-items: end;
}

.ymm-garage-notice__editor-status {
  margin-top: 8px;
  font-size: 13px;
  color: var(--ymm-notice-muted);
}

.ymm-garage-notice__editor-status.is-error {
  color: #d03050;
}

.ymm-garage-notice__copy {
  min-width: 0;
  flex: 1 1 220px;
}

.ymm-garage-notice__eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ymm-notice-muted);
}

.ymm-garage-notice__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
  color: inherit;
}

.ymm-garage-notice__subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ymm-notice-muted);
  line-height: 1.4;
}

.ymm-garage-notice__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 0 0 auto;
}

.ymm-garage-notice__btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 44px !important;
  padding: 0 22px !important;
  margin: 0 !important;
  cursor: pointer !important;
  font: inherit !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
  border-radius: 4px !important;
  box-shadow: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

/* 主操作：强制实心 */
button.ymm-garage-notice__btn--primary {
  background: #111111 !important;
  background-color: #111111 !important;
  color: #ffffff !important;
  border: 1px solid #111111 !important;
}

button.ymm-garage-notice__btn--primary:hover {
  background: #000000 !important;
  background-color: #000000 !important;
  color: #ffffff !important;
}

/* 次操作：线框 */
button.ymm-garage-notice__btn--secondary {
  background: transparent !important;
  background-color: transparent !important;
  color: #111111 !important;
  border: 1px solid #111111 !important;
}

/* —— 详情页适配 / 下单车型：强制独占一整行 —— */
.ymm-pdp-fit-mount,
.ymm-fitment-mount[data-ymm-role="pdp"],
.ymm-fitment-mount[data-ymm-role="pdp-spec"],
#ymm-pdp-fit-auto,
#ymm-pdp-spec-auto {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  flex: 0 0 100% !important;
  flex-grow: 0 !important;
  flex-shrink: 0 !important;
  flex-basis: 100% !important;
  align-self: stretch !important;
  grid-column: 1 / -1 !important;
  clear: both !important;
  float: none !important;
  margin: 16px 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  order: unset !important;
}

.ymm-pdp-fit {
  --ymm-pdp-border: var(--color-border, rgba(0, 0, 0, 0.12));
  --ymm-pdp-radius: var(--button-border-radius, var(--border-radius, 8px));
  --ymm-pdp-muted: var(--color-text-secondary, #666);

  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--ymm-pdp-border);
  border-radius: var(--ymm-pdp-radius);
  background: rgba(0, 0, 0, 0.03);
  box-shadow: none;
  font: inherit;
  color: inherit;
}

.ymm-pdp-fit--ok {
  color: #0f5c2e;
  background: #eaf7ef;
  border-color: #b7e0c4;
}

.ymm-pdp-fit--bad {
  color: #9b1c1c;
  background: #fde8e8;
  border-color: #f5b5b5;
}

.ymm-pdp-fit--empty {
  background: rgba(0, 0, 0, 0.03);
}

.ymm-pdp-fit__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
}

.ymm-pdp-fit__copy {
  min-width: 0;
  flex: 1 1 200px;
}

.ymm-pdp-fit__label {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ymm-pdp-muted);
}

.ymm-pdp-fit--ok .ymm-pdp-fit__label,
.ymm-pdp-fit--bad .ymm-pdp-fit__label {
  color: inherit;
  opacity: 0.8;
}

.ymm-pdp-fit__status {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.ymm-pdp-fit__vehicle {
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 600;
}

.ymm-pdp-fit__hint {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.4;
  opacity: 0.85;
}

.ymm-pdp-fit__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 0 0 auto;
  align-items: center;
}

.ymm-pdp-fit__editor {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.ymm-pdp-fit__editor-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: end;
}

@media (min-width: 720px) {
  .ymm-pdp-fit__editor-row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  }
}

.ymm-pdp-fit__editor-field label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--ymm-pdp-muted);
}

.ymm-pdp-fit__editor-field select {
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--ymm-pdp-border);
  border-radius: 4px;
  background: #fff;
  color: inherit;
  font: inherit;
  font-size: 14px;
  box-shadow: none;
}

.ymm-pdp-fit__editor-actions {
  display: flex;
  align-items: end;
}

.ymm-pdp-fit__editor-status {
  margin-top: 8px;
  font-size: 13px;
  color: var(--ymm-pdp-muted);
}

.ymm-pdp-fit__editor-status.is-error {
  color: #9b1c1c;
  font-weight: 600;
}

/* Order Vehicle Spec — 跟变体区风格对齐，整行表单 */
.ymm-pdp-spec {
  --ymm-border: var(--color-border, rgba(0, 0, 0, 0.14));
  --ymm-muted: var(--color-text-secondary, #666);
  --ymm-radius: var(--button-border-radius, var(--border-radius, 6px));
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 14px 0 12px;
  border-top: 1px solid var(--ymm-border);
  font: inherit;
}

.ymm-pdp-spec *,
.ymm-pdp-spec *::before,
.ymm-pdp-spec *::after {
  box-sizing: border-box;
}

.ymm-pdp-spec__title {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.ymm-pdp-spec__hint {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ymm-muted);
}

.ymm-pdp-spec__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 560px) {
  .ymm-pdp-spec__row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ymm-pdp-spec__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.ymm-pdp-spec__label {
  font-size: 12px;
  font-weight: 600;
}

.ymm-pdp-spec__field select {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--ymm-border);
  border-radius: var(--ymm-radius);
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: inherit;
  appearance: auto;
}

/* 可搜索下拉 */
.ymm-search-select {
  position: relative;
  width: 100%;
}

.ymm-search-select.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.ymm-search-select__input {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--ymm-border, rgba(0, 0, 0, 0.14));
  border-radius: var(--ymm-radius, 6px);
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: inherit;
  box-sizing: border-box;
}

.ymm-search-select__input:focus {
  outline: 2px solid rgba(0, 0, 0, 0.2);
  outline-offset: 1px;
}

.ymm-search-select__list {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 4px 0;
  max-height: 220px;
  overflow: auto;
  list-style: none;
  background: #fff;
  border: 1px solid var(--ymm-border, rgba(0, 0, 0, 0.14));
  border-radius: var(--ymm-radius, 6px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.ymm-search-select__option {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.3;
}

.ymm-search-select__option:hover,
.ymm-search-select__option.is-selected {
  background: rgba(0, 0, 0, 0.06);
}

.ymm-search-select__empty {
  padding: 10px 12px;
  font-size: 13px;
  color: #888;
}

.ymm-pdp-spec__status {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ymm-muted);
}

.ymm-pdp-spec__status.is-error {
  color: #9b1c1c;
  font-weight: 600;
}

@media (max-width: 559px) {
  .ymm-fitment__actions {
    flex-direction: column;
  }

  .ymm-fitment__btn {
    width: 100%;
  }

  .ymm-garage-notice__body {
    padding: 12px 14px;
  }

  .ymm-garage-notice__actions,
  .ymm-pdp-fit__actions {
    width: 100%;
  }

  .ymm-garage-notice__btn,
  .ymm-pdp-fit__btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}
