/* AM-BADGE-20261204 / AM-HEART-BR-20261204
   Плашки «новинка» / скидка / хит не пересекают сердечко.
   Сердечко избранного: в правом нижнем углу фото, чуть меньше,
   активное — фирменный зелёный var(--greenColor, #8a9b6e)
   (тот же, что у плашки «НОВИНКА» и кнопки корзины).
   Неактивное — прежний контур heart-1.svg.
   Vue 2 подменяет тег компонента на div.catalog-content__card-favourites
   (прямой ребёнок карточки). */

/* ----- Плашки: запас справа больше не нужен, сердце ушло вниз ----- */
.catalog-content__card-mark-wrapper {
  box-sizing: border-box;
  max-width: 100%;
  overflow: hidden;
}

.catalog-content__card-mark {
  box-sizing: border-box;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 990px) {
  .catalog-content__card--new .catalog-content__card-mark.catalog-content__card-mark--new,
  .catalog-content__card--discount .catalog-content__card-mark.catalog-content__card-mark--discount,
  .catalog-content__card-mark {
    font-size: 1.3rem;
    line-height: 1.6rem;
    padding: 0.6rem 1rem;
  }
}

@media (max-width: 575px) {
  .catalog-content__card-mark,
  .catalog-content__card--new .catalog-content__card-mark.catalog-content__card-mark--new,
  .catalog-content__card--discount .catalog-content__card-mark.catalog-content__card-mark--discount,
  .product-recently .catalog-content__card--discount .catalog-content__card-mark.catalog-content__card-mark--discount {
    font-size: 10px;
    line-height: 12px;
    padding: 4px 6px;
    letter-spacing: 0.02em;
  }
}

/* ----- Сердечко в правом нижнем углу фото -----
   Карточка уже display:flex; column. Ставим блок избранного
   сразу после фото (order) с height:0, чтобы label с bottom/right
   якорился к нижнему краю фото, а не к низу всей карточки. */
.catalog-content__card > .catalog-content__card-img {
  order: 1;
}

.catalog-content__card > .catalog-content__card-info {
  order: 3;
}

.catalog-content__card > .catalog-content__card-favourites {
  display: block;
  order: 2;
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  width: 100%;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
  flex: 0 0 auto;
  z-index: 4;
  pointer-events: none;
}

.catalog-content__card .catalog-content__card-close {
  z-index: 4;
}

/* Визуал ~20px на десктопе (было ~25px, около −20%).
   Кликабельная область — 32px. */
.catalog-content__card .catalog-content__card-favourites label {
  position: absolute;
  top: auto;
  left: auto;
  right: 6px;
  bottom: 6px;
  display: block;
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  background-image: url("/local/templates/allmongolia_umax/assets/images/heart-1.svg");
  background-size: 20px 20px;
  background-repeat: no-repeat;
  background-position: center;
  background-color: transparent;
  cursor: pointer;
  transition: ease-in-out 0.25s;
  pointer-events: auto;
  z-index: 4;
}

/* Неактивное при наведении остаётся контуром, без красного heart.svg */
.catalog-content__card .catalog-content__card-favourites label:hover {
  background-image: url("/local/templates/allmongolia_umax/assets/images/heart-1.svg");
}

/* Активное: заливка фирменным зелёным #8a9b6e (--greenColor) */
.catalog-content__card .catalog-content__card-favourites input:checked + label,
.catalog-content__card .catalog-content__card-favourites input:checked + label:hover {
  background-image: url("data:image/svg+xml,%3Csvg width='38' height='38' viewBox='0 0 38 38' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M19 32.9531C18.8488 32.9507 18.7006 32.9098 18.5695 32.8343C18.4063 32.7601 14.725 30.6671 10.9844 27.3124C5.86328 22.696 3.26563 18.1093 3.26563 13.6562C3.26428 11.8138 3.85403 10.0195 4.94818 8.53713C6.04233 7.05477 7.58316 5.96251 9.3442 5.42091C11.1052 4.87931 12.9936 4.91693 14.7316 5.52826C16.4697 6.13958 17.9658 7.29236 19 8.81713C20.0342 7.29236 21.5303 6.13958 23.2684 5.52826C25.0064 4.91693 26.8948 4.87931 28.6558 5.42091C30.4168 5.96251 31.9577 7.05477 33.0518 8.53713C34.146 10.0195 34.7357 11.8138 34.7344 13.6562C34.7344 18.1093 32.1367 22.696 27.0156 27.3124C23.275 30.6671 19.5938 32.7601 19.4305 32.8343C19.2994 32.9098 19.1512 32.9507 19 32.9531Z' fill='%238a9b6e'/%3E%3C/svg%3E");
}

/* Мобильная/планшет: визуал ~26px (было 36px, −28%), тап-зона 36px */
@media (max-width: 990px) {
  .catalog-content__card .catalog-content__card-favourites label {
    width: 36px;
    height: 36px;
    background-size: 26px 26px;
  }
}

/* ===================================================================
   AM-FEEDBACK-20261204 — отклик вместо тостов успеха (избранное/корзина)
   + починка тостов при «Уменьшении движения» (iPhone/Android)
   =================================================================== */

/* --- Мобильные тосты исчезали за ~30 мс ---------------------------------
   normalize.css при prefers-reduced-motion ставит ВСЕМ animation-duration:
   0.01ms !important. vue-toastification закрывает тост по animationend
   полоски прогресса (длительность задаёт inline-style = timeout), поэтому
   тост закрывался мгновенно. Возвращаем полоске настоящую длительность
   (должна совпадать с timeout в toastOptions = 4000 мс) и прячем её,
   чтобы без движения. Остальные анимации остаются выключенными. */
@media (prefers-reduced-motion: reduce) {
  .Vue-Toastification__progress-bar {
    animation-duration: 4000ms !important;
    animation-iteration-count: 1 !important;
    opacity: 0 !important;
  }
}

/* --- Только для скринридеров ------------------------------------------- */
.am-fb-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Анимации ----------------------------------------------------------- */
@keyframes am-fb-heart-on {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.4); }
  65%  { transform: scale(0.92); }
  100% { transform: scale(1); }
}
@keyframes am-fb-heart-off {
  0%   { transform: scale(1); }
  40%  { transform: scale(0.82); }
  100% { transform: scale(1); }
}
@keyframes am-fb-bump {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}
@keyframes am-fb-count {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.6); }
  100% { transform: scale(1); }
}
@keyframes am-fb-ok-card {
  0%   { transform: scale(1);    box-shadow: inset 0 0 0 1px #000, 0 0 0 0 rgba(138, 155, 110, 0.85); }
  35%  { transform: scale(1.12); }
  100% { transform: scale(1);    box-shadow: inset 0 0 0 1px #000, 0 0 0 12px rgba(138, 155, 110, 0); }
}
@keyframes am-fb-ok-pdp {
  0%   { transform: scale(1);    box-shadow: 0 0 0 0 rgba(138, 155, 110, 0.85); }
  35%  { transform: scale(1.03); }
  100% { transform: scale(1);    box-shadow: 0 0 0 12px rgba(138, 155, 110, 0); }
}

.catalog-content__card-favourites label.am-fb-heart-on {
  animation: am-fb-heart-on 0.3s ease-out;
}
.catalog-content__card-favourites label.am-fb-heart-off {
  animation: am-fb-heart-off 0.2s ease-out;
}
.product-page__btn--small.am-fb-heart-on {
  animation: am-fb-heart-on 0.3s ease-out;
}
.product-page__btn--small.am-fb-heart-off {
  animation: am-fb-heart-off 0.2s ease-out;
}

/* Иконка избранного/корзины в шапке и счётчик корзины */
.header__icon.am-fb-bump {
  animation: am-fb-bump 0.6s ease-out;
}
.header__icon--counter.am-fb-count {
  animation: am-fb-count 0.5s ease-out;
}

/* Подтверждение на кнопке «в корзину» (~1.5 с; постоянное «В корзине ✓»
   рисует am-card-added.css) */
.catalog-content__card-basket.am-fb-ok {
  animation: am-fb-ok-card 1.1s ease-out;
}
.product-page__btns .product-page__btn--big.am-fb-ok {
  animation: am-fb-ok-pdp 1.1s ease-out;
}

/* Без движения: статичная подсветка фирменным зелёным вместо анимации */
@media (prefers-reduced-motion: reduce) {
  .catalog-content__card-favourites label.am-fb-heart-on,
  .catalog-content__card-favourites label.am-fb-heart-off,
  .product-page__btn--small.am-fb-heart-on,
  .product-page__btn--small.am-fb-heart-off,
  .header__icon.am-fb-bump,
  .header__icon--counter.am-fb-count,
  .catalog-content__card-basket.am-fb-ok,
  .product-page__btns .product-page__btn--big.am-fb-ok {
    animation: none !important;
    transform: none !important;
  }
  .header__icon.am-fb-bump,
  .header__icon--counter.am-fb-count,
  .catalog-content__card-basket.am-fb-ok,
  .product-page__btns .product-page__btn--big.am-fb-ok {
    outline: 2px solid #8a9b6e;
    outline-offset: 2px;
  }
}

/* AM-CHECKOUT-LINK-20261204: «Перейти к оформлению» под кнопкой «В корзине» на странице товара (фирменный зелёный) */
.product-page .product-page__btns{position:relative}
.product-page__btns > .am-fb-checkout{position:absolute;top:calc(100% + 10px);left:0;right:0;display:flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:46px;margin-top:10px;padding:0 16px;background:#8a9b6e;border:1px solid #8a9b6e;color:#fff;font-family:inherit;font-size:13px;font-weight:500;letter-spacing:.04em;text-transform:uppercase;text-decoration:none;text-align:center;line-height:1.2;max-width:100%;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:background-color .15s}
.product-page__btns > .am-fb-checkout[hidden]{display:none}
.product-page__btns > .am-fb-checkout:hover,.product-page__btns > .am-fb-checkout:focus-visible{background:#7a8b60;border-color:#7a8b60;color:#fff;text-decoration:none}
.product-page__btns > .am-fb-checkout:active{background:#6f7f57}
.product-page__btns > .am-fb-checkout:focus-visible{outline:2px solid #000;outline-offset:2px}
@media (prefers-reduced-motion:reduce){.product-page__btns > .am-fb-checkout{transition:none}}
