/* ================================================================
   SG-STAFGROS — Variation Swatches & Quantity Stepper Design Fix
   Drop this file into assets/css/ and enqueue it AFTER
   sg-variations.css and sg-single-product.css in assets.php.
   ================================================================ */

/* ================================================================
   SECTION 1 — SINGLE PRODUCT PAGE
   Targets: .sg-sp-info__qty-* and .sg-swatch--btn
   ================================================================ */

/* ── QUANTITY STEPPER (single product) ─────────────────────────── */

.sg-sp-info__qty-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  margin-bottom: 16px !important;
}

.sg-sp-info__qty-label {
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  color: #94a3b8 !important;
  min-width: 70px !important;
}

/* Unified stepper container */
.sg-sp-info__qty-ctrl {
  display: inline-flex !important;
  align-items: center !important;
  height: 44px !important;
  border-radius: 12px !important;
  border: 1.5px solid #e2e8f0 !important;
  background: #fff !important;
  overflow: visible !important;    /* allow box-shadow on focus */
  gap: 0 !important;
  box-shadow: 0 1px 3px rgba(13,27,42,.06) !important;
  transition: border-color .18s ease, box-shadow .18s ease !important;
}

.sg-sp-info__qty-ctrl:focus-within {
  border-color: #0d1b2a !important;
  box-shadow: 0 0 0 3px rgba(13,27,42,.08) !important;
}

/* Minus and Plus buttons */
.sg-sp-info__qty-btn {
  width: 40px !important;
  height: 44px !important;
  min-width: 40px !important;
  background: #f8fafc !important;
  border: none !important;
  border-radius: 0 !important;
  font-size: 20px !important;
  font-weight: 300 !important;
  line-height: 1 !important;
  color: #475569 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
  transition: background .15s ease, color .15s ease !important;
  user-select: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  box-shadow: none !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.sg-sp-info__qty-minus {
  border-radius: 10px 0 0 10px !important;
  border-right: 1.5px solid #e2e8f0 !important;
}

.sg-sp-info__qty-plus {
  border-radius: 0 10px 10px 0 !important;
  border-left: 1.5px solid #e2e8f0 !important;
}

.sg-sp-info__qty-btn:hover {
  background: #0d1b2a !important;
  color: #fff !important;
}

/* Number input */
.sg-sp-info__qty-input {
  width: 56px !important;
  height: 44px !important;
  border: none !important;
  border-left: none !important;
  border-right: none !important;
  background: #fff !important;
  text-align: center !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #0d1b2a !important;
  padding: 0 !important;
  -moz-appearance: textfield !important;
  outline: none !important;
}

.sg-sp-info__qty-input::-webkit-inner-spin-button,
.sg-sp-info__qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none !important;
}

/* ── VARIATION SWATCHES (single product) ───────────────────────── */

.sg-sp-var-group {
  margin-bottom: 4px !important;
}

.sg-sp-var-group__header {
  display: flex !important;
  align-items: baseline !important;
  gap: 6px !important;
  margin-bottom: 10px !important;
}

.sg-sp-var-group__label {
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  color: #94a3b8 !important;
}

.sg-sp-var-group__chosen {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #0d1b2a !important;
}

.sg-sp-var-group__chosen::before {
  content: ': ' !important;
  font-weight: 400 !important;
  color: #94a3b8 !important;
}

.sg-sp-var-group__options {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 7px !important;
}

/* Button swatch — base */
.sg-swatch--btn {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 36px !important;
  min-width: 48px !important;
  padding: 0 14px !important;
  border-radius: 8px !important;
  border: 1.5px solid #e2e8f0 !important;
  background: #fff !important;
  color: #475569 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  letter-spacing: .01em !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  transition: border-color .15s ease, background .15s ease,
              color .15s ease, box-shadow .15s ease,
              transform .12s ease !important;
  box-shadow: 0 1px 2px rgba(13,27,42,.05) !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

.sg-swatch--btn:hover {
  border-color: #0d1b2a !important;
  color: #0d1b2a !important;
  background: #f8fafc !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 8px rgba(13,27,42,.1) !important;
}

/* Active state — dark solid fill with white text */
.sg-swatch--btn.is-active {
  background: #0d1b2a !important;
  border-color: #0d1b2a !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(13,27,42,.22) !important;
  transform: translateY(-1px) !important;
}

/* Active indicator dot under active swatch */
.sg-swatch--btn.is-active::after {
  content: '' !important;
  position: absolute !important;
  bottom: -6px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 4px !important;
  height: 4px !important;
  border-radius: 50% !important;
  background: var(--sg-sp-red, #e63128) !important;
}

.sg-swatch--btn.is-unavailable {
  opacity: .4 !important;
  cursor: not-allowed !important;
}

/* Disabled/unavailable diagonal stripe */
.sg-swatch--btn.is-unavailable::before {
  content: '' !important;
  position: absolute !important;
  inset: -1px !important;
  border-radius: 8px !important;
  background: linear-gradient(
    to bottom right,
    transparent calc(50% - 1px),
    rgba(0,0,0,.25) calc(50% - 1px),
    rgba(0,0,0,.25) calc(50% + 1px),
    transparent calc(50% + 1px)
  ) !important;
}


/* ================================================================
   SECTION 2 — QUICK-PICK MODAL
   Targets: .sg-qp-qty* and .sg-qp-swatch--btn
   Needs !important because .sg-qp-modal button resets everything
   ================================================================ */

/* ── QUANTITY STEPPER (quick-pick modal) ───────────────────────── */

.sg-qp-qty {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  border: none !important;      /* remove old border from wrapper */
  height: auto !important;
  border-radius: 0 !important;
}

.sg-qp-qty__label {
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  color: #94a3b8 !important;
  white-space: nowrap !important;
}

/* Stepper control group */
.sg-qp-qty__ctrl {
  display: inline-flex !important;
  align-items: center !important;
  height: 40px !important;
  border-radius: 10px !important;
  border: 1.5px solid #e2e8f0 !important;
  background: #fff !important;
  box-shadow: 0 1px 3px rgba(13,27,42,.06) !important;
  overflow: hidden !important;
  transition: border-color .18s ease, box-shadow .18s ease !important;
}

.sg-qp-qty__ctrl:focus-within {
  border-color: #0d1b2a !important;
  box-shadow: 0 0 0 3px rgba(13,27,42,.08) !important;
}

/* Minus and Plus buttons — override the aggressive modal reset */
.sg-qp-modal .sg-qp-qty__btn {
  width: 36px !important;
  height: 40px !important;
  min-width: 36px !important;
  background: #f8fafc !important;
  border: none !important;
  border-radius: 0 !important;
  font-size: 18px !important;
  font-weight: 300 !important;
  line-height: 1 !important;
  color: #475569 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
  transition: background .15s ease, color .15s ease !important;
  user-select: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  box-shadow: none !important;
}

.sg-qp-modal .sg-qp-qty__btn:hover {
  background: #0d1b2a !important;
  color: #fff !important;
}

.sg-qp-qty__input {
  width: 50px !important;
  height: 40px !important;
  border: none !important;
  border-left: 1.5px solid #e2e8f0 !important;
  border-right: 1.5px solid #e2e8f0 !important;
  background: #fff !important;
  text-align: center !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #0d1b2a !important;
  padding: 0 !important;
  -moz-appearance: textfield !important;
  outline: none !important;
}

.sg-qp-qty__input::-webkit-inner-spin-button,
.sg-qp-qty__input::-webkit-outer-spin-button {
  -webkit-appearance: none !important;
}

/* ── VARIATION SWATCHES (quick-pick modal) ─────────────────────── */

.sg-qp-var-group {
  margin-bottom: 4px !important;
}

.sg-qp-var-group__header {
  display: flex !important;
  align-items: baseline !important;
  gap: 6px !important;
  margin-bottom: 8px !important;
}

.sg-qp-var-group__label {
  font-size: 10px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  color: #94a3b8 !important;
}

.sg-qp-var-group__chosen {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #0d1b2a !important;
}

.sg-qp-var-group__chosen:not(:empty)::before {
  content: ': ' !important;
  font-weight: 400 !important;
  color: #94a3b8 !important;
}

/* Button swatch — override modal reset */
.sg-qp-modal .sg-qp-swatch--btn {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 34px !important;
  min-width: 44px !important;
  padding: 0 13px !important;
  border-radius: 8px !important;
  border: 1.5px solid #e2e8f0 !important;
  background: #fff !important;
  color: #475569 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  transition: border-color .15s ease, background .15s ease,
              color .15s ease, box-shadow .15s ease,
              transform .12s ease !important;
  box-shadow: 0 1px 2px rgba(13,27,42,.05) !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}

.sg-qp-modal .sg-qp-swatch--btn:hover {
  border-color: #0d1b2a !important;
  color: #0d1b2a !important;
  background: #f8fafc !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 8px rgba(13,27,42,.1) !important;
}

.sg-qp-modal .sg-qp-swatch--btn.is-active {
  background: #0d1b2a !important;
  border-color: #0d1b2a !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(13,27,42,.22) !important;
  transform: translateY(-1px) !important;
}

/* Active indicator dot */
.sg-qp-modal .sg-qp-swatch--btn.is-active::after {
  content: '' !important;
  position: absolute !important;
  bottom: -6px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 4px !important;
  height: 4px !important;
  border-radius: 50% !important;
  background: var(--qp-primary, #e63128) !important;
  box-shadow: none !important;
}

.sg-qp-modal .sg-qp-swatch--btn.is-unavailable {
  opacity: .4 !important;
  pointer-events: none !important;
}

/* ── VARIATION GROUP HEADER — shared refinement ────────────────── */

/* "DIMENSION" / attribute label row */
.sg-sp-var-group__header,
.sg-qp-var-group__header {
  padding-bottom: 8px !important;
  border-bottom: 1px solid #f1f5f9 !important;
  margin-bottom: 12px !important;
}

/* ── RESPONSIVE ────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .sg-swatch--btn {
    height: 34px !important;
    padding: 0 11px !important;
    font-size: 12px !important;
    border-radius: 7px !important;
  }

  .sg-sp-info__qty-ctrl {
    height: 42px !important;
  }

  .sg-sp-info__qty-btn {
    width: 38px !important;
    height: 42px !important;
    font-size: 18px !important;
  }

  .sg-sp-info__qty-input {
    width: 50px !important;
    height: 42px !important;
    font-size: 15px !important;
  }
}
