/* Перший шар — каталог: кружечки родини, фільтри, «Часто беруть разом»,
   аналоги, згорнутий опис. Окремий файл: fl.css паралельно правлять інші. */

/* ── позначка «Хіт продажу» ────────────────────────────────── */
.fl-badge-hit { background: var(--fl-navy); color: var(--fl-neon); }

/* ── немає в наявності — сіре й приглушене, як на «Жовтому квадраті»:
   одразу видно, що зараз не купиш. Позначки (.fl-flags) лишаються яскравими,
   щоб «Скоро в наявності» читалось. ─────────────────────────── */
ul.products li.product.outofstock img { filter: grayscale(1); opacity: .5; transition: opacity .2s; }
ul.products li.product.outofstock:hover img { opacity: .7; }
ul.products li.product.outofstock .woocommerce-loop-product__title,
ul.products li.product.outofstock .woocommerce-loop-product__title a { color: var(--fl-muted) !important; }
ul.products li.product.outofstock .fl-fam-dots,
ul.products li.product.outofstock .fl-card-specs { filter: grayscale(1); opacity: .6; }
ul.products li.product.outofstock .price,
ul.products li.product.outofstock .price * { color: var(--fl-muted) !important; }

/* ── кружечки родини на сторінці товару ────────────────────── */
.fl-fam { margin: 4px 0 20px; }
.fl-fam-h { margin-bottom: 10px; font-size: 14px; color: var(--fl-muted); }
.fl-fam-h b { color: var(--fl-ink); font-weight: 700; }
.fl-fam-list { display: flex; flex-wrap: wrap; gap: 10px; }
.fl-fam-sw {
  position: relative; width: 40px; height: 40px; padding: 3px;
  display: grid; place-items: center; border-radius: 50%;
  border: 2px solid transparent; transition: border-color .16s, transform .16s;
}
.fl-fam-sw i { display: block; width: 100%; height: 100%; border-radius: 50%; border: 1px solid rgba(8, 28, 51, .16); }
a.fl-fam-sw:hover { border-color: var(--fl-line); transform: translateY(-1px); }
.fl-fam-sw.fl-on { border-color: var(--fl-green); box-shadow: 0 0 0 3px var(--fl-green-lt); }
/* немає в наявності — перекреслено, але клікабельно: там можна дізнатися про надходження */
.fl-fam-sw.fl-oos i { opacity: .45; }
.fl-fam-sw.fl-oos::after {
  content: ""; position: absolute; left: 6px; right: 6px; top: 50%;
  height: 2px; background: var(--fl-muted); transform: rotate(-45deg); border-radius: 2px;
}

/* ── міні-кружечки на картці ───────────────────────────────── */
.fl-fam-dots { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 2px 0 8px; }
.fl-fam-dots i, .fl-fam-dots a {
  display: block; width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid rgba(8, 28, 51, .16);
}
.fl-fam-dots a { transition: transform .14s; }
.fl-fam-dots a:hover { transform: scale(1.25); }
.fl-fam-dots i.fl-on { box-shadow: 0 0 0 2px var(--fl-card), 0 0 0 3px var(--fl-green); }

/* ── фільтри в бічній панелі ───────────────────────────────── */
.fl-flts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin: 4px 0 22px; padding-top: 18px; border-top: 1px solid var(--fl-line); }
/* поля числа мають вбудовану мінімальну ширину (~20 символів) і розпирали
   сітку за межі панелі — тому min-width:0 скрізь по ланцюжку */
.fl-flt, .fl-flt-price label, .fl-flt-price input, .fl-flt-c, .fl-flt-opts a { min-width: 0; }
.fl-flt h4 { margin-bottom: 9px !important; }
.fl-side .fl-flt ul.fl-flt-opts { margin: 0; gap: 1px; }
.fl-side .fl-flt-opts a {
  display: flex; align-items: center; gap: 9px; padding: 6px 8px; font-size: 14px;
}
.fl-flt-box {
  flex: 0 0 auto; width: 16px; height: 16px; border-radius: 4px;
  border: 1.5px solid var(--fl-line); background: var(--fl-card); position: relative;
}
.fl-flt-opts a.fl-on .fl-flt-box { background: var(--fl-green); border-color: var(--fl-green); }
.fl-flt-opts a.fl-on .fl-flt-box::after {
  content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.fl-side .fl-flt-opts a.fl-on { background: transparent; color: var(--fl-ink); font-weight: 700; }
.fl-flt-opts span, .fl-flt-c span { flex: 1 1 auto; min-width: 0; }
.fl-flt small, .fl-flt-c small {
  font-family: var(--fl-m); font-size: 11px; color: var(--fl-muted); font-weight: 400;
}

.fl-flt-colors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.fl-flt-c span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-flt-c {
  display: flex; align-items: center; gap: 7px; padding: 6px 7px;
  border: 1px solid transparent; border-radius: var(--fl-r-sm);
  font-size: 13.5px; color: var(--fl-ink); transition: .14s;
}
.fl-flt-c i { flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(8, 28, 51, .18); }
.fl-flt-c:hover { background: var(--fl-tint2); }
.fl-flt-c.fl-on { border-color: var(--fl-green); background: var(--fl-green-lt); font-weight: 700; }

.fl-flt-price { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fl-flt-price label { display: grid; gap: 3px; }
.fl-flt-price label span { font-family: var(--fl-m); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--fl-muted); }
.fl-flt-price input {
  width: 100%; padding: 8px 10px; border: 2px solid var(--fl-line); border-radius: var(--fl-r-sm);
  background: var(--fl-card); font: 14px var(--fl-b); color: var(--fl-ink); -moz-appearance: textfield;
}
.fl-flt-price input:focus { border-color: var(--fl-green); outline: none; }
.fl-flt-price input::-webkit-outer-spin-button, .fl-flt-price input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.fl-flt-price .fl-btn { grid-column: 1 / -1; padding: 9px 12px; font-size: 13.5px; }

/* ── обрані фільтри над сіткою ─────────────────────────────── */
.fl-actf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -6px 0 18px; }
.fl-actf-c {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px;
  border-radius: 999px; background: var(--fl-green-lt); color: var(--fl-green-dk);
  font-size: 13px; font-weight: 700; transition: .14s;
}
.fl-actf-c em { font-style: normal; font-weight: 400; }
.fl-actf-c i {
  display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(30, 138, 44, .15); font-style: normal; font-size: 14px; line-height: 1;
}
.fl-actf-c:hover { background: #d6efd9; }
.fl-actf-x { font-size: 13px; color: var(--fl-muted); text-decoration: underline; text-underline-offset: 3px; }
.fl-actf-x:hover { color: var(--fl-coral); }

/* ── згорнутий опис ────────────────────────────────────────── */
.fl-desc-ready .fl-desc-clip {
  position: relative; max-height: 260px; overflow: hidden;
  transition: max-height .35s ease;
}
.fl-desc-ready .fl-desc-clip::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 110px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--fl-card) 88%);
  pointer-events: none; transition: opacity .25s;
}
.fl-desc.fl-desc-open .fl-desc-clip { max-height: none; }
.fl-desc.fl-desc-open .fl-desc-clip::after { opacity: 0; }
.fl-desc-more {
  display: none; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 18px !important;
  border: 1px solid var(--fl-line) !important; border-radius: 999px !important;
  background: var(--fl-card) !important; color: var(--fl-ink) !important;
  font: 700 14px var(--fl-b) !important; cursor: pointer; transition: .16s;
}
.fl-desc-more::after {
  content: ""; width: 8px; height: 8px; border: solid currentColor; border-width: 0 2px 2px 0;
  transform: translateY(-2px) rotate(45deg); transition: transform .2s;
}
.fl-desc-more:hover { border-color: var(--fl-green) !important; color: var(--fl-green-dk) !important; }
.fl-desc-ready .fl-desc-more { display: inline-flex; }
.fl-desc-ready .fl-desc.fl-desc-short .fl-desc-more { display: none; }
.fl-desc-ready .fl-desc.fl-desc-short .fl-desc-clip { max-height: none; }
.fl-desc-ready .fl-desc.fl-desc-short .fl-desc-clip::after { display: none; }
.fl-dm-b { display: none; }
.fl-desc-open .fl-dm-a { display: none; }
.fl-desc-open .fl-dm-b { display: inline; }
.fl-desc-open .fl-desc-more::after { transform: translateY(2px) rotate(-135deg); }

/* ── «Часто беруть разом» ──────────────────────────────────── */
.fl-fbt {
  margin: 34px 0; padding: 24px; border: 1px solid var(--fl-line);
  border-radius: var(--fl-r-card); background: var(--fl-soft); box-shadow: var(--fl-shadow);
}
.fl-fbt-head h2 { margin: 0; font-size: clamp(20px, 2.4vw, 25px); }
.fl-fbt-head p { margin: 6px 0 18px; color: var(--fl-muted); font-size: 15px; }
.fl-fbt-row { display: flex; align-items: stretch; gap: 10px; }
.fl-fbt-i {
  position: relative; flex: 1 1 0; min-width: 0; display: grid; gap: 8px; align-content: start;
  padding: 12px; border: 2px solid var(--fl-line); border-radius: var(--fl-r-sm);
  background: var(--fl-card); cursor: pointer; transition: border-color .16s, opacity .16s;
}
.fl-fbt-i:has(input:checked) { border-color: var(--fl-green); }
.fl-fbt-i:not(:has(input:checked)), .fl-fbt-i.fl-off { opacity: .55; border-color: var(--fl-line); }
.fl-fbt-i input { position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; accent-color: var(--fl-green); margin: 0; }
.fl-fbt-img img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 8px; background: var(--fl-tint); }
.fl-fbt-t { font-size: 13.5px; line-height: 1.4; color: var(--fl-ink); }
.fl-fbt-t em {
  display: block; margin-bottom: 3px; font-style: normal; font-family: var(--fl-m);
  font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--fl-green-dk);
}
.fl-fbt-t a {
  color: inherit; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.fl-fbt-t a:hover { color: var(--fl-green-dk); }
.fl-fbt-p { font-family: var(--fl-h); font-weight: 800; font-size: 16px; color: var(--fl-ink); }
.fl-fbt-plus {
  flex: 0 0 auto; align-self: center; width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 50%; background: var(--fl-tint); color: var(--fl-muted); font-weight: 800; font-size: 18px;
}
.fl-fbt-sum {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 16px;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--fl-line);
}
.fl-fbt-lbl { color: var(--fl-muted); font-size: 15px; }
.fl-fbt-total { font-family: var(--fl-h); font-size: 22px; font-weight: 800; color: var(--fl-ink); }
.fl-fbt-sum .fl-btn:disabled { opacity: .5; cursor: default; }

/* ── аналоги й доп. товари ─────────────────────────────────── */
.fl-analogs, .fl-acc { margin: 34px 0; }
.fl-analogs .fl-head2, .fl-acc .fl-head2 { margin-bottom: 18px; }

/* ── телефон ───────────────────────────────────────────────── */
@media (max-width: 760px) {
  .fl-fam-sw { width: 44px; height: 44px; }
  .fl-flt-colors { grid-template-columns: 1fr 1fr; }
  .fl-flt-c, .fl-side .fl-flt-opts a { min-height: 40px; }
  .fl-fbt { padding: 18px 14px; margin: 26px 0; }
  .fl-fbt-row { flex-direction: column; gap: 8px; }
  .fl-fbt-i { grid-template-columns: 72px 1fr; grid-template-rows: auto auto; align-items: center; padding: 10px 40px 10px 10px; }
  .fl-fbt-img { grid-row: 1 / 3; }
  .fl-fbt-p { font-size: 15px; }
  .fl-fbt-plus { width: 26px; height: 26px; font-size: 16px; }
  .fl-fbt-sum { justify-content: space-between; }
  .fl-fbt-sum .fl-btn { width: 100%; justify-content: center; }
  .fl-actf { margin-top: 0; }
}
