/* ═══════════════════════════════════════════════════════════════════════
   NanoFarm · КАРТОЧКА ТОВАРА «ЦВЕТ ПРИБОРА»  (.nf-dc)
   Окно фото окрашено в цвет самого прибора (--dc-tint / --dc-accent
   вычисляются из фото в app.js → nfApplyDeviceTint). Каталог, страница
   партнёра, «Популярная продукция». Подключается последним.
   ═══════════════════════════════════════════════════════════════════════ */

html body .nf-dc {
  --dc-tint: 238, 240, 240;
  --dc-accent: 77, 160, 169;
  --dc-card: #ffffff;
  --dc-line: rgba(55, 53, 54, 0.1);
  --dc-text: #1f1e1f;
  --dc-muted: #6f6c6a;
  position: relative;
  display: flex !important;
  flex-direction: column !important;
  min-width: 0;
  padding: 0 !important;
  background: var(--dc-card) !important;
  background-image: none !important;
  border: 1px solid var(--dc-line) !important;
  border-radius: 18px !important;
  overflow: hidden !important;
  box-shadow: none !important;
  cursor: pointer;
  color: var(--dc-text);
  text-align: left;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s, border-color 0.35s !important;
}
html[data-theme="dark"] body .nf-dc {
  --dc-card: #242324;
  --dc-line: rgba(255, 255, 255, 0.08);
  --dc-text: #f2f1f0;
  --dc-muted: #a6a3a1;
}
html body .nf-dc:focus-visible { outline: 2px solid rgb(var(--dc-accent)); outline-offset: 3px; }

/* окно фото */
html body .nf-dc .nf-dc__win {
  position: relative;
  aspect-ratio: 4 / 3.1;
  background: rgb(var(--dc-tint)) !important;
  overflow: hidden;
  transition: background-color 0.4s;
}
html body .nf-dc .nf-dc__win::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: rgb(var(--dc-accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
html body .nf-dc .nf-dc__win img.nf-dc__img {
  position: absolute;
  inset: 8% 8% 6%;
  width: 84% !important;
  height: 86% !important;
  max-width: none !important;
  object-fit: contain !important;
  background: none !important;
  filter: none !important;
  border-radius: 0 !important;
  mix-blend-mode: multiply !important;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* текст */
html body .nf-dc .nf-dc__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 16px 18px 18px;
  background: transparent !important;
}
html body .nf-dc .nf-dc__brand {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dc-muted) !important;
}
html body .nf-dc .nf-dc__name {
  margin: 6px 0 2px !important;
  font-size: 19px !important;
  line-height: 1.2 !important;
  font-weight: 650 !important;
  letter-spacing: -0.01em;
  color: var(--dc-text) !important;
  overflow-wrap: anywhere;
}
html body .nf-dc .nf-dc__kind { font-size: 13px; color: var(--dc-muted) !important; }
html body .nf-dc .nf-dc__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
}

/* наличие */
html body .nf-dc .nf-dc__st { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--dc-muted) !important; }
html body .nf-dc .nf-dc__st i { width: 7px; height: 7px; border-radius: 50%; background: #9a9795; flex: none; }
html body .nf-dc .nf-dc__st--in { color: #2fa36a !important; }
html body .nf-dc .nf-dc__st--in i { background: #3fbf7f; box-shadow: 0 0 0 3px rgba(63, 191, 127, 0.18); }
html[data-theme="dark"] body .nf-dc .nf-dc__st--in { color: #6fd39b !important; }

/* круглая кнопка «в запрос» */
html body .nf-dc .nf-dc__req {
  position: relative;
  flex: none;
  width: 40px; height: 40px;
  padding: 0 !important;
  border-radius: 50% !important;
  border: 1px solid var(--dc-line) !important;
  background: transparent !important;
  color: var(--dc-text) !important;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: none !important;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s, transform 0.2s !important;
}
html body .nf-dc .nf-dc__req:active { transform: scale(0.94); }
html body .nf-dc .nf-dc__ico { grid-area: 1 / 1; transition: opacity 0.25s, transform 0.3s; }
html body .nf-dc .nf-dc__ico--done { opacity: 0; transform: scale(0.6); }
html body .nf-dc .nf-dc__req.nf-add-request--in-cart {
  background: rgb(var(--dc-accent)) !important;
  border-color: transparent !important;
  color: #fff !important;
}
html body .nf-dc .nf-dc__req.nf-add-request--in-cart .nf-dc__ico--add { opacity: 0; transform: scale(0.6) rotate(90deg); }
html body .nf-dc .nf-dc__req.nf-add-request--in-cart .nf-dc__ico--done { opacity: 1; transform: none; }

/* наведение: полоска, тень и кнопка — в цвет прибора */
@media (hover: hover) {
  html body .nf-dc:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--dc-accent), 0.45) !important;
    box-shadow: 0 22px 40px -24px rgba(var(--dc-accent), 0.55) !important;
  }
  html body .nf-dc:hover .nf-dc__win::after { transform: scaleX(1); }
  html body .nf-dc:hover .nf-dc__win img.nf-dc__img { transform: scale(1.04); }
  html body .nf-dc:hover .nf-dc__req,
  html body .nf-dc .nf-dc__req:hover {
    background: rgb(var(--dc-accent)) !important;
    border-color: transparent !important;
    color: #fff !important;
  }
}

/* ── сетки ── */
html body #catalogProducts.nf-products-grid-mode,
html body #catalogProducts.nf-products-large {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)) !important;
  gap: 18px !important;
}
html body #catalogProducts.nf-products-large { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important; }
html body .nf-ps2-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)) !important;
  gap: 18px !important;
}

/* список: фото слева, текст справа */
html body #catalogProducts.nf-products-list-mode { display: flex !important; flex-direction: column !important; gap: 14px !important; }
html body #catalogProducts.nf-products-list-mode .nf-dc { flex-direction: row !important; }
html body #catalogProducts.nf-products-list-mode .nf-dc .nf-dc__win { width: 220px; flex: none; aspect-ratio: auto; min-height: 160px; }
html body #catalogProducts.nf-products-list-mode .nf-dc .nf-dc__win::after { top: 0; bottom: 0; left: auto; right: 0; width: 3px; height: auto; transform: scaleY(0); transform-origin: top; }
html body #catalogProducts.nf-products-list-mode .nf-dc:hover .nf-dc__win::after { transform: scaleY(1); }

/* «Популярная продукция»: карусель */
html body .nf-popular__track--carousel .nf-dc.nf-popular-card { width: 260px !important; flex: 0 0 auto !important; opacity: 1; }
html body .nf-popular__track .nf-dc.nf-popular-card:hover { transform: translateY(-4px); }

@media (max-width: 560px) {
  html body #catalogProducts.nf-products-grid-mode,
  html body #catalogProducts.nf-products-large,
  html body .nf-ps2-grid { grid-template-columns: 1fr !important; }
  html body #catalogProducts.nf-products-list-mode .nf-dc { flex-direction: column !important; }
  html body #catalogProducts.nf-products-list-mode .nf-dc .nf-dc__win { width: auto; aspect-ratio: 4 / 3.1; min-height: 0; }
  html body .nf-dc .nf-dc__name { font-size: 18px !important; }
}
@media (prefers-reduced-motion: reduce) {
  html body .nf-dc,
  html body .nf-dc * { transition: none !important; }
}

/* ═══ Наличие на странице товара: спокойная метка с точкой, без капса ═══ */
html body .nf-epdp-hero__chips .nf-epdp-status-glow {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  height: 30px !important;
  padding: 0 12px 0 10px !important;
  border-radius: 999px !important;
  border: 0 !important;
  box-shadow: none !important;
  background: rgba(55, 53, 54, 0.06) !important;
  color: #5d5a58 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  animation: none !important;
}
html body .nf-epdp-hero__chips .nf-epdp-status-glow::before {
  content: "" !important;
  position: static !important;
  display: block !important;
  width: 7px !important;
  height: 7px !important;
  border-radius: 50% !important;
  background: #9a9795 !important;
  box-shadow: none !important;
  animation: none !important;
  inset: auto !important;
  opacity: 1 !important;
  flex: none;
}
html body .nf-epdp-hero__chips .nf-epdp-status-glow::after { display: none !important; }
html body .nf-epdp-hero__chips .nf-epdp-status-glow--in { background: rgba(63, 191, 127, 0.1) !important; color: #23865a !important; }
html body .nf-epdp-hero__chips .nf-epdp-status-glow--in::before { background: #3fbf7f !important; box-shadow: 0 0 0 3px rgba(63, 191, 127, 0.2) !important; }
html[data-theme="dark"] body .nf-epdp-hero__chips .nf-epdp-status-glow { background: rgba(255, 255, 255, 0.06) !important; color: #a6a3a1 !important; border: 0 !important; }
html[data-theme="dark"] body .nf-epdp-hero__chips .nf-epdp-status-glow--in { background: rgba(63, 191, 127, 0.12) !important; color: #6fd39b !important; }

/* ═══ Хлебные крошки каталога ═══ */
html body .nf-catalog-explorer__breadcrumb {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap;
  gap: 2px !important;
  margin-bottom: 14px !important;
  font-size: 13px !important;
}
html body .nf-catalog-explorer__breadcrumb .nf-bc__item {
  padding: 4px 8px !important;
  margin: 0 !important;
  border-radius: 8px !important;
  background: none !important;
  border: 0 !important;
  font: inherit !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #7a7775 !important;
  text-decoration: none !important;
  box-shadow: none !important;
}
html body .nf-catalog-explorer__breadcrumb .nf-bc__item:first-child { margin-left: -8px !important; }
html body .nf-catalog-explorer__breadcrumb .nf-bc__item--link { cursor: pointer; transition: background-color 0.2s, color 0.2s; }
html body .nf-catalog-explorer__breadcrumb .nf-bc__item--link:hover { background: rgba(77, 160, 169, 0.1) !important; color: #2f7f88 !important; }
html body .nf-catalog-explorer__breadcrumb .nf-bc__item--active { color: #1f1e1f !important; font-weight: 600 !important; }
html body .nf-catalog-explorer__breadcrumb .nf-bc__sep { display: inline-flex !important; align-items: center; color: #c4c1bf !important; }
html body .nf-catalog-explorer__breadcrumb .nf-bc__sep svg { display: none !important; }
html body .nf-catalog-explorer__breadcrumb .nf-bc__sep::before { content: "/"; font-size: 13px; }
html[data-theme="dark"] body .nf-catalog-explorer__breadcrumb .nf-bc__item { color: #a6a3a1 !important; }
html[data-theme="dark"] body .nf-catalog-explorer__breadcrumb .nf-bc__item--active { color: #f2f1f0 !important; }
html[data-theme="dark"] body .nf-catalog-explorer__breadcrumb .nf-bc__item--link:hover { color: #6fb8c0 !important; }
html[data-theme="dark"] body .nf-catalog-explorer__breadcrumb .nf-bc__sep { color: rgba(255, 255, 255, 0.22) !important; }

/* ═══ Отступ заголовка каталога от шапки ═══ */
/* блок был подтянут вверх (margin-top:-84px) и крошки уходили под шапку */
html body .nf-catalog-explorer { margin-top: -20px !important; }
html body .nf-catalog-explorer__head { padding-top: 36px !important; padding-bottom: 24px !important; }
@media (max-width: 768px) { html body .nf-catalog-explorer__head { padding-top: 24px !important; } }

/* ═══ Сортировка и вид каталога ═══ */
html body .nf-toolbar-right {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 0 !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
}
html body .nf-toolbar-right .nf-toolbar-sort {
  position: relative;
  display: flex !important;
  align-items: center !important;
  height: 40px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  border: 1px solid rgba(55, 53, 54, 0.12) !important;
  background: #fff !important;
  box-shadow: none !important;
  transition: border-color 0.2s;
}
html body .nf-toolbar-right .nf-toolbar-sort:hover { border-color: rgba(77, 160, 169, 0.5) !important; }
html body .nf-toolbar-right .nf-toolbar-sort > svg:first-child { display: none !important; }
html body .nf-toolbar-right .nf-toolbar-sort > svg:last-child {
  display: block !important;
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #7a7775;
  width: 14px;
  height: 14px;
}
html body .nf-toolbar-right .nf-select-shell { background: none !important; border: 0 !important; box-shadow: none !important; }
html body .nf-toolbar-right .nf-select-display {
  height: 38px !important;
  padding: 0 38px 0 16px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: none !important;
  box-shadow: none !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: #1f1e1f !important;
}
html body .nf-toolbar-right .nf-select-display::before { content: "Сортировка: "; font-weight: 500; color: #7a7775; white-space: pre; }
html body .nf-toolbar-right .nf-select-display::after { display: none !important; }
html body .nf-toolbar-right .nf-select-menu {
  min-width: 220px !important;
  margin-top: 6px !important;
  padding: 6px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(55, 53, 54, 0.1) !important;
  background: #fff !important;
  box-shadow: 0 18px 40px -18px rgba(31, 30, 31, 0.3) !important;
}
html body .nf-toolbar-right .nf-select-option {
  display: block !important;
  width: 100% !important;
  text-align: left !important;
  padding: 9px 12px !important;
  border-radius: 9px !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  color: #1f1e1f !important;
  background: none !important;
}
html body .nf-toolbar-right .nf-select-option:hover { background: rgba(55, 53, 54, 0.05) !important; }
html body .nf-toolbar-right .nf-select-option.is-active { background: rgba(77, 160, 169, 0.1) !important; color: #2f7f88 !important; font-weight: 600 !important; }

html body .nf-toolbar-right .nf-toolbar-view {
  display: flex !important;
  gap: 2px !important;
  padding: 3px !important;
  height: 40px !important;
  border-radius: 999px !important;
  background: rgba(55, 53, 54, 0.06) !important;
  border: 0 !important;
  box-shadow: none !important;
}
html body .nf-toolbar-right .nf-toolbar-view__btn {
  width: 40px !important;
  height: 34px !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: #8a8785 !important;
  box-shadow: none !important;
  transition: background-color 0.25s, color 0.25s, box-shadow 0.25s !important;
}
html body .nf-toolbar-right .nf-toolbar-view__btn:hover { color: #1f1e1f !important; }
html body .nf-toolbar-right .nf-toolbar-view__btn.is-active {
  background: #fff !important;
  color: #2f7f88 !important;
  box-shadow: 0 1px 2px rgba(31, 30, 31, 0.08), 0 4px 10px -4px rgba(31, 30, 31, 0.18) !important;
}
html body .nf-toolbar-right .nf-toolbar-view__btn svg { width: 16px !important; height: 16px !important; }

html[data-theme="dark"] body .nf-toolbar-right .nf-toolbar-sort { background: #242324 !important; border-color: rgba(255, 255, 255, 0.1) !important; }
html[data-theme="dark"] body .nf-toolbar-right .nf-select-display { color: #f2f1f0 !important; }
html[data-theme="dark"] body .nf-toolbar-right .nf-select-display::before,
html[data-theme="dark"] body .nf-toolbar-right .nf-toolbar-sort > svg:last-child { color: #a6a3a1 !important; }
html[data-theme="dark"] body .nf-toolbar-right .nf-select-menu { background: #2e2d2e !important; border-color: rgba(255, 255, 255, 0.1) !important; box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.8) !important; }
html[data-theme="dark"] body .nf-toolbar-right .nf-select-option { color: #f2f1f0 !important; }
html[data-theme="dark"] body .nf-toolbar-right .nf-select-option:hover { background: rgba(255, 255, 255, 0.05) !important; }
html[data-theme="dark"] body .nf-toolbar-right .nf-select-option.is-active { color: #6fb8c0 !important; background: rgba(77, 160, 169, 0.14) !important; }
html[data-theme="dark"] body .nf-toolbar-right .nf-toolbar-view { background: rgba(255, 255, 255, 0.06) !important; }
html[data-theme="dark"] body .nf-toolbar-right .nf-toolbar-view__btn { color: #a6a3a1 !important; }
html[data-theme="dark"] body .nf-toolbar-right .nf-toolbar-view__btn:hover { color: #f2f1f0 !important; }
html[data-theme="dark"] body .nf-toolbar-right .nf-toolbar-view__btn.is-active { background: #383738 !important; color: #6fb8c0 !important; box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.6) !important; }
html[lang^="en"] body .nf-toolbar-right .nf-select-display::before { content: "Sort: "; }
html[lang^="kk"] body .nf-toolbar-right .nf-select-display::before,
html[lang^="kz"] body .nf-toolbar-right .nf-select-display::before { content: "Сұрыптау: "; }
