/* =========================================================================
   SCP – Variant-swatches (bol.com/Razzi-stijl)
   Foto-swatches (kleur) / tekst-met-border (maat/lengte), en een dropdown
   met foto + naam zodra er meer dan 4 opties zijn.
   ========================================================================= */

.scp-var2 {
  margin: 4px 0 18px;
}
.scp-var2__label {
  font-size: 14px;
  margin-bottom: 8px;
  color: #222;
}
.scp-var2__labeltext {
  font-weight: 600;
}
.scp-var2__chosen {
  color: #555;
}

/* ---- Swatches (t/m 4 opties) ---- */
.scp-var2__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.scp-var2__opt {
  padding: 0;
  border: 2px solid #e2e2e2;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
  line-height: 0;
}
.scp-var2__opt:hover {
  border-color: #b5b5b5;
}
.scp-var2__opt.is-active {
  border-color: #111;
  box-shadow: 0 0 0 1px #111;
}
.scp-var2__opt--img {
  width: 62px;
  height: 62px;
}
.scp-var2__opt--img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}
.scp-var2__opt--txt {
  min-width: 56px;
  height: 44px;
  padding: 0 16px;
  line-height: 40px;
  font-size: 14px;
  font-weight: 500;
  color: #222;
  border-radius: 8px;
}

/* ---- Layout: swatches/dropdown als volledige-breedte rij BOVEN de
   hoeveelheid (-/+) en winkelwagenknop. Het thema maakt van
   form.variations_form een flex-rij; wij zetten hem in een kolom zodra
   onze component actief is (klasse scp-var2-done), zodat de keuze boven
   en de knoppenrij eronder komt. Scoped, dus geen impact elders. ---- */
form.variations_form.scp-var2-done {
  flex-direction: column;
  align-items: stretch;
}
form.variations_form.scp-var2-done .scp-var2wrap {
  width: 100%;
  margin-bottom: 14px;
}
form.variations_form.scp-var2-done .single_variation_wrap {
  width: 100%;
}
/* Meerdere variatie-dimensies (bijv. lengte + kleur) netjes onder elkaar. */
.scp-var2wrap .scp-var2 { margin-bottom: 14px; }
.scp-var2wrap .scp-var2:last-child { margin-bottom: 0; }

/* De standaard groene WooCommerce-variatieprijs verbergen; de rode
   hoofdprijs verandert mee met de gekozen variatie (via scp-variants.js). */
.woocommerce-variation-price { display: none !important; }

/* ---- Dropdown (meer dan 4 opties) — volledige breedte binnen de sectie ---- */
.scp-var2-dd {
  position: relative;
  max-width: none;
}
.scp-var2-dd__btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 6px 12px;
  border: 2px solid #e2e2e2;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 15px;
  color: #222;
  text-align: left;
  transition: border-color .15s ease;
}
.scp-var2-dd__btn:hover,
.scp-var2-dd.is-open .scp-var2-dd__btn {
  border-color: #111;
}
.scp-var2-dd__cur {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}
.scp-var2-dd__cur img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid #eee;
  flex: 0 0 auto;
}
.scp-var2-dd__caret {
  flex: 0 0 auto;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #555;
  transition: transform .2s ease;
}
.scp-var2-dd.is-open .scp-var2-dd__caret {
  transform: rotate(180deg);
}

.scp-var2-dd__menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  padding: 6px;
  display: none;
}
.scp-var2-dd.is-open .scp-var2-dd__menu {
  display: block;
}
.scp-var2-dd__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  color: #222;
  text-align: left;
}
.scp-var2-dd__item:hover {
  background: #f5f5f5;
}
.scp-var2-dd__item.is-active {
  background: #f0f0f0;
  font-weight: 600;
}
.scp-var2-dd__img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid #eee;
  flex: 0 0 auto;
}
.scp-var2-dd__txtbox {
  min-width: 54px;
  height: 40px;
  line-height: 38px;
  padding: 0 12px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-weight: 500;
  flex: 0 0 auto;
}
.scp-var2-dd__name {
  flex: 1 1 auto;
}

@media (max-width: 768px) {
  .scp-var2-dd { max-width: none; }
  .scp-var2__opt--img { width: 56px; height: 56px; }
}

/* Verberg het standaard thema-swatchblok; onze component (.scp-var2) vervangt
   het. De knoppen blijven in de DOM (display:none blokkeert klikken niet),
   zodat onze swatches de variatie + foto via die knoppen kunnen wisselen. */
.scp-swatchblok {
  display: none !important;
}

/* ---- Link-swatches (varianten met een eigen productpagina) ----
   Zelfde uiterlijk als de tekst-swatches, maar het zijn <a>-links (of een
   niet-klikbare span voor de actieve/huidige uitvoering). */
.scp-linkswitch {
  width: 100%;
  margin-bottom: 14px;
}
.scp-linkswitch__opt {
  display: inline-block;
  text-align: center;
  text-decoration: none;
}
a.scp-linkswitch__opt {
  color: #222;
}
a.scp-linkswitch__opt:hover {
  border-color: #111;
}
.scp-linkswitch__opt.is-active {
  border-color: #111;
  box-shadow: 0 0 0 1px #111;
  cursor: default;
}
