/* ══════════════════════════════════════════════════════════════
   QUICK-PICK MODAL — THEME ISOLATION
   ══════════════════════════════════════════════════════════════ */
.sg-qp-backdrop *,
.sg-qp-modal * {
  box-sizing: border-box !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}
.sg-qp-modal p  { margin: 0 !important; padding: 0 !important; }
.sg-qp-modal ul, .sg-qp-modal ol { list-style: none !important; margin: 0 !important; padding: 0 !important; }
.sg-qp-modal li { list-style: none !important; margin: 0 !important; padding: 0 !important; }
.sg-qp-modal a  { text-decoration: none !important; color: inherit !important; }
.sg-qp-modal img { border: none !important; box-shadow: none !important; vertical-align: middle !important; }
.sg-qp-modal button {
  border: none !important; background: none !important;
  padding: 0 !important; margin: 0 !important;
  cursor: pointer !important; font-family: inherit !important;
  -webkit-appearance: none !important; appearance: none !important;
  line-height: 1 !important; letter-spacing: normal !important;
  text-transform: none !important; box-shadow: none !important;
  min-height: unset !important; min-width: unset !important;
  display: inline-flex !important; align-items: center !important;
}
.sg-qp-modal input, .sg-qp-modal select {
  font-family: inherit !important; font-size: inherit !important;
  letter-spacing: normal !important; text-transform: none !important;
}

/* ── Color vars from unified system ───────────────────────── */
.sg-qp-backdrop,
.sg-qp-modal {
  --qp-primary:   var(--wcdd-primary, #e63128);
  --qp-hover:     var(--wcdd-primary-hover, #c52a22);
  --qp-dark:      var(--wcdd-dark, #0d1b2a);
  --qp-accent:    var(--wcdd-accent, var(--qp-accent));
  --qp-border:    var(--wcdd-g200, #e2e8f0);
  --qp-bg:        var(--wcdd-g50, #f8fafc);
  --qp-muted:     var(--wcdd-g400, #94a3b8);
  --qp-mid:       var(--wcdd-g500, #64748b);
}

/* =============================================================
   SG Quick-Pick Modal — CSS
   Version: 7.3.0
   Handles: simple, variable, grouped, bundle product types
   ============================================================= */

/* ── Reset & Variables ─────────────────────────────────────── */
.sg-qp-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999990;
  background: rgba(13, 27, 42, 0.65);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sg-qp-backdrop.is-open {
  opacity: 1;
  pointer-events: all;
}

/* ── Modal shell ───────────────────────────────────────────── */
.sg-qp-modal {
  position: relative;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(13,27,42,.24), 0 4px 16px rgba(13,27,42,.12);
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: thin;
  transform: translateY(12px) scale(.98);
  transition: transform 0.25s ease;
}

.sg-qp-backdrop.is-open .sg-qp-modal {
  transform: translateY(0) scale(1);
}

/* Close button */
.sg-qp-close {
  position: sticky;
  top: 12px;
  float: right;
  margin: 12px 12px 0 0;
  z-index: 10;
  background: var(--qp-bg);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--qp-mid);
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.sg-qp-close:hover { background: #fee2e2; color: var(--qp-danger); }

/* ── Loading skeleton ──────────────────────────────────────── */
.sg-qp-loading {
  display: flex;
  gap: 24px;
  padding: 28px 28px 32px;
}

.sg-qp-skeleton {
  background: linear-gradient(90deg, var(--qp-bg) 25%, #e9eaf0 50%, var(--qp-bg) 75%);
  background-size: 200% 100%;
  animation: sgSkel 1.4s ease infinite;
  border-radius: 8px;
}
@keyframes sgSkel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.sg-qp-skeleton--img { width: 220px; height: 220px; border-radius: 12px; flex-shrink: 0; }
.sg-qp-skeleton-body { flex: 1; display: flex; flex-direction: column; gap: 12px; padding-top: 8px; }
.sg-qp-skeleton--title { height: 28px; width: 70%; }
.sg-qp-skeleton--line { height: 16px; }
.sg-qp-skeleton--short { width: 45%; }

/* ── SINGLE / VARIABLE LAYOUT ──────────────────────────────── */
.sg-qp-single {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
}

.sg-qp-single__media {
  position: relative;
  background: var(--qp-bg);
  border-radius: 16px 0 0 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  padding: 24px;
}

.sg-qp-img {
  width: 100%;
  height: 100%;
  max-height: 260px;
  object-fit: contain;
  display: block;
  transition: transform 0.3s ease;
}
.sg-qp-img.is-loading { opacity: 0.4; }
.sg-qp-img.is-loaded  { opacity: 1;   }

.sg-qp-badges {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sg-qp-badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 3px 9px;
  border-radius: 20px;
}
.sg-qp-badge--sale { background: var(--qp-primary); color: #fff; }
.sg-qp-badge--new  { background: var(--qp-accent); color: #fff; }

.sg-qp-single__info {
  padding: 28px 28px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

/* ── Typography ────────────────────────────────────────────── */
.sg-qp-cat {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--qp-primary);
  margin: 0;
}

.sg-qp-title {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 800;
  color: var(--qp-dark);
  line-height: 1.25;
  margin: 0;
}

.sg-qp-sku {
  font-size: 11px;
  color: var(--qp-muted);
}

.sg-qp-price { font-size: 1.4rem; }
.sg-qp-price .price { font-weight: 800; color: var(--qp-primary); }
.sg-qp-price .price ins { text-decoration: none; }
.sg-qp-price .price del { font-size: 0.85em; color: var(--qp-muted); font-weight: 400; margin-right: 6px; opacity: 0.7; }
.sg-qp-price-hidden {
  display: inline-block;
  font-size: 13px;
  color: var(--qp-muted);
  background: var(--qp-bg);
  padding: 5px 12px;
  border-radius: 20px;
  font-style: italic;
}

.sg-qp-desc {
  font-size: 13px;
  color: var(--qp-mid);
  line-height: 1.6;
  margin: 0;
  -webkit-line-clamp: 3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Stock ─────────────────────────────────────────────────── */
.sg-qp-stock {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}
.sg-qp-stock__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.sg-qp-stock.in-stock  { color: var(--qp-accent); }
.sg-qp-stock.in-stock .sg-qp-stock__dot { background: var(--qp-accent); }
.sg-qp-stock.out-stock { color: var(--qp-danger); }
.sg-qp-stock.out-stock .sg-qp-stock__dot { background: var(--qp-danger); }

/* ── Variation swatches (inside modal) ─────────────────────── */
.sg-qp-variants { display: flex; flex-direction: column; gap: 14px; }

.sg-qp-var-group {}

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

.sg-qp-var-group__label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--qp-dark);
}

.sg-qp-var-group__chosen {
  font-size: 12px;
  color: var(--qp-mid);
}
.sg-qp-var-group__chosen:not(:empty)::before { content: ': '; }

.sg-qp-var-group__clear {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--qp-border);
  padding: 2px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  transition: color 0.15s;
}
.sg-qp-var-group__clear:hover { color: var(--qp-primary); }

.sg-qp-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Swatch shared */
.sg-qp-swatch {
  border: 2px solid transparent;
  cursor: pointer;
  background: none;
  padding: 0;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s, opacity 0.15s;
  position: relative;
}
.sg-qp-swatch:focus-visible { outline: 2px solid var(--qp-primary); outline-offset: 3px; }
.sg-qp-swatch.is-disabled { opacity: 0.3; cursor: not-allowed; pointer-events: none; }

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

/* Color swatch */
.sg-qp-swatch--color {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.sg-qp-swatch--color:hover { transform: scale(1.12); }
.sg-qp-swatch--color.is-active {
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--qp-primary);
  border-color: transparent;
  transform: scale(1.06);
}

.sg-qp-swatch__check {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}
.sg-qp-swatch--color.is-active .sg-qp-swatch__check { opacity: 1; }

/* Image swatch */
.sg-qp-swatch--img {
  width: 48px;
  height: 48px;
  border-radius: 7px;
  overflow: hidden;
  border: 2px solid var(--qp-border);
  background: var(--qp-bg);
}
.sg-qp-swatch--img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sg-qp-swatch--img:hover { border-color: var(--qp-muted); transform: translateY(-2px); }
.sg-qp-swatch--img.is-active { border-color: var(--qp-primary); box-shadow: 0 2px 8px rgba(230,49,40,.2); transform: translateY(-2px); }

/* Button swatch */
.sg-qp-swatch--btn {
  height: 34px;
  min-width: 40px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1.5px solid var(--qp-border);
  background: var(--qp-bg);
  font-size: 12px;
  font-weight: 600;
  color: var(--qp-dark);
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.12s;
}
.sg-qp-swatch--btn:hover { border-color: var(--qp-dark); background: #fff; transform: translateY(-1px); }
.sg-qp-swatch--btn.is-active {
  border-color: var(--qp-primary);
  color: var(--qp-primary);
  background: rgba(var(--qp-primary-rgb, 230,49,40),.06);
}

/* ── Prompts / notices ─────────────────────────────────────── */
.sg-qp-select-prompt,
.sg-qp-unavail {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 7px;
}
.sg-qp-select-prompt {
  background: #fffbeb;
  color: var(--qp-dark);
  border: 1px solid rgba(245,158,11,.3);
}
.sg-qp-unavail {
  background: rgba(239,68,68,.06);
  color: var(--qp-danger);
  border: 1px solid rgba(239,68,68,.2);
}

/* ── Quantity control ──────────────────────────────────────── */
.sg-qp-qty {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--qp-border);
  border-radius: 8px;
  overflow: hidden;
  height: 42px;
}
.sg-qp-qty__btn {
  width: 38px;
  height: 42px;
  background: var(--qp-bg);
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--qp-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
  line-height: 1;
}
.sg-qp-qty__btn:hover { background: var(--qp-bg); }
.sg-qp-qty__input {
  width: 48px;
  text-align: center;
  border: none;
  border-left: 1.5px solid var(--qp-border);
  border-right: 1.5px solid var(--qp-border);
  font-size: 14px;
  font-weight: 700;
  height: 42px;
  color: var(--qp-dark);
  background: #fff;
  -moz-appearance: textfield;
}
.sg-qp-qty__input::-webkit-inner-spin-button,
.sg-qp-qty__input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ── Action buttons ────────────────────────────────────────── */
.sg-qp-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.sg-qp-cta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sg-qp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  border-radius: 9px;
  border: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.sg-qp-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.sg-qp-btn--quote {
  background: var(--qp-dark);
  color: #fff;
  flex: 1;
}
.sg-qp-btn--quote:hover:not(:disabled) { background: var(--qp-primary); transform: translateY(-1px); }
.sg-qp-btn--quote.is-added { background: var(--qp-accent); pointer-events: none; }

.sg-qp-btn--cart {
  background: var(--qp-primary);
  color: #fff;
  flex: 1;
}
.sg-qp-btn--cart:hover:not(:disabled) { background: var(--qp-hover); transform: translateY(-1px); }
.sg-qp-btn--cart.is-added { background: var(--qp-accent); pointer-events: none; }

.sg-qp-btn--full {
  width: 100%;
}

.sg-qp-permalink {
  font-size: 12px;
  color: var(--qp-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
  margin-top: auto;
}
.sg-qp-permalink:hover { color: var(--qp-primary); }

/* ══════════════════════════════════════════════════════════════
   GROUPED / BUNDLE LAYOUT
   ══════════════════════════════════════════════════════════════ */

.sg-qp-group__header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px 24px 0;
  margin-bottom: 16px;
}

.sg-qp-group__img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  background: var(--qp-bg);
}

.sg-qp-group__header .sg-qp-title { font-size: 1.2rem; margin-bottom: 4px; }
.sg-qp-group__header .sg-qp-desc { font-size: 13px; -webkit-line-clamp: 2; }

/* Items list */
.sg-qp-items {
  border-top: 1px solid var(--qp-bg);
  max-height: 460px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.sg-qp-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px 14px;
  align-items: start;
  padding: 16px 20px;
  border-bottom: 1px solid var(--qp-bg);
  transition: background 0.12s;
}
.sg-qp-item:last-child { border-bottom: none; }
.sg-qp-item:hover { background: #fafafa; }
.sg-qp-item.is-optional { opacity: 0.8; }

.sg-qp-item__img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--qp-bg);
  display: block;
}

.sg-qp-item__info { display: flex; flex-direction: column; gap: 4px; }

.sg-qp-item__name {
  font-size: 13px;
  font-weight: 700;
  color: var(--qp-dark);
  line-height: 1.3;
}

.sg-qp-item__sku { font-size: 11px; color: var(--qp-muted); }

.sg-qp-item__price {
  font-size: 13px;
  font-weight: 600;
  color: var(--qp-primary);
}

.sg-qp-item__optional {
  display: inline-block;
  font-size: 10px;
  background: #fffbeb;
  color: var(--qp-dark);
  border: 1px solid rgba(245,158,11,.3);
  border-radius: 20px;
  padding: 1px 7px;
  font-weight: 600;
}

/* Variation mini-swatches inside item */
.sg-qp-item__vars { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.sg-qp-item__var-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sg-qp-item__var-label { font-size: 11px; font-weight: 600; color: var(--qp-mid); min-width: 50px; }

/* Item quantity control */
.sg-qp-item__qty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 90px;
}

.sg-qp-item__qty-ctrl {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--qp-border);
  border-radius: 7px;
  overflow: hidden;
  height: 36px;
}

.sg-qp-item__qty-btn {
  width: 30px;
  height: 36px;
  background: var(--qp-bg);
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--qp-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.12s;
}
.sg-qp-item__qty-btn:hover { background: var(--qp-bg); }

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

.sg-qp-item__qty-stock {
  font-size: 10px;
  text-align: center;
}
.sg-qp-item__qty-stock.in-stock  { color: var(--qp-accent); }
.sg-qp-item__qty-stock.out-stock { color: var(--qp-danger); }

/* Optional checkbox */
.sg-qp-item__optional-check {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--qp-mid);
  cursor: pointer;
  user-select: none;
}
.sg-qp-item__optional-check input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--qp-primary);
  cursor: pointer;
}

/* Group footer */
.sg-qp-group__footer {
  padding: 16px 20px;
  border-top: 1.5px solid var(--qp-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fafafa;
  border-radius: 0 0 16px 16px;
}

.sg-qp-group__total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--qp-mid);
}
.sg-qp-group__total strong {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--qp-dark);
}

.sg-qp-group__hint {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--qp-primary);
  margin: 0;
}

/* ══════════════════════════════════════════════════════════════
   LOOP BUTTON UPDATES
   ══════════════════════════════════════════════════════════════ */

/* Visual cue on variable/grouped loop buttons */
.wcdd-btn--variable::after,
.wcdd-btn--grouped::after,
.wcdd-btn--bundle::after {
  content: '›';
  margin-left: 4px;
  font-size: 13px;
  opacity: 0.7;
}

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

@media (max-width: 640px) {
  .sg-qp-modal { border-radius: 12px 12px 0 0; max-height: 95vh; }
  .sg-qp-backdrop { align-items: flex-end; padding: 0; }
  .sg-qp-single { grid-template-columns: 1fr; }
  .sg-qp-single__media {
    border-radius: 12px 12px 0 0;
    min-height: 200px;
    max-height: 220px;
  }
  .sg-qp-single__info { padding: 20px; }
  .sg-qp-item { grid-template-columns: 48px 1fr; }
  .sg-qp-item__qty { grid-column: 1 / -1; flex-direction: row; align-items: center; }
  .sg-qp-cta-row { flex-direction: column; }
  .sg-qp-btn { min-width: 0; }
}

/* ══════════════════════════════════════════════════════════════
   BUNDLE LAYOUT (v2) — replaces old .sg-qp-group styles
   ══════════════════════════════════════════════════════════════ */

/* ── Bundle shell ───────────────────────────────────────────── */

.sg-qp-bundle { display: flex; flex-direction: column; }

/* ── Header ─────────────────────────────────────────────────── */

.sg-qp-bundle__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--qp-bg);
}

.sg-qp-bundle__head-left { display: flex; align-items: center; gap: 14px; flex: 1; }

.sg-qp-bundle__thumb {
  width: 64px; height: 64px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--qp-bg);
  flex-shrink: 0;
}

.sg-qp-bundle__subtitle { font-size: 12px; color: var(--qp-muted); margin: 4px 0 0; }

.sg-qp-bundle__link { font-size: 12px; color: var(--qp-muted); text-decoration: none; white-space: nowrap; flex-shrink: 0; }
.sg-qp-bundle__link:hover { color: var(--qp-primary); }

/* ── Progress bar ───────────────────────────────────────────── */

.sg-qp-bundle__progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  background: var(--qp-bg);
  border-bottom: 1px solid var(--qp-bg);
}

.sg-qp-bundle__progress-bar {
  flex: 1;
  height: 5px;
  background: var(--qp-border);
  border-radius: 20px;
  overflow: hidden;
}

.sg-qp-bundle__progress-fill {
  height: 100%;
  background: var(--qp-accent);
  border-radius: 20px;
  transition: width 0.4s ease;
}

.sg-qp-bundle__progress-text { font-size: 11px; color: var(--qp-mid); white-space: nowrap; }

/* ── Items list ─────────────────────────────────────────────── */

.sg-qp-bundle__items {
  max-height: 50vh;
  overflow-y: auto;
  scrollbar-width: thin;
}

/* ── Each bundle item row ───────────────────────────────────── */

.sg-qp-bundle-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px 20px;
  border-bottom: 1px solid var(--qp-bg);
  transition: background 0.12s;
  position: relative;
}
.sg-qp-bundle-row:last-child { border-bottom: none; }
.sg-qp-bundle-row:hover { background: #fafafa; }
.sg-qp-bundle-row.is-optional { background: #fafafa; }
.sg-qp-bundle-row.is-oos { opacity: 0.55; }

/* Image */
.sg-qp-bundle-row__img {
  position: relative;
  width: 60px; height: 60px;
  flex-shrink: 0;
}
.sg-qp-bundle-row__img img {
  width: 60px; height: 60px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--qp-bg);
  display: block;
}

.sg-qp-bundle-row__needs-config {
  position: absolute;
  top: -4px; right: -4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}

/* Body */
.sg-qp-bundle-row__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.sg-qp-bundle-row__name {
  font-size: 13px;
  font-weight: 700;
  color: var(--qp-dark);
  line-height: 1.3;
  word-break: break-word;
}

.sg-qp-bundle-row__sku { font-size: 11px; color: var(--qp-muted); }

.sg-qp-bundle-row__price { font-size: 13px; font-weight: 700; color: var(--qp-primary); }
.sg-qp-bundle-row__price .price ins { text-decoration: none; }
.sg-qp-bundle-row__price .price del { font-size: 11px; color: var(--qp-muted); font-weight: 400; margin-right: 4px; opacity: .7; }

/* Badges row */
.sg-qp-bundle-row__badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

.sg-qp-badge-sm {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 2px 8px;
  border-radius: 20px;
}
.sg-qp-badge-sm--opt  { background: #fffbeb; color: var(--qp-dark); border: 1px solid rgba(245,158,11,.3); }
.sg-qp-badge-sm--oos  { background: rgba(239,68,68,.06); color: var(--qp-danger); border: 1px solid rgba(239,68,68,.2); }
.sg-qp-badge-sm--var  { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; cursor: default; }
.sg-qp-badge-sm--var.is-resolved { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }

/* ── Variation picker inside bundle row ─────────────────────── */

.sg-qp-bundle-row__picker {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--qp-bg);
  border-radius: 8px;
  border: 1px solid var(--qp-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sg-qp-bundle-attr-group { display: flex; flex-direction: column; gap: 6px; }

.sg-qp-bundle-attr-header { display: flex; align-items: center; gap: 6px; }

.sg-qp-bundle-attr-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--qp-dark);
}

.sg-qp-bundle-attr-chosen { font-size: 11px; color: var(--qp-accent); font-weight: 600; }
.sg-qp-bundle-attr-chosen:not(:empty)::before { content: ': '; }

.sg-qp-bundle-attr-opts { display: flex; flex-wrap: wrap; gap: 5px; }

/* Bundle swatches — same as main swatches but slightly smaller */
.sg-qp-bundle-swatch { }
.sg-qp-bundle-swatch.sg-qp-swatch--color { width: 28px; height: 28px; }
.sg-qp-bundle-swatch.sg-qp-swatch--img   { width: 36px; height: 36px; }
.sg-qp-bundle-swatch.sg-qp-swatch--btn   { height: 28px; padding: 0 9px; font-size: 11px; }

/* Variation status line */
.sg-qp-bundle-row__var-status { font-size: 11px; font-weight: 600; margin-top: 4px; }

/* ── Right col: toggle + qty ─────────────────────────────────── */

.sg-qp-bundle-row__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* Toggle switch */
.sg-qp-bundle-row__toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.sg-qp-bundle-row__toggle input { position: absolute; opacity: 0; width: 0; height: 0; }

.sg-qp-toggle-track {
  width: 36px; height: 20px;
  background: var(--qp-border);
  border-radius: 20px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.sg-qp-bundle-row__toggle input:checked ~ .sg-qp-toggle-track { background: var(--qp-accent); }

.sg-qp-toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.sg-qp-bundle-row__toggle input:checked ~ .sg-qp-toggle-track .sg-qp-toggle-thumb { left: 18px; }

.sg-qp-toggle-lbl { font-size: 11px; font-weight: 600; color: var(--qp-mid); }
.sg-qp-bundle-row__toggle:has(input:checked) .sg-qp-toggle-lbl { color: var(--qp-accent); }

/* Qty inside bundle row */
.sg-qp-bundle-row__qty {}

/* ── Footer ──────────────────────────────────────────────────── */

.sg-qp-bundle__foot {
  padding: 16px 20px;
  border-top: 1.5px solid var(--qp-border);
  background: var(--qp-bg);
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 0 0 16px 16px;
}

.sg-qp-bundle__price-summary { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

.sg-qp-bundle__price-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.sg-qp-bundle__price-label { font-size: 13px; color: var(--qp-mid); }

.sg-qp-bundle__price-val { display: flex; align-items: baseline; gap: 8px; }

.sg-qp-bundle__price-regular { font-size: 13px; color: var(--qp-muted); text-decoration: line-through; }
.sg-qp-bundle__price-total { font-size: 1.3rem; font-weight: 800; color: var(--qp-dark); }
.sg-qp-bundle__saving {
  font-size: 11px;
  font-weight: 700;
  background: var(--qp-primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: 20px;
}

.sg-qp-bundle__included-count { font-size: 12px; color: var(--qp-muted); }

.sg-qp-bundle__notice { margin: 0 20px; }

/* ── Notices (shared) ───────────────────────────────────────── */

.sg-qp-notice {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 7px;
}
.sg-qp-notice--warn  { background: #fffbeb; color: var(--qp-dark); border: 1px solid rgba(245,158,11,.3); }
.sg-qp-notice--error { background: rgba(239,68,68,.06); color: var(--qp-danger); border: 1px solid rgba(239,68,68,.2); }

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 540px) {
  .sg-qp-bundle-row {
    grid-template-columns: 48px 1fr;
    grid-template-rows: auto auto;
  }
  .sg-qp-bundle-row__img { width: 48px; height: 48px; }
  .sg-qp-bundle-row__img img { width: 48px; height: 48px; }
  .sg-qp-bundle-row__right {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-top: 4px;
    border-top: 1px solid var(--qp-bg);
    margin-top: 4px;
  }
  .sg-qp-bundle__head { flex-direction: column; }
  .sg-qp-bundle__price-summary { flex-direction: column; align-items: flex-start; }
}
