/* Единые товарные плашки Modellisimo, согласовано 18.09.2026.
   Слой с important переопределяет прежние локальные темы без изменения display:
   существующие условия вывода, скрытие на мобильных и исключения сертификатов сохраняются. */
@layer modellisimo-product-badges {
  /* Общий компактный формат каталога; используем только уже подключённые шрифты. */
  :is(.product-one__new, .product-one__discount, .product__discount,
      .product-v3-badge, .product-v3-sale, .p4-badge) {
    box-sizing: border-box !important;
    width: auto !important;
    min-width: 40px !important;
    height: 26px !important;
    min-height: 0 !important;
    padding: 0 7px !important;
    border: 1px solid #c9cdd2 !important;
    border-radius: 4px !important;
    background: #f4f5f7 !important;
    color: #1c1f24 !important;
    font-family: Roboto, 'BMW Catalog Roboto 0', 'BMW Catalog Roboto 1', 'BMW Catalog Roboto 2', 'BMW Catalog Roboto 3', 'BMW Catalog Roboto 4', Arial, sans-serif !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 24px !important;
    letter-spacing: normal !important;
    text-align: center !important;
    text-transform: none !important;
    white-space: nowrap !important;
    transform: none !important;
    box-shadow: 0 1px 3px #0002 !important;
  }
  /* Новинка и скидка сохраняют свои исходные данные, меняется только оформление. */
  :is(.product-one__new, .product-v3-badge--new, .p4-badge--new) {
    background: #fff !important; color: #9b0000 !important; border-color: #9b0000 !important;
  }
  :is(.product-one__discount, .product__discount, .product-v3-badge--sale, .product-v3-sale, .p4-badge--sale) {
    background: #9b0000 !important; color: #fff !important; border-color: #fff !important;
  }
  :is(.product-v3-badge--limit, .p4-badge--limit) {
    background: #d8c28b !important; color: #342b16 !important; border-color: #d8c28b !important;
  }
  /* Разводим надписи над фотографией по тем же углам, что и в каталоге. */
  :is(.product-one, .product__images) > :is(.product-one__new, .product-one__discount) {
    position: absolute !important; top: 14px !important; bottom: auto !important; z-index: 5 !important;
  }
  :is(.product-one, .product__images) > .product-one__new {
    left: 14px !important; right: auto !important;
  }
  :is(.product-one, .product__images) > .product-one__discount {
    left: auto !important; right: 14px !important;
  }
  /* На файловых посадочных сохраняем flex-контейнер, чтобы не менять структуру карточек. */
  .product-one__tags { top: 14px !important; left: 14px !important; right: 14px !important; }
  .product-one__tags > :is(.product-one__new, .product-one__discount) { position: static !important; }
  .product-one__tags > .product-one__discount { margin-left: auto !important; }
  .product-v3-gallery__badges .product-v3-badge--new { top: 14px !important; left: 14px !important; }
  .p4-badges { top: 14px !important; left: 14px !important; right: 14px !important; align-items: center !important; }
  .p4-badges > .p4-badge--new { order: -1 !important; }
  .p4-badges > .p4-badge--sale { margin-left: auto !important; }
  /* Подтверждённый лимит и новинка не должны перекрывать друг друга в первом пилоте. */
  .gallery__main-img:has(> .product-v3-badge--limit) .product-v3-badge--new { top: 48px !important; }
  /* Масштаб и возраст — нейтральные метки; текст и место масштаба в галерее сохраняются. */
  .product-one__scale, .product-v3-badge--scale,
  .p4-badges > .p4-badge:not(.p4-badge--limit, .p4-badge--sale, .p4-badge--new) {
    box-sizing: border-box !important; width: auto !important; min-width: 0 !important;
    height: 22px !important; padding: 1px 5px !important; border: 1px solid #c9cdd2 !important;
    border-radius: 4px !important; background: #f4f5f7 !important; color: #1c1f24 !important;
    font-family: Roboto, 'BMW Catalog Roboto 0', 'BMW Catalog Roboto 1', 'BMW Catalog Roboto 2', 'BMW Catalog Roboto 3', 'BMW Catalog Roboto 4', Arial, sans-serif !important;
    font-size: 11px !important; font-weight: 600 !important; line-height: 18px !important;
    letter-spacing: normal !important; text-transform: none !important; white-space: nowrap !important;
  }
  .product-one__image > .product-one__scale { right: 4px !important; bottom: 28px !important; }
  /* Полосы статуса получают одинаковую типографику без изменения наличия и сроков. */
  .product-one__sticker, .p4-stock .p4-badge {
    box-sizing: border-box !important; height: 24px !important; min-height: 24px !important;
    border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
    color: #fff !important; font-family: Roboto, 'BMW Catalog Roboto 0', 'BMW Catalog Roboto 1', 'BMW Catalog Roboto 2', 'BMW Catalog Roboto 3', 'BMW Catalog Roboto 4', Arial, sans-serif !important;
    font-size: 12px !important; font-weight: 300 !important; line-height: 24px !important;
    letter-spacing: normal !important; text-transform: uppercase !important; text-align: center !important;
  }
  .product-one__sticker:is(.green, .status-available, .status-soon), .p4-stock .p4-badge--stock { background: #5cb85c !important; }
  .product-one__sticker:is(.purple, .status-delivery21, .status-delivery50), .p4-stock .p4-badge--delivery { background: #613d7c !important; }
  .product-one__sticker.red, .p4-stock .p4-badge--unavailable { background: #b00020 !important; }
  /* Компактные карточки телефона: сохраняем высоту и освобождаем место длинным подписям. */
  @media (max-width: 599px) {
    .product-one :is(.product-one__new, .product-one__discount) { min-width: 30px !important; padding: 0 5px !important; font-size: 10px !important; }
    .product-one > .product-one__new { left: 8px !important; }
    .product-one > .product-one__discount { right: 8px !important; }
    .product-one__tags { left: 8px !important; right: 8px !important; }
    .product-one__sticker { font-size: 10px !important; }
  }
}

/* Единые корзина и избранное по образцу каталога, согласовано пользователем 18.09.2026.
   Не меняем обработчики, доступность товаров и скрытие элементов в мобильных шаблонах. */
.product-one .product-one__controls .round-button,
.product__buttons .wish {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
@layer modellisimo-product-badges {
  /* Компактные кнопки всех товарных списков, включая рекомендации и избранное. */
  .product-one__controls { gap: 4px !important; }
  .product-one__controls .round-button {
    position: relative !important; box-sizing: border-box !important;
    align-items: center !important; justify-content: center !important;
    width: 32px !important; min-width: 32px !important; max-width: 32px !important;
    height: 32px !important; min-height: 32px !important; max-height: 32px !important;
    flex: 0 0 32px !important; margin: 0 !important; padding: 0 !important;
    border: 1px solid #c9cdd2 !important; border-radius: 5px !important;
    background: #fff !important; color: #9b0000 !important;
    font-size: 16px !important; line-height: 30px !important;
    box-shadow: none !important; background-size: 16px !important;
  }
  .product-one__controls .basket {
    background-color: #9b0000 !important; color: #fff !important; border-color: #9b0000 !important;
  }
  .product-one__controls .round-button::before,
  .product-one__controls .fa {
    font-size: 16px !important; line-height: 1 !important; background-size: 16px !important;
  }
  /* Сердце из штатного span заменяет прежний декоративный значок-указатель. */
  .product-one__controls .catalog-wishlist::before { content: none !important; }
  .product-one__controls .catalog-wishlist :is(.fa-heart, .fa-heart-o) { color: #9b0000 !important; }
  /* Крупные кнопки покупки сохраняют текст и удобную высоту, получают новую форму и цвета. */
  .product__buttons .basket.button,
  .product-v3-cart, [data-product-v3-cart-proxy],
  .p4-button[data-main-cart], .p4-button[data-bottom-cart] {
    border-radius: 5px !important; background-color: #9b0000 !important;
    border-color: #9b0000 !important; color: #fff !important; box-shadow: none !important;
  }
  /* Сердечки на страницах товара и в закреплённых панелях используют ту же белую кнопку. */
  .product__buttons .wish, .product-v3-wishlist, .p4-icon.catalog-wishlist {
    box-sizing: border-box !important; border: 1px solid #c9cdd2 !important;
    border-radius: 5px !important; background: #fff !important;
    color: #9b0000 !important; box-shadow: none !important;
  }
  .product__buttons .wish {
    width: 48px !important; min-width: 48px !important; height: 48px !important;
    min-height: 48px !important; flex: 0 0 48px !important; padding: 0 !important;
    margin: 0 !important; line-height: 46px !important; text-align: center !important;
  }
  /* У старой карточки иконка задана псевдоэлементом: заменяем звезду на сердце с обоими состояниями. */
  .product__buttons .wish::before {
    content: '\f08a' !important; font-family: FontAwesome !important;
    font-size: 18px !important; font-weight: normal !important; line-height: 1 !important;
    color: #9b0000 !important; border: 0 !important; background: none !important;
  }
  .product__buttons .wish:is(.wdel, [aria-pressed="true"])::before { content: '\f004' !important; }
  .product__buttons .wish::after { content: none !important; }
  :is(.product-v3-wishlist, .p4-icon.catalog-wishlist) .fa {
    color: #9b0000 !important; font-size: 18px !important;
  }
  /* Состояния ожидания, нажатия и клавиатурного фокуса остаются различимыми. */
  :is(.product-one__controls .round-button, .product__buttons .wish, .product-v3-wishlist, .p4-icon.catalog-wishlist):focus-visible {
    outline: 2px solid #9b0000 !important; outline-offset: 3px !important;
  }
}
