/*
==================================================================
  BCONSULT — WooCommerce · Variation Swatches (front end)
==================================================================

  PHP    : inc/woocommerce/swatches.php
  JS     : assets/js/woocommerce/swatches.js
  Enqueue: inc/common/theme-scripts.php  (handle: oit-shop-swatches)

  CONTENTS
    1. Tokens
    2. Wrapper + hidden select
    3. Swatch list
    4. Swatch base
    5. Styles: color / image / button
    6. States: active, disabled, focus
    7. Shapes
    8. Tooltip
    9. Selected-term label
   10. Responsive
==================================================================
*/

.oit-shop-loop-swatches {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 10px;
  align-items: center;
}
.oit-shop-loop-swatches-label {
  display: none;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  opacity: 0.65;
  color: var(--oit-clr-black);
}

.oit-shop-loop-swatches[data-attribute=pa_size] {
  margin-bottom: 15px;
}

.oit-shop-swatches {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  line-height: 1;
  transition: 0.3s;
  border: 1px solid rgba(0, 0, 0, 0.1);
}
.oit-shop-swatches--button {
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--oit-clr-black);
}
.oit-shop-swatches--color {
  width: 30px;
  height: 30px;
  padding: 3px;
}
.oit-shop-swatches--color .oit-shop-swatches-color {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}
.oit-shop-swatches--image {
  width: 40px;
  height: 40px;
  padding: 2px;
}
.oit-shop-swatches-image {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}
.oit-shop-swatches-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.oit-shop-swatches:hover {
  color: var(--oit-clr-black);
  border-color: var(--oit-clr-black);
}
.oit-shop-swatches.is-active {
  border-color: var(--oit-clr-black);
}
.oit-shop-swatches.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.oit-shop-swatches.is-disabled::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.6;
  pointer-events: none;
  background-image: linear-gradient(to top left, transparent calc(50% - 1px), currentColor calc(50% - 1px), currentColor calc(50% + 1px), transparent calc(50% + 1px));
}
.oit-shop-swatches:focus-visible {
  outline-offset: 2px;
  outline: 2px solid var(--oit-clr-black);
}
.oit-shop-swatches-select {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.oit-shop-swatches[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  z-index: 3;
  padding: 4px 10px;
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: 0.25s;
  pointer-events: none;
  background-color: var(--oit-clr-black);
  transform: translateX(-50%) translateY(4px);
}

.oit-shop-swatches[data-tooltip]:hover::before,
.oit-shop-swatches[data-tooltip]:focus-visible::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.oit-shop-swatches.is-active[data-tooltip]::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.oit-shop-swatches--button[data-tooltip]::before {
  display: none;
}
/* ------------------------------------------------------------------
   Theme Options wiring
   ------------------------------------------------------------------*/

.oit-shop-swatches.oit-shop-swatches--color,
.oit-shop-swatches.oit-shop-swatches--image {
    width: var(--oit-shop-swatches-size, 40px);
    height: var(--oit-shop-swatches-size, 40px);
    padding: 0;
}
.oit-shop-swatches.oit-shop-swatches--button {
    min-height: var(--oit-shop-swatches-size, 40px);
}

/* ------------------------------------------------------------------
   Swatch Shape
   ------------------------------------------------------------------ */

.oit-shop-swatches-wrap.oit-shop-swatches--square .oit-shop-swatches,
.oit-shop-loop-swatches--square .oit-shop-swatches {
    border-radius: 0;
}

.oit-shop-swatches-wrap.oit-shop-swatches--rounded .oit-shop-swatches,
.oit-shop-loop-swatches--rounded .oit-shop-swatches {
    border-radius: 6px;
}

.oit-shop-swatches-wrap.oit-shop-swatches--circle .oit-shop-swatches,
.oit-shop-loop-swatches--circle .oit-shop-swatches {
    border-radius: 50%;
}

.oit-shop-swatches-wrap.oit-shop-swatches--circle .oit-shop-swatches--button,
.oit-shop-loop-swatches--circle .oit-shop-swatches--button {
    border-radius: 999px;
}
