/**
 * Сторінка категорії / вибір товарів — scoped .page-category
 */

.page-category {
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
  color: var(--pm-text);
  background: #f7f3f0;
}

/* ── Заголовок ── */
.page-category .category-page__head {
  padding: 1.25rem 0 0.25rem;
}

.page-category .category-page__head .header-text {
  margin: 0 0 0.75rem;
  padding: 0 0 0 1rem;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--pm-primary) !important;
  background: transparent !important;
  border-left: 4px solid var(--pm-accent);
}

.page-category .category-page__head .note.note-light {
  max-width: 48rem;
  margin: 0 0 1.25rem;
  padding: 1rem 1.15rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--pm-muted);
  background: #fff;
  border: 1px solid rgba(93, 64, 55, 0.1);
  border-left: 4px solid var(--pm-warm);
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(50, 25, 17, 0.05);
}

/* ── Фільтр по тегах (пов’язані категорії) ── */
.page-category .category-page__filters {
  margin-bottom: 1.5rem;
}

.page-category .row.linked-category-row {
  display: none;
}

@media (min-width: 768px) {
  .page-category .row.linked-category-row {
    display: block;
  }

  .page-category #linked-category-button {
    display: none;
  }
}

.page-category #linked-category-button {
  margin-bottom: 1rem;
  border-radius: 12px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(199, 91, 57, 0.25);
}

.page-category .tags_title {
  margin: 0 0 1rem;
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 800;
  color: var(--pm-primary);
  letter-spacing: -0.02em;
}

.page-category .category_tag_container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.85rem 0.65rem;
  justify-items: center;
  align-items: start;
  padding: 1.15rem 1.2rem;
  background: #fff;
  border: 1px solid rgba(93, 64, 55, 0.08);
  border-radius: 18px;
  box-shadow: var(--pm-shadow);
}

.page-category a.category_tag {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 0.35rem;
  text-decoration: none;
  border-radius: 14px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.page-category a.category_tag:hover {
  background: rgba(199, 91, 57, 0.06);
  transform: translateY(-2px);
}

.page-category a.category_tag.active {
  background: rgba(93, 64, 55, 0.06);
}

.page-category .category_tag .tag_image {
  width: 100%;
  max-width: 5.5rem;
  margin: 0 auto 0.45rem;
  border: 3px solid rgba(93, 64, 55, 0.12);
  border-radius: 50%;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.page-category .category_tag .tag_image img {
  width: 100%;
  height: auto;
  display: block;
}

.page-category .category_tag .tag_link {
  display: block;
  width: 100%;
  padding: 0.4rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  color: #fff;
  background: rgba(199, 91, 57, 0.85);
  border-radius: 10px;
  transition: background 0.2s ease;
}

.page-category a.category_tag.active .tag_link,
.page-category a.category_tag:hover .tag_link {
  background: var(--pm-primary);
}

.page-category a.category_tag.active .tag_image,
.page-category a.category_tag:hover .tag_image {
  border-color: var(--pm-accent);
  box-shadow: 0 4px 14px rgba(199, 91, 57, 0.25);
}

/* Модалка фільтра (мобільний) */
.page-category #linkedCategoryModal .category_tag_container {
  box-shadow: none;
  border: none;
  padding: 0.5rem 0;
}

.page-category #linkedCategoryModal .modal-content {
  border-radius: 18px;
  border: none;
  overflow: hidden;
}

.page-category #linkedCategoryModal .modal-header {
  background: linear-gradient(135deg, var(--pm-primary), var(--pm-warm));
  color: #fff;
}

.page-category #linkedCategoryModal .modal-title {
  font-weight: 700;
}

/* ── Панель сортування ── */
.page-category .category-page__toolbar {
  margin-bottom: 1.25rem;
  padding: 1rem 1.15rem;
  background: #fff;
  border: 1px solid rgba(93, 64, 55, 0.08);
  border-radius: 16px;
  box-shadow: 0 4px 18px rgba(50, 25, 17, 0.05);
}

.page-category .category-page__toolbar form {
  margin: 0;
  align-items: flex-end !important;
  gap: 0.75rem 1rem;
}

.page-category .category-page__toolbar label {
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--pm-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.page-category .category-page__toolbar .form-control,
.page-category .category-page__toolbar .custom-select {
  min-width: 10rem;
  border-radius: 10px;
  border-color: rgba(93, 64, 55, 0.2);
  font-weight: 600;
  color: var(--pm-primary);
}

.page-category .category-page__toolbar .form-control:focus {
  border-color: var(--pm-accent);
  box-shadow: 0 0 0 3px rgba(199, 91, 57, 0.12);
}

.page-category .category-page__toolbar .btn-primary {
  margin: 0 !important;
  min-height: 2.5rem;
  padding: 0.5rem 1.35rem;
  font-weight: 700;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(199, 91, 57, 0.28);
}

/* ── Пагінація ── */
.page-category .cpanel,
.page-category .container-pagination {
  overflow: visible;
}

.page-category .panel-pagintion {
  margin: 0.5rem 0 1rem;
}

.page-category .pagination .page-link {
  border-radius: 10px;
  color: var(--pm-primary);
  font-weight: 600;
}

.page-category .pagination .page-item.active .page-link {
  background: var(--pm-accent);
  border-color: var(--pm-accent);
}

.page-category .pagination-info {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--pm-muted);
}

/* ── Сітка товарів ── */
.page-category .category-page__listing {
  padding-bottom: 2rem;
}

.page-category .row.category-product {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1.25rem;
  margin: 0;
  overflow: visible;
}

.page-category .row.category-product > .card.product-card {
  width: 100%;
  min-width: 0;
}

.page-category .card.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 1px solid rgba(93, 64, 55, 0.08);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 6px 22px rgba(50, 25, 17, 0.07);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

.page-category .card.product-card:hover {
  transform: translateY(-5px);
  border-color: rgba(199, 91, 57, 0.22);
  box-shadow: 0 16px 40px rgba(50, 25, 17, 0.12);
}

.page-category .card.product-card > a:first-of-type {
  display: block;
  overflow: hidden;
  border-radius: 18px 18px 0 0;
  text-decoration: none;
}

.page-category .card.product-card .img-wrap {
  background: radial-gradient(ellipse 90% 80% at 50% 20%, #fff 0%, #f3ece8 100%);
}

.page-category .card.product-card .product-img.ratio-container-1-1 img,
.page-category .product-img.ratio-container-1-1 img {
  height: 100% !important;
  object-fit: contain;
}

.page-category .card.product-card .card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0.85rem 1rem 1rem;
}

.page-category .card.product-card .card-title {
  height: auto;
  min-height: 2.75rem;
  margin: 0.35rem 0 0.25rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--pm-primary) !important;
}

.page-category .card.product-card .card-body > a[href] .card-title:hover {
  color: var(--pm-accent) !important;
}

.page-category .card.product-card .card-body small {
  font-size: 0.78rem;
  color: var(--pm-muted) !important;
  opacity: 1 !important;
}

.page-category .card.product-card .card-body h6 small {
  font-size: 0.82rem !important;
  line-height: 1.35;
  color: var(--pm-muted) !important;
}

.page-category .card.product-card .product-price {
  margin-top: auto;
  padding-top: 0.5rem;
  text-align: left;
  font-size: 1.15rem;
  font-weight: 800;
}

.page-category .card.product-card .price_base,
.page-category .card.product-card .price.price-new {
  color: var(--pm-accent);
  background: transparent;
  padding: 0;
}

.page-category .card.product-card span.price.price-old {
  display: inline-block;
  margin-right: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--pm-muted);
}

.page-category .card.product-card .labels {
  top: 0.65rem;
  left: 0;
  gap: 0.25rem;
}

.page-category .card.product-card .labels span {
  padding: 0.35rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  border-radius: 0 8px 8px 0;
  opacity: 1;
}

.page-category .card.product-card span.saleExpire {
  top: auto;
  bottom: 0.5rem;
  right: 0.5rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.95;
}

.page-category .card.product-card .btn_group__favorite_cart {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.page-category .card.product-card .btn_favorite,
.page-category .card.product-card .btn_cart {
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(50, 25, 17, 0.12);
}

.page-category .card .polishes {
  margin-top: 0.35rem;
}

.page-category .card .polishes span {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  border: 2px solid rgba(93, 64, 55, 0.15);
}

/* SEO-текст внизу */
.page-category .category_full_info {
  margin-top: 2rem;
  padding: 1.35rem 1.5rem;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--pm-text);
  background: #fff;
  border: 1px solid rgba(93, 64, 55, 0.08);
  border-radius: 18px;
  box-shadow: var(--pm-shadow);
}

.page-category .category_full_info h2,
.page-category .category_full_info h3 {
  color: var(--pm-primary);
  font-weight: 800;
}

/* Trust */
.page-category section.home-trust.bottom-cards-icon {
  margin-top: 0;
  padding: 2.5rem 0 3rem;
  background: #fff;
}

/* ── Мобільний ── */
@media (max-width: 767.98px) {
  .page-category .row.category-product {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
  }

  .page-category .category_tag_container {
    grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
    padding: 0.85rem;
    gap: 0.65rem;
  }

  .page-category .category-page__toolbar form {
    flex-direction: column;
    align-items: stretch !important;
  }

  .page-category .category-page__toolbar .col-auto {
    width: 100%;
    max-width: 100%;
  }

  .page-category .category-page__toolbar .form-control,
  .page-category .category-page__toolbar .custom-select {
    width: 100%;
  }

  .page-category .card.product-card .card-title {
    min-height: 2.5rem;
    font-size: 0.92rem;
  }

  .page-category .card.product-card .product-price {
    font-size: 1.05rem;
  }
}

@media (min-width: 1200px) {
  .page-category .row.category-product {
    grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
  }
}
