/* ═══════════════════════════════════════════════════════════════
   ПЛАВАЮЩАЯ КОРЗИНА — float-cart.css
   Подключить в functions.php на страницах категорий и товара
   ═══════════════════════════════════════════════════════════════ */

/* ── Кнопка-триггер (плавающая) ─────────────────────────────── */
.plt-fcart {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9900;
}

.plt-fcart__btn {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--blue, #0066b3);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(0,102,179,.38);
  transition: background .18s, transform .18s, box-shadow .18s;
  color: #fff;
}
.plt-fcart__btn:hover {
  background: #0055a0;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,102,179,.44);
}
.plt-fcart__btn svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* Счётчик товаров */
.plt-fcart__count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: #e63946;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border: 2px solid #fff;
  display: none;
  pointer-events: none;
}
.plt-fcart__count.is-visible { display: block; }
.plt-fcart__count.bump {
  animation: pltBump .3s cubic-bezier(.36,.07,.19,.97);
}
@keyframes pltBump {
  0%,100% { transform: scale(1); }
  40%      { transform: scale(1.5); }
}

/* ── Панель корзины ──────────────────────────────────────────── */
.plt-fcart__panel {
  position: fixed;
  bottom: 90px;
  right: 28px;
  width: 340px;
  max-height: 540px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.16);
  border: 1px solid rgba(0,0,0,.07);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(.97);
  pointer-events: none;
  transition: opacity .22s cubic-bezier(.22,.6,.36,1),
              transform .22s cubic-bezier(.22,.6,.36,1);
  z-index: 9901;
}
.plt-fcart__panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Шапка панели */
.plt-fcart__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 13px;
  border-bottom: 1px solid #f0f2f5;
  flex-shrink: 0;
}
.plt-fcart__head-title {
  font-size: .9rem;
  font-weight: 700;
  color: #111827;
}
.plt-fcart__head-close {
  width: 28px;
  height: 28px;
  border: none;
  background: #f4f6f9;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.plt-fcart__head-close:hover { background: #e5e7eb; color: #111; }
.plt-fcart__head-close svg { width: 14px; height: 14px; }

/* Тело — скролл */
.plt-fcart__body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0;
}
.plt-fcart__body::-webkit-scrollbar { width: 4px; }
.plt-fcart__body::-webkit-scrollbar-track { background: transparent; }
.plt-fcart__body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }

/* ── Товар в корзине ─────────────────────────────────────────── */
.plt-fcart__item {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f2f5;
  transition: background .15s;
}
.plt-fcart__item:hover { background: #fafbfd; }
.plt-fcart__item:last-child { border-bottom: none; }

.plt-fcart__item-img {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  flex-shrink: 0;
  background: #f9fafb;
}
.plt-fcart__item-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.plt-fcart__item-info {
  min-width: 0;
}
.plt-fcart__item-name {
  font-size: .78rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-decoration: none;
  transition: color .15s;
}
.plt-fcart__item-name:hover { color: var(--blue, #0066b3); }

/* Управление количеством */
.plt-fcart__item-qty {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 7px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  width: fit-content;
  background: #fff;
}
.plt-fcart__qty-btn {
  width: 26px;
  height: 26px;
  border: none;
  background: #f4f6f9;
  color: #374151;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  font-weight: 700;
  transition: background .15s, color .15s;
  flex-shrink: 0;
  line-height: 1;
}
.plt-fcart__qty-btn:hover { background: #e5e7eb; color: var(--blue, #0066b3); }
.plt-fcart__qty-btn:active { background: #d1d5db; }
.plt-fcart__qty-input {
  width: 30px;
  text-align: center;
  border: none;
  border-left: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
  font-size: .78rem;
  font-weight: 700;
  color: #111827;
  padding: 0;
  height: 26px;
  -moz-appearance: textfield;
  outline: none;
  background: #fff;
}
.plt-fcart__qty-input::-webkit-inner-spin-button,
.plt-fcart__qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* Цена + удалить (правая колонка) */
.plt-fcart__item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.plt-fcart__item-price {
  font-size: .82rem;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
}
.plt-fcart__item-remove {
  width: 22px;
  height: 22px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  border-radius: 4px;
  transition: background .15s, color .15s;
}
.plt-fcart__item-remove:hover { background: #fee2e2; color: #e63946; }
.plt-fcart__item-remove svg { width: 13px; height: 13px; }

/* Пустая корзина */
.plt-fcart__empty {
  padding: 36px 20px;
  text-align: center;
  color: #9ca3af;
  font-size: .82rem;
}
.plt-fcart__empty svg {
  display: block;
  margin: 0 auto 10px;
  width: 36px;
  height: 36px;
  opacity: .35;
}

/* Итог + кнопка */
.plt-fcart__foot {
  padding: 14px 16px 16px;
  border-top: 1px solid #f0f2f5;
  flex-shrink: 0;
  background: #fff;
}
.plt-fcart__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.plt-fcart__total-label {
  font-size: .78rem;
  color: #6b7280;
  font-weight: 500;
}
.plt-fcart__total-sum {
  font-size: 1.05rem;
  font-weight: 800;
  color: #111827;
  letter-spacing: -.4px;
}
.plt-fcart__checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 11px 16px;
  background: var(--blue, #0066b3);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s, transform .15s;
}
.plt-fcart__checkout:hover {
  background: #0055a0;
  transform: translateY(-1px);
}
.plt-fcart__checkout svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ── Тост уведомление ────────────────────────────────────────── */
.plt-toast {
  position: fixed;
  bottom: 98px;
  right: 28px;
  background: #111827;
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: .8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 300px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 9902;
  box-shadow: 0 4px 16px rgba(0,0,0,.22);
}
.plt-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.plt-toast svg { width: 15px; height: 15px; color: #10b981; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════
   БЕЙДЖ «НОВИНКА» — для карточек на страницах категорий
   (article.sp-product и article.v4-product-row)
   ═══════════════════════════════════════════════════════════════ */

/* Обёртка тегов должна быть relative (уже есть в sp-product__tags и v4-product-row__meta) */
.sp-product { position: relative; }
.v4-product-row { position: relative; }

/* Бейдж на строках каталога (v4-product-row) */
.plt-badge-new {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #ff6b35, #f72585);
  color: #fff;
  box-shadow: 0 1px 6px rgba(247,37,133,.28);
  white-space: nowrap;
  vertical-align: middle;
  flex-shrink: 0;
}
.plt-badge-new svg {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
}

/* Бейдж на sp-product (горизонтальный список) */
.sp-product__tag--new {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #ff6b35, #f72585);
  color: #fff;
  box-shadow: 0 1px 6px rgba(247,37,133,.28);
  white-space: nowrap;
}

/* ── Мобайл ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .plt-fcart { bottom: 16px; right: 16px; }
  .plt-fcart__panel {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 80px;
    max-height: 65vh;
  }
  .plt-toast { right: 16px; max-width: calc(100vw - 32px); }
}
