/* =============================================================
   SG STAFGROS — Variation Swatches & Commerce Mode CSS
   Version: 7.0.0
   ============================================================= */

/* ── Variation groups wrapper ──────────────────────────────── */

.sg-sp-variations {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sg-sp-var-group {}

/* ── Group header ─────────────────────────────────────────── */

.sg-sp-var-group__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.sg-sp-var-group__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--sg-sp-dark);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.sg-sp-var-group__chosen {
  font-size: 13px;
  color: var(--sg-sp-gray);
  font-weight: 400;
}
.sg-sp-var-group__chosen::before { content: ': '; }

.sg-sp-var-group__clear {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--sg-sp-gray);
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 50%;
  transition: color var(--sg-sp-trans), background var(--sg-sp-trans);
  margin-left: auto;
}
.sg-sp-var-group__clear:hover { color: var(--sg-sp-red); background: rgba(230,49,40,.08); }

/* ── Options container ────────────────────────────────────── */

.sg-sp-var-group__options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ═══════════════════════════════════════════════════════════
   SWATCH BASE
   ═══════════════════════════════════════════════════════════ */

.sg-swatch {
  position: relative;
  cursor: pointer;
  border: 2px solid transparent;
  padding: 0;
  background: none;
  transition: transform .15s, border-color .15s, box-shadow .15s, opacity .15s;
  flex-shrink: 0;
}

.sg-swatch:focus-visible {
  outline: 2px solid var(--sg-sp-red);
  outline-offset: 3px;
}

.sg-swatch.is-disabled {
  opacity: .35;
  cursor: not-allowed;
  pointer-events: none;
}

.sg-swatch.is-unavailable {
  opacity: .4;
  position: relative;
}
/* Diagonal strikethrough for unavailable */
.sg-swatch.is-unavailable::after {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(
    to bottom right,
    transparent calc(50% - 1px),
    rgba(0,0,0,.35) calc(50% - 1px),
    rgba(0,0,0,.35) calc(50% + 1px),
    transparent calc(50% + 1px)
  );
  border-radius: inherit;
}

/* ═══════════════════════════════════════════════════════════
   COLOR SWATCHES
   ═══════════════════════════════════════════════════════════ */

.sg-swatch--color {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.sg-swatch--color:hover {
  transform: scale(1.1);
  border-color: rgba(0,0,0,.2);
}

.sg-swatch--color.is-active {
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--sg-sp-red);
  border-color: transparent;
  transform: scale(1.05);
}

/* Checkmark on active */
.sg-swatch__check {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s;
  border-radius: inherit;
}
.sg-swatch--color.is-active .sg-swatch__check { opacity: 1; }

/* Fallback text for no-color swatches */
.sg-swatch--color__fallback {
  font-size: 10px;
  font-weight: 700;
  color: inherit;
  line-height: 1;
}

/* Light color border fix */
.sg-swatch--color[style*="#fff"],
.sg-swatch--color[style*="#ffffff"],
.sg-swatch--color[style*="#FFF"],
.sg-swatch--color[style*="#FFFFFF"],
.sg-swatch--color[style*="#f5f5f5"],
.sg-swatch--color[style*="#fafafa"] {
  border-color: rgba(0,0,0,.15);
}

/* ═══════════════════════════════════════════════════════════
   IMAGE SWATCHES
   ═══════════════════════════════════════════════════════════ */

.sg-swatch--img {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--sg-sp-border);
  background: var(--sg-sp-bg);
}

.sg-swatch--img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sg-swatch--img:hover { border-color: var(--sg-sp-gray); transform: translateY(-2px); }

.sg-swatch--img.is-active {
  border-color: var(--sg-sp-red);
  box-shadow: 0 2px 8px rgba(230,49,40,.2);
  transform: translateY(-2px);
}

.sg-swatch--img__fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 13px;
  font-weight: 700;
  color: var(--sg-sp-gray);
  background: #f0f2f5;
}

/* ═══════════════════════════════════════════════════════════
   BUTTON SWATCHES (size / dimension / text)
   ═══════════════════════════════════════════════════════════ */

.sg-swatch--btn {
  height: 38px;
  min-width: 44px;
  padding: 0 14px;
  border-radius: 7px;
  border: 1.5px solid var(--sg-sp-border);
  background: var(--sg-sp-bg);
  font-size: 13px;
  font-weight: 600;
  color: var(--sg-sp-dark);
  transition: border-color .15s, background .15s, color .15s, transform .15s;
  white-space: nowrap;
}

.sg-swatch--btn:hover {
  border-color: var(--sg-sp-dark);
  background: #fff;
  transform: translateY(-1px);
}

.sg-swatch--btn.is-active {
  border-color: var(--sg-sp-red);
  color: var(--sg-sp-red);
  background: rgba(230,49,40,.06);
}

/* ═══════════════════════════════════════════════════════════
   NOTICES
   ═══════════════════════════════════════════════════════════ */

.sg-sp-variations__unavail,
.sg-sp-variations__select-prompt {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 8px;
  margin-top: 4px;
}

.sg-sp-variations__unavail {
  background: #fff5f5;
  color: #c53030;
  border: 1px solid #fed7d7;
}

.sg-sp-variations__select-prompt {
  background: #fffbf0;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* ═══════════════════════════════════════════════════════════
   COMMERCE MODE INDICATOR (editor only)
   ═══════════════════════════════════════════════════════════ */

.sg-sp-info__mode-hint {
  margin-top: 8px;
  padding: 8px 12px;
  background: #f0f4f8;
  border-radius: 6px;
  color: var(--sg-sp-gray);
  font-size: 12px;
}
.sg-sp-info__mode-hint a { color: var(--sg-sp-red); }

/* ═══════════════════════════════════════════════════════════
   QUOTE-ONLY MODE — full-width primary CTA
   ═══════════════════════════════════════════════════════════ */

.sg-sp-info--mode-quote_only .sg-sp-info__add-quote--primary {
  width: 100%;
  height: 54px;
  font-size: 15px;
  font-weight: 700;
  background: var(--sg-sp-dark);
  color: #fff;
  border: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: background var(--sg-sp-trans), transform var(--sg-sp-trans);
}

.sg-sp-info--mode-quote_only .sg-sp-info__add-quote--primary:hover:not(:disabled) {
  background: var(--sg-sp-red);
  transform: translateY(-2px);
}

.sg-sp-info--mode-quote_only .sg-sp-info__add-quote--primary:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.sg-sp-info--mode-quote_only .sg-sp-info__add-quote--primary.is-added {
  background: var(--sg-sp-green);
  pointer-events: none;
}

/* ─ Hidden price in quote-only mode ─ */
.sg-sp-info--mode-quote_only .sg-sp-info__price {
  display: none; /* Price block hidden entirely in quote_only */
}

.sg-price-hidden {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--sg-sp-gray);
  background: var(--sg-sp-bg);
  border: 1.5px dashed var(--sg-sp-border);
  border-radius: 6px;
  padding: 6px 14px;
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════
   BOTH MODE — side by side cart + quote
   ═══════════════════════════════════════════════════════════ */

.sg-sp-info--mode-both .sg-sp-info__btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.sg-sp-info--mode-both .sg-sp-info__add-cart {
  flex: 2;
  min-width: 160px;
}

.sg-sp-info--mode-both .sg-sp-info__add-quote {
  flex: 1;
  min-width: 130px;
  background: transparent;
  border: 1.5px solid var(--sg-sp-border);
  border-radius: 8px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sg-sp-dark);
  cursor: pointer;
  transition: border-color var(--sg-sp-trans), background var(--sg-sp-trans);
  white-space: nowrap;
}

.sg-sp-info--mode-both .sg-sp-info__add-quote:hover:not(:disabled) {
  border-color: var(--sg-sp-dark);
  background: var(--sg-sp-bg);
}

.sg-sp-info--mode-both .sg-sp-info__add-quote:disabled { opacity: .45; cursor: not-allowed; }

.sg-sp-info--mode-both .sg-sp-info__add-quote.is-added {
  background: var(--sg-sp-green);
  border-color: var(--sg-sp-green);
  color: #fff;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
   PRICE-ONLY MODE — standard look
   ═══════════════════════════════════════════════════════════ */

.sg-sp-info--mode-price_only .sg-sp-info__add-cart {
  width: 100%;
}

/* ═══════════════════════════════════════════════════════════
   OOS BADGE
   ═══════════════════════════════════════════════════════════ */

.sg-sp-info__oos-badge {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 24px;
  background: #f3f4f6;
  color: var(--sg-sp-gray);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: 1.5px solid var(--sg-sp-border);
}

/* ═══════════════════════════════════════════════════════════
   QTY WRAP — enhanced
   ═══════════════════════════════════════════════════════════ */

.sg-sp-info__qty-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.sg-sp-info__qty-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--sg-sp-dark);
  min-width: 60px;
}

.sg-sp-info__qty-ctrl {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--sg-sp-border);
  border-radius: 8px;
  overflow: hidden;
  height: 44px;
}

.sg-sp-info__qty-btn {
  width: 40px;
  height: 44px;
  background: var(--sg-sp-bg);
  border: none;
  font-size: 20px;
  cursor: pointer;
  transition: background var(--sg-sp-trans);
  color: var(--sg-sp-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.sg-sp-info__qty-btn:hover { background: #e8edf2; }

.sg-sp-info__qty-input {
  width: 52px;
  text-align: center;
  border: none;
  border-left: 1.5px solid var(--sg-sp-border);
  border-right: 1.5px solid var(--sg-sp-border);
  font-size: 15px;
  font-weight: 700;
  height: 44px;
  color: var(--sg-sp-dark);
  background: #fff;
  -moz-appearance: textfield;
}
.sg-sp-info__qty-input::-webkit-inner-spin-button,
.sg-sp-info__qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ═══════════════════════════════════════════════════════════
   ADMIN: Commerce Mode Switcher
   ═══════════════════════════════════════════════════════════ */

.sg-commerce-mode-selector {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0;
}

.sg-commerce-mode-card {
  flex: 1;
  min-width: 180px;
  max-width: 280px;
  border: 2px solid #dde3ea;
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
  position: relative;
}

.sg-commerce-mode-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.sg-commerce-mode-card:has(input:checked),
.sg-commerce-mode-card.is-selected {
  border-color: #e63128;
  box-shadow: 0 0 0 3px rgba(230,49,40,.12);
}

.sg-commerce-mode-card__icon { font-size: 24px; margin-bottom: 8px; }
.sg-commerce-mode-card__title { font-weight: 700; color: #0d1b2a; margin-bottom: 4px; }
.sg-commerce-mode-card__desc { font-size: 12px; color: #718096; line-height: 1.5; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 600px) {
  .sg-sp-info--mode-both .sg-sp-info__btn-row { flex-direction: column; }
  .sg-sp-info--mode-both .sg-sp-info__add-cart,
  .sg-sp-info--mode-both .sg-sp-info__add-quote { min-width: 0; width: 100%; }
  .sg-sp-var-group__options { gap: 6px; }
  .sg-swatch--btn { padding: 0 10px; font-size: 12px; height: 34px; }
}
