/* IVO-CATALOG-POLISH-20261024 — каталожна страница (магазин, категории, тагове, търсене): един вид за всички магазини.
   Зарежда се само там (виж functions.php на темата). Част от правилата са пренесени от CATALOG-20260902 на tuasolea.bg.
   Спиране: махни реда ivo-catalog-polish от functions.php (файловете могат да останат). */

/* 1) Оценката (звездите) не се показва в каталога — структурираните данни за Google не се пипат */
body.archive .products .star-rating,
body.woocommerce-shop .products .star-rating,
body.search .products .star-rating,
body.archive .product-small .star-rating { display: none !important; }

/* 2) Име и описание на картата: моделът на свой ред, описанието — най-много 2 реда (преди: 1 ред с точки и цветът се губеше) */
.product-small .product-title.ivo-loop-title {
  overflow: visible;
  white-space: normal;
  line-height: 1.25;
  font-weight: 500;
  height: auto;
}
.product-small .ivo-loop-title .ivo-loop-link { display: block; min-width: 0; max-width: 100%; color: inherit; }
.product-small .ivo-loop-title .ivo-loop-model {
  display: block;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.product-small .ivo-loop-title .ivo-loop-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  font-size: 12px;
  font-weight: 400;
  min-height: 2.5em;
}

/* 3) Размерите в картата: един шрифт (на някои сайтове беше „emoji“ → сериф), без запетаи, по-леки */
.ux-swatches-in-loop,
.ux-swatches-in-loop *,
.ux-swatches-in-loop .ux-swatch__text { font-family: inherit !important; }
.ux-swatches-in-loop {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 8px !important;
  margin: 6px 0 4px;
}
.ux-swatches-in-loop .ux-swatch {
  padding: 0 !important;
  min-width: 0;
  background: none;
  border: 0;
  box-shadow: none;
  color: #444;
  line-height: 1.4 !important;
  text-decoration: none;
}
.ux-swatches-in-loop .ux-swatch,
.ux-swatches-in-loop .ux-swatch * {
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: .01em;
}
.ux-swatches-in-loop .ux-swatch::after,
.ux-swatches-in-loop .ux-swatch__text::after { content: none !important; }
.ux-swatches-in-loop .ux-swatch.out-of-stock { opacity: .35; text-decoration: line-through; }

/* 4) Лентата с пътечка, „Филтър“ и сортиране — на един ред, без излизане от екрана (телефон/таблет) */
@media (max-width: 849px) {
  .shop-page-title .page-title-inner {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px 10px;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px 12px 10px !important;
  }
  .shop-page-title .page-title-inner > .flex-col { display: contents !important; }
  .shop-page-title .page-title-inner .is-smaller { grid-column: 1 / -1; text-align: center; order: 1; }
  .shop-page-title .page-title-inner h1 { grid-column: 1 / -1; order: 2; margin: 2px 0 4px; }
  .shop-page-title .category-filtering { grid-column: 1; order: 3; position: static !important; max-width: none !important; left: auto !important; top: auto !important; width: auto !important; margin: 0 !important; padding: 0 !important; }
  .shop-page-title form.woocommerce-ordering { grid-column: 2; order: 3; margin: 0 !important; width: 100%; max-width: 100%; min-width: 0; }
  .shop-page-title form.woocommerce-ordering select.orderby { width: 100% !important; max-width: 100% !important; height: 44px; margin: 0 !important; box-sizing: border-box; font-size: 14px !important; padding: 0 32px 0 12px !important; text-overflow: ellipsis; }
  .shop-page-title .filter-button { display: inline-flex; align-items: center; height: 44px; margin: 0 !important; }
  .shop-page-title .woocommerce-result-count { display: none !important; }
}

/* 5) Иконата за бисквитки (Borlabs) — по-малка и по-бледа, да не покрива размерите и цените в долния ляв ъгъл */
.brlbs-cmpnt-widget.brlbs-bottom-0.brlbs-left-0 { width: 46px !important; height: 46px !important; opacity: .55; }
.brlbs-cmpnt-widget.brlbs-bottom-0.brlbs-left-0 svg { width: 100% !important; height: 100% !important; }
.brlbs-cmpnt-widget.brlbs-bottom-0.brlbs-left-0:hover,
.brlbs-cmpnt-widget.brlbs-bottom-0.brlbs-left-0:focus,
.brlbs-cmpnt-widget.brlbs-bottom-0.brlbs-left-0:focus-within { opacity: 1; }

/* 6) Описание на категорията — свито на телефон (бутон „Покажи повече“ от ivo-catalog-polish.js) */
@media (max-width: 849px) {
  .term-description.ivo-desc-collapsible { font-size: 14px; line-height: 1.55; }
  .term-description.ivo-desc-collapsible:not(.is-open) {
    max-height: 4.7em;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(#000 55%, transparent);
    mask-image: linear-gradient(#000 55%, transparent);
  }
  .ivo-desc-toggle {
    display: block;
    margin: 4px 0 12px;
    padding: 6px 0;
    background: none;
    border: 0;
    color: inherit;
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
  }
}
