/* ═══════════════════════════════════════════
   PLR Variation Swatches — WoodMart dark theme
   ═══════════════════════════════════════════ */

/* Hide native WC select */
select.plr-swatch-source,
.plr-swatch-initialized select[name^="attribute_"] {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 1px !important;
  height: 1px !important;
}

/* Swatch container */
.plr-swatches-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 6px;
}

/* Individual swatch button */
.plr-swatch {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 10px 18px;
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  user-select: none;
  font-family: inherit;
  letter-spacing: 0.02em;
}

.plr-swatch:hover:not(.plr-swatch--disabled) {
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.1);
  transform: translateY(-1px);
}

/* Selected */
.plr-swatch--selected {
  border-color: #ffffff !important;
  background: #ffffff !important;
  color: #0a0f1e !important;
  box-shadow: 0 4px 16px rgba(255,255,255,0.2);
}

.plr-swatch--selected .plr-swatch-stock {
  color: rgba(10,15,30,0.6) !important;
}

/* Out of stock */
.plr-swatch--disabled {
  border-color: rgba(255,255,255,0.06) !important;
  background: rgba(255,255,255,0.02) !important;
  color: rgba(255,255,255,0.25) !important;
  cursor: not-allowed;
}

/* Red X cross for sold-out swatches */
.plr-swatch--disabled::before,
.plr-swatch--disabled::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 70%;
  height: 2px;
  background: rgba(239, 68, 68, 0.6);
  border-radius: 2px;
  pointer-events: none;
}
.plr-swatch--disabled::before {
  transform: translate(-50%, -50%) rotate(45deg);
}
.plr-swatch--disabled::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* Stock text under swatch */
.plr-swatch-stock {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 5px;
  line-height: 1;
}

.plr-swatch-stock--instock  { color: #4ade80; }
.plr-swatch-stock--low      { color: #fbbf24; }
.plr-swatch-stock--outofstock { color: #f87171; }

/* ═══════════════════════════════════════════
   SOLD OUT / STOCK BADGE — prominent
   ═══════════════════════════════════════════ */

.plr-stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 6px;
  margin: 10px 0 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.plr-stock-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  animation: plr-pulse 2s infinite;
}

@keyframes plr-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* In Stock — green */
.plr-stock-badge--instock {
  background: rgba(74, 222, 128, 0.12);
  color: #4ade80;
  border: 1px solid rgba(74,222,128,0.25);
}

/* Low Stock — amber */
.plr-stock-badge--lowstock {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(251,191,36,0.25);
}

/* Sold Out — bold red, unmissable */
.plr-stock-badge--outofstock {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239,68,68,0.35);
  font-size: 15px;
  padding: 10px 20px;
}

.plr-stock-badge--outofstock::before {
  animation: none;
  opacity: 0.8;
}
