/**
 * СТИЛИ КАРТОЧКИ ТОВАРА В КАТАЛОГЕ
 */

/* ─── Скрываем стандартную пагинацию WooCommerce ─── */
/* Она нам не нужна — вместо неё бесконечная прокрутка */
.site-main {
  max-width: 1440px !important;
  padding: 0px 20px !important;
}
.woocommerce-pagination {
  display: none !important;
}
.woocommerce-result-count {
  display: none !important;
}
.woocommerce-products-header__title {
  display: none;
}
/* ─── Сетка карточек ─── */
/* WooCommerce выводит товары в <ul class="products">.
   Используем CSS Grid для удобного управления колонками. */
ul.products {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr); /* 4 колонки */
  gap: 24px !important;
  padding: 0 !important;
  list-style: none !important;
}
ul.products.columns-4::before {
  display: none;
}
/* ─── Карточка ─── */
.sp-card {
  /* Сбрасываем стандартные стили WooCommerce */
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
}

.sp-card-inner {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  height: 100%; /* Карточки одинаковой высоты в строке */
  transition: box-shadow 0.2s ease;
}

.sp-card-inner:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
/* Визуально приглушить карточку */
.sp-card--disabled {
  opacity: 0.55;
  filter: grayscale(1);
}
.sp-card--disabled .sp-card-inner:hover {
  box-shadow: none;
}
.sp-card--disabled .sp-card-title {
  pointer-events: none;
  cursor: not-allowed;
}
.sp-card--disable .sp-card-cart-btn-wrap,
.sp-card--disabled button,
.sp-card--disabled .sp-card-image-link {
  pointer-events: none;
  cursor: not-allowed;
}
/* ─── Верхняя часть: изображение + бейджи ─── */
.sp-card-top {
  position: relative;
  padding: 16px;
  background: #f9f9f9;
  text-align: center;
}

/* Изображение */
.sp-card-image-link {
  display: block;
}

.sp-card-image-link img {
  max-height: 180px;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  object-fit: contain;
  display: block;
}

/* ─── Бейджи (Новинка, Акция) ─── */
.sp-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 2;
}

.sp-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sp-badge-new {
  background: #1a73e8;
}

.sp-badge-promo {
  background: #f59f0a;
}
/* Контейнер, относительно которого позиционируется бейдж */
.sp-thumb-with-badges {
  position: relative;
  display: block;
  line-height: 0;
}

.sp-thumb-with-badges img {
  display: block;
  width: 100%;
  height: auto;
}

/* Бейдж "Акция: значение" — в левом нижнем углу картинки */
.sp-badge--akciya-value {
  position: absolute;
  left: -4px;
  bottom: -4px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 4px 12px;
  border-radius: 20px;

  background: #f59f0a;
  color: #fff;
  font-family: "Roboto";
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-transform: none;
  white-space: wrap;
  pointer-events: none; /* чтобы не мешал клику по картинке/ссылке */
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}
/* ─── Сердечко (Wishlist) ─── */
.sp-wishlist-btn {
  position: absolute;
  top: 5px;
  right: 30px;
  z-index: 2;
}

/* ─── Информационный блок ─── */
.sp-card-info {
  padding: 14px 16px 0 16px;
  flex: 0 1 auto; /* не растягивается, сжимается, ширина по содержимому */
  min-width: 0;
}

/* Стиль пива (Stout, Pale Ale, Lager, IPA...) — строка с бордером */
.sp-style-line {
  display: inline-block;
  font-size: 12px;
  color: #666;
  padding: 2px 10px;
  margin-bottom: 10px;
  border: 2px solid #f1f5f9;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

/* Название товара */
.sp-card-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 4px 0;
  color: #1a1a2e;
}

.sp-card-title a {
  color: inherit;
  text-decoration: none;
}

.sp-card-title a:hover {
  color: #f59f0a;
}

/* Краткое описание */
.sp-card-short-desc {
  font-size: 13px;
  color: #888;
  line-height: 1.4;
  margin-bottom: 6px;
  /* Ограничиваем 2 строками */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Алкоголь + Бренд */
.sp-card-meta {
  font-size: 13px;
  color: #555;
  margin-bottom: 12px;
}

.sp-meta-sep {
  margin: 0 6px;
  color: #ccc;
}

.sp-meta-brend {
  font-weight: 500;
}

/* ─── ТАБЛИЦА ВАРИАЦИЙ ─── */
.sp-card-variations {
  display: flex;
  flex-direction: column;
  padding: 0 16px 16px 16px;
  flex: 1 1 auto;
  min-height: 0;
}
.sp-card-variations-inner {
  margin-bottom: 20px;
}

/* Заголовок таблицы */
.sp-var-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e8e8e8;
  margin-bottom: 4px;
}

.sp-var-h-pack,
.sp-var-h-price,
.sp-var-h-qty {
  font-size: 11px;
  color: #999;
  font-weight: 500;
  text-transform: none;
}

.sp-var-h-price {
  min-width: 70px;
  text-align: right;
}

.sp-var-h-qty {
  min-width: 100px;
  text-align: center;
}

/* Строка вариации */
.sp-var-row {
  display: grid;
  grid-template-columns: max-content 1fr max-content;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
}

.sp-var-row:last-of-type {
  border-bottom: none;
}

/* Название упаковки */
.sp-var-pack {
  font-size: 13px;
  color: #333;
  font-weight: 500;
}

.sp-var-pack small {
  font-weight: 400;
  color: #999;
  font-size: 11px;
}

/* Цена */
.sp-var-price {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a2e;
  min-width: 70px;
  text-align: right;
}

/* Счётчик количества */
.sp-var-qty {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 100px;
  justify-content: center;
}

.sp-qty-btn {
  width: 28px !important;
  height: 28px !important;
  border: none !important;
  background: none;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64778b !important;
  padding: 0 !important;
  line-height: 1;
  border-radius: 6px;
  flex-shrink: 0;
}

/* Кнопка «+» — оранжевая, как на скриншоте */
.sp-qty-plus {
  color: #fff !important;
  background: #f59f0a !important;
  border-radius: 6px;
  font-weight: 700;
}

.sp-qty-plus:hover {
  background: #e08f00 !important;
  color: #fff;
}

/* Кнопка «−» — нейтральная */
.sp-qty-minus:hover {
  background: #e08f00 !important;
}
.sp-qty-minus:focus {
  background: none !important;
}

/* Инпут количества */
.sp-qty-input {
  width: 40px !important;
  height: 28px !important;
  text-align: center;
  border: none;
  margin: 0px 5px;
  padding: 2px !important;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a2e;
  -moz-appearance: textfield;
}

.sp-qty-input::-webkit-outer-spin-button,
.sp-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Нет в наличии */
.sp-var-out-of-stock {
  opacity: 0.5;
}

.sp-out-of-stock-text {
  font-size: 12px;
  color: #999;
  font-style: italic;
}

/* ─── Кнопка «В корзину» ─── */
.sp-card-cart-btn-wrap {
  margin-top: auto;
}

.sp-card-add-to-cart {
  width: 100%;
  padding: 10px 0;
  background: #f59f0a !important;
  color: #fff !important;
  border: none !important;
  border-radius: 6px !important;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
  text-transform: none;
  letter-spacing: 0.3px;
}

.sp-card-add-to-cart:hover {
  background: #db8c06 !important;
}

.sp-card-add-to-cart.loading {
  opacity: 0.7;
  cursor: not-allowed;
}

.sp-card-add-to-cart.added {
  background: #4caf50;
}

/* ─── Индикатор загрузки (бесконечная прокрутка) ─── */
.sp-load-more-spinner {
  text-align: center;
  padding: 30px 0;
  font-size: 14px;
  color: #999;
}

.sp-load-more-spinner .spinner-dots::after {
  content: "...";
  animation: sp-dots 1.5s infinite;
}

@keyframes sp-dots {
  0%,
  20% {
    content: ".";
  }
  40% {
    content: "..";
  }
  60%,
  100% {
    content: "...";
  }
}

/* ─── БЕЙДЖИ В ШАПКЕ (Корзина и Wishlist) ─── */
.sp-header-cart-count,
.sp-header-wish-count {
  position: absolute;
  top: -6px;
  right: -8px;
  background: #f59f0a;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 50%;
  pointer-events: none;
}

/* Скрываем бейдж, когда count = 0 */
.sp-header-cart-count[data-count="0"],
.sp-header-wish-count[data-count="0"] {
  display: none;
}

/* Позиционируем иконки в шапке относительно */
.header-cart-icon,
.header-wish-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.pf-results {
  max-width: 1440px !important;
  padding: 20px 20px 0px !important;
}
/* ─── АДАПТИВ ─── */
/* 3 колонки на планшете */
@media (max-width: 1350px) {
  ul.products {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 16px !important;
  }
}

/* 2 колонки на мобильном (горизонтально) */
@media (max-width: 1050px) {
  ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .sp-card-image-link img {
    max-height: 140px;
  }

  .sp-card-title {
    font-size: 14px;
  }
}
/* 1 колонка на маленьких экранах */
@media (max-width: 670px) {
  ul.products {
    grid-template-columns: 1fr !important;
  }
}
