/*
 * JessTech Color Swatch — stil din designul 2026 (negru/galben/alb/gri).
 * Fontul se moștenește din temă.
 */
:root {
  --jcs-ink: #1d1d1d;
  --jcs-muted: #6b6b6b;
  --jcs-line: #e3e3e3;
  --jcs-edge: rgba(0, 0, 0, .22);
  --jcs-focus: #ffdd00;
}

.jcs__sw {
  --jcs-size: 22px;
  display: inline-block;
  flex: none;
  width: var(--jcs-size);
  height: var(--jcs-size);
  border-radius: 6px;
  background: var(--jcs-c, #ccc);
  border: 1px solid var(--jcs-edge);
  box-sizing: border-box;
}
.jcs__sw--metal {
  background: linear-gradient(135deg, rgba(255, 255, 255, .6) 0%, rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, .18) 100%), var(--jcs-c, #ccc);
}

/* ---------------- Card ---------------- */
.jcs--card { margin: 8px 0 4px; }
.jcs--card .jcs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.jcs--card button.jcs__sw {
  /* zonă de atingere de 30px, mostra rămâne de 22px */
  width: 30px;
  height: 30px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  position: relative;
}
.jcs--card button.jcs__sw::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 6px;
  background: var(--jcs-c, #ccc);
  border: 1px solid var(--jcs-edge);
}
.jcs--card button.jcs__sw--metal::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, .6) 0%, rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, .18) 100%), var(--jcs-c, #ccc);
}
.jcs--card button.jcs__sw.is-active { box-shadow: inset 0 0 0 2px var(--jcs-ink); }
.jcs--card button.jcs__sw:hover:not(.is-active) { box-shadow: inset 0 0 0 1px var(--jcs-muted); }
.jcs--card button.jcs__sw:focus-visible { outline: 3px solid var(--jcs-focus); outline-offset: 1px; }
.jcs__more {
  font-size: 12px;
  font-weight: 700;
  color: var(--jcs-muted);
  padding: 0 4px;
  line-height: 30px;
  text-decoration: none;
}
.jcs__more:hover { color: var(--jcs-ink); }

/* Swatch-urile temei (bulinele vechi) dispar unde avem ale noastre. */
.js-product-miniature:has(.jcs--card) .products-variants { display: none !important; }
/* După alegerea unei culori nu mai arătăm a doua poză la hover (ar fi a altei culori). */
.jcs-picked .product-thumbnail-second { display: none !important; }

/* ---------------- Pagina de produs ---------------- */
.jcs--page { margin: 16px 0 20px; }
.jcs__head,
.product-variants-item.jcs-native .form-control-label {
  display: block;
  font-size: 14px;
  color: var(--jcs-muted);
  margin-bottom: 10px;
  font-weight: 400;
}
.jcs__head strong,
.jcs-native .jcs__current { color: var(--jcs-ink); font-weight: 700; }

.jcs--page .jcs__list,
.product-variants-item.jcs-native ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.jcs__opt,
.product-variants-item.jcs-native li {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 16px 0 8px;
  border-radius: 12px;
  border: 2px solid var(--jcs-line);
  background: #fff;
  color: var(--jcs-ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  margin: 0 !important;
  float: none !important;
  transition: border-color .12s ease;
}
.jcs__opt .jcs__sw,
.product-variants-item.jcs-native .color {
  --jcs-size: 32px;
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  border: 1px solid #d6d6d6 !important;
  margin: 0 !important;
  box-shadow: none !important;
}
a.jcs__opt:hover,
.product-variants-item.jcs-native li:hover { border-color: var(--jcs-muted); color: var(--jcs-ink); }
.jcs__opt.is-active,
.product-variants-item.jcs-native li:has(input:checked) { border-color: var(--jcs-ink); }
a.jcs__opt:focus-visible,
.product-variants-item.jcs-native li:has(input:focus-visible) { outline: 3px solid var(--jcs-focus); outline-offset: 2px; }

/* Blocul nativ: input-ul radio acoperă tot butonul, ca toată pastila să fie clicabilă. */
.product-variants-item.jcs-native .input-color {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.product-variants-item.jcs-native .color .attribute-name { display: none; }

/* ---------------- Culoare care nu se poate comanda: estompată, tăiată cu o linie roșie ---------------- */
:root { --jcs-out: #d0021b; }
/* Pe card culoarea rămâne neatinsă (negrul estompat ar arăta ca griul): doar linia roșie,
   cu margini albe ca să se vadă și pe negru. Pe pagina de produs tot chenarul e estompat. */
.jcs--card button.jcs__sw--out::after,
.jcs__x {
  content: "";
  position: absolute;
  pointer-events: none;
  background: linear-gradient(to top right,
    transparent calc(50% - 2.25px), #fff calc(50% - 2.25px),
    #fff calc(50% - 1.25px), var(--jcs-out) calc(50% - 1.25px),
    var(--jcs-out) calc(50% + 1.25px), #fff calc(50% + 1.25px),
    #fff calc(50% + 2.25px), transparent calc(50% + 2.25px));
}
.jcs--card button.jcs__sw--out::after {
  inset: 4px;
  border-radius: 6px;
  /* Pe card: doar linia roșie, fără marginile albe. */
  background: linear-gradient(to top right,
    transparent calc(50% - 1.25px), var(--jcs-out) calc(50% - 1.25px),
    var(--jcs-out) calc(50% + 1.25px), transparent calc(50% + 1.25px));
}
.jcs__x { inset: 0; border-radius: 10px; z-index: 1; }
.jcs__opt--out .jcs__thumb,
.jcs__opt--out > .color,
.jcs__opt--out .jcs__name { opacity: .45; }

/* Poze în loc de nuanțe: fiecare culoare e o cutie cu poza ei și numele dedesubt.
   (Blocul nostru are mereu poze; blocul nativ doar când modulul a trimis pozele culorilor.) */
.jcs--page .jcs__opt,
.product-variants-item.jcs-native--thumbs li {
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
  width: 112px;
  height: 112px;
  padding: 6px 6px 8px;
  text-align: center;
  font-size: 13px;
  line-height: 1.2;
}
/* Poza se arată întreagă în cutie (fără decupare): pozele culorilor sunt încadrate diferit
   (unele cu produsul aproape de margine), iar decuparea le tăia sus și jos. */
.jcs__thumb {
  display: block;
  width: 100%;
  height: 74px;
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
  background: #fff;
  flex: none;
}
/* Căsuță în care poza e mărită de jcs.js (ca produsul să aibă mărimea celorlalte culori). */
.jcs__thumb--fit { position: relative; overflow: hidden; }
.jcs__thumb-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.jcs__thumb--sw {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
}
.jcs__thumb--sw .jcs__sw,
.product-variants-item.jcs-native--thumbs .jcs__thumb--sw .color {
  width: 40px !important;
  height: 40px !important;
  border-radius: 10px !important;
}
.jcs__hidden { display: none !important; }
.jcs--page .jcs__name,
.product-variants-item.jcs-native--thumbs .jcs__name { display: block; max-width: 100%; overflow-wrap: anywhere; }

/* Blocul „Variants” al iqitproductvariants e înlocuit de al nostru. */
body:has(.jcs--page) .js-iqitproductvariants { display: none !important; }

@media (max-width: 575px) {
  .jcs__opt,
  .product-variants-item.jcs-native li { height: 48px; padding-right: 12px; font-size: 13px; }
  .jcs--page .jcs__opt,
  .product-variants-item.jcs-native--thumbs li { width: 92px; height: 92px; padding: 5px 5px 7px; gap: 5px; font-size: 12px; }
  .jcs__thumb { height: 58px; }
}
@media (prefers-reduced-motion: reduce) {
  .jcs__opt, .product-variants-item.jcs-native li { transition: none; }
}
