.sg-marketplace-root *,
.sg-modal-overlay * {
  box-sizing: border-box;
}

/* ── Isolation: prevent theme button/input styles from leaking into plugin ── */
.sg-marketplace-root button,
.sg-marketplace-root [type="button"],
.sg-marketplace-root [type="submit"],
.sg-marketplace-root [type="reset"],
.sg-marketplace-root input,
.sg-marketplace-root select,
.sg-marketplace-root textarea,
.sg-modal-overlay button,
.sg-modal-overlay [type="button"],
.sg-modal-overlay [type="submit"],
.sg-modal-overlay [type="reset"],
.sg-modal-overlay input,
.sg-modal-overlay select,
.sg-modal-overlay textarea {
  font-family: inherit;
  line-height: normal;
  text-transform: none;
  letter-spacing: normal;
  text-shadow: none;
}

.sg-marketplace-root {
  font-family: "Inter", sans-serif;
  background: #f8fafc;
  color: #0f172a;
  line-height: 1.5;
}

.sg-marketplace-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.sg-section-title {
  text-align: center;
  margin-bottom: 2.5rem;
}

.sg-marketplace-root .sg-section-title h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.02em;
}

.sg-marketplace-root .sg-section-title p {
  color: #64748b;
  margin: 0.5rem 0 0;
  font-size: 1rem;
  font-weight: 400;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.sg-tiers-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  align-items: flex-end;
}

.sg-trophy-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  width: 300px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
}

.sg-trophy-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.sg-trophy-card--featured {
  transform: scale(1.03);
  z-index: 2;
  box-shadow: 0 8px 28px rgba(0, 125, 179, 0.18);
  border-color: rgba(0, 162, 156, 0.35);
}

.sg-trophy-card--featured:hover {
  transform: scale(1.03) translateY(-6px);
  box-shadow: 0 12px 32px rgba(0, 125, 179, 0.22);
}

.sg-trophy-header {
  padding: 1.5rem 1.25rem 1.25rem;
  text-align: center;
  background-image: -webkit-linear-gradient(180deg, #00a29c 0%, #007db3 100%);
  background-image: linear-gradient(180deg, #00a29c 0%, #007db3 100%);
}

.sg-trophy-icon {
  font-size: 3.2rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.sg-trophy-icon img {
  width: 5.5rem;
  height: 5.5rem;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.sg-trophy-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.sg-trophy-sub {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.92);
  margin-top: 0.25rem;
  font-weight: 500;
}

.sg-trophy-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.sg-trophy-feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-weight: 500;
  margin: 10px 0;
  font-size: 0.9375rem;
  color: #0f172a;
  line-height: 1.45;
}

.sg-trophy-feature:first-of-type {
  margin-top: 0;
}

.sg-trophy-feature::before {
  content: '\2713';
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  line-height: 15px;
  text-align: center;
  border-radius: 50%;
  background: #3b82f6;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  margin-top: 2px;
}

.sg-trophy-feature .fas {
  display: none;
}

.sg-small-disclaimer-preview {
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 1rem;
  margin-bottom: 0;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
  line-height: 1.5;
  font-weight: 400;
  flex-shrink: 0;
}

.sg-marketplace-root .sg-btn-select {
  margin-top: 30px;
  background-color: transparent;
  background-image: -webkit-linear-gradient(180deg, #00a29c 0%, #007db3 100%);
  background-image: linear-gradient(180deg, #00a29c 0%, #007db3 100%);
  color: #fff;
  border: none;
  width: 100%;
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: filter 0.2s ease;
  text-shadow: none;
  box-shadow: none;
  text-transform: none;
  letter-spacing: normal;
}

.sg-marketplace-root .sg-btn-select:hover {
  filter: brightness(1.05);
}

.sg-marketplace-footnote {
  margin: 20px auto 0;
  max-width: 42rem;
  text-align: center;
  font-size: 0.875rem;
  color: #475569;
  line-height: 1.45;
}

.sg-chat-reminder-banner {
  margin-top: 2rem;
  text-align: center;
  background: #e7f1ff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.85rem;
}

body.sg-modal-open {
  overflow: hidden;
}

.sg-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.sg-modal-overlay.active {
  visibility: visible;
  opacity: 1;
}

.sg-modal-container {
  background: #fff;
  max-width: 580px;
  width: 90%;
  border-radius: 2rem;
  box-shadow: 0 30px 50px rgba(0, 0, 0, 0.3);
  max-height: 90vh;
  overflow-y: auto;
}

.sg-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.8rem;
  border-bottom: 1px solid #e9ecef;
}

.sg-modal-overlay .sg-modal-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0;
}

.sg-modal-overlay .sg-close-modal {
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #8b9ab0;
  box-shadow: none;
  text-shadow: none;
  padding: 0;
  line-height: 1;
}

.sg-modal-body {
  padding: 1.5rem 1.8rem 2rem;
}

.sg-disclaimer-box {
  background: #fef3e2;
  padding: 1rem;
  border-radius: 1rem;
  font-size: 0.85rem;
  margin: 0 0 1rem;
  border-left: 4px solid #f5b042;
  color: #5a4a2c;
}

.sg-form-group {
  margin-bottom: 1.25rem;
}

.sg-modal-overlay .sg-form-group label {
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
  color: inherit;
}

.sg-modal-overlay .sg-form-group select,
.sg-modal-overlay .sg-form-group input[type="number"],
.sg-modal-overlay .sg-form-group input[type="text"] {
  width: 100%;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #ced4da;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: #0f172a;
  box-shadow: none;
}

.sg-extra-original {
  margin-top: 10px;
  background: #f8f9fa;
  padding: 12px;
  border-radius: 1rem;
}

.sg-slider-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-weight: 600;
}

#sgExtraSlider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #cbd5e1;
  outline: none;
  cursor: pointer;
  display: block;
  border: none;
  padding: 0;
  margin: 4px 0;
}

#sgExtraSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #00a29c;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  margin-top: -7px;
}

#sgExtraSlider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #00a29c;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

#sgExtraSlider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
}

#sgExtraSlider::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: #cbd5e1;
}

#sgExtraSlider::-moz-range-progress {
  height: 6px;
  border-radius: 3px;
  background: #00a29c;
}

.sg-price-live {
  background: rgba(0, 162, 156, 0.1);
  padding: 0.8rem 1rem;
  border-radius: 1rem;
  font-weight: 700;
  font-size: 1.3rem;
  margin: 1rem 0;
  text-align: center;
}

.sg-price-live .sg-price-sub {
  display: block;
  margin-top: 6px;
  font-size: 0.72rem;
  font-weight: 400;
}

.sg-modal-overlay .sg-btn-purchase {
  background-color: transparent;
  background-image: -webkit-linear-gradient(180deg, #00a29c 0%, #007db3 100%);
  background-image: linear-gradient(180deg, #00a29c 0%, #007db3 100%);
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  cursor: pointer;
  transition: filter 0.2s ease;
  text-shadow: none;
  box-shadow: none;
  text-transform: none;
  letter-spacing: normal;
}

.sg-modal-overlay .sg-btn-purchase:hover {
  filter: brightness(1.05);
}

.sg-modal-overlay .sg-btn-purchase[disabled] {
  opacity: 0.7;
  cursor: wait;
}

.sg-purchase-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.sg-purchase-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  min-height: 28px;
  color: #475569;
  font-size: 0.875rem;
  font-weight: 500;
}

.sg-purchase-progress[hidden] {
  display: none !important;
}

.sg-purchase-progress__spinner {
  width: 22px;
  height: 22px;
  border: 2px solid #e2e8f0;
  border-top-color: #007db3;
  border-radius: 50%;
  animation: sg-purchase-spin 0.65s linear infinite;
  flex-shrink: 0;
}

@keyframes sg-purchase-spin {
  to {
    transform: rotate(360deg);
  }
}

.sg-small-legal {
  font-size: 0.72rem;
  color: #6c757d;
  margin: 8px 0;
}

.sg-chat-rounded {
  background: #f8f1e0;
  border-radius: 999px;
  padding: 8px 12px;
  text-align: center;
  font-size: 0.75rem;
}

.sg-chat-rounded code {
  font-size: 0.75rem;
  background: #fff;
  padding: 2px 6px;
  border-radius: 6px;
}

@media (max-width: 640px) {
  .sg-tiers-grid {
    align-items: stretch;
  }

  .sg-trophy-card--featured {
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  .sg-trophy-card--featured:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  }
}

/* ═══════════════════════════════════════════════════════════════
   MARKETPLACE FILTER BAR — scoped under .sg-marketplace-root
   so theme / plugin styles cannot override. Uses !important only
   on properties that commonly bleed in from themes.
   ═══════════════════════════════════════════════════════════════ */

/* ── Card shell ─────────────────────────────────────────────── */
.sg-marketplace-root .sg-mp-filter-bar {
  display: block;
  width: 100%;
  background: #ffffff !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 14px;
  padding: 20px 22px 16px;
  margin-bottom: 28px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  box-sizing: border-box;
  font-family: "Inter", ui-sans-serif, sans-serif;
}

/* ── Flex row wraps gracefully on smaller screens ───────────── */
.sg-marketplace-root .sg-mp-filter-row--main {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}

/* ── Individual field ───────────────────────────────────────── */
.sg-marketplace-root .sg-mp-filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 160px;
  min-width: 0;
}

.sg-marketplace-root .sg-mp-filter-field--search {
  flex: 2 1 220px;
}

.sg-marketplace-root .sg-mp-filter-field--verified {
  flex: 0 0 auto;
  justify-content: flex-end;
}

/* ── Labels ─────────────────────────────────────────────────── */
.sg-marketplace-root .sg-mp-filter-label {
  display: block !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #64748B !important;
  text-transform: uppercase !important;
  letter-spacing: .06em !important;
  font-family: "Inter", ui-sans-serif, sans-serif !important;
  line-height: 1.2 !important;
  margin: 0 0 2px !important;
  padding: 0 !important;
}

/* ── Search icon wrapper ─────────────────────────────────────── */
.sg-marketplace-root .sg-mp-input-icon-wrap {
  position: relative;
  display: block;
}
.sg-marketplace-root .sg-mp-input-icon {
  position: absolute !important;
  left: 12px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: #94A3B8 !important;
  font-size: 13px !important;
  pointer-events: none !important;
  z-index: 1 !important;
}

/* ── Inputs & selects ───────────────────────────────────────── */
.sg-marketplace-root .sg-mp-filter-bar input[type="search"],
.sg-marketplace-root .sg-mp-filter-bar input[type="text"],
.sg-marketplace-root .sg-mp-filter-bar select {
  display: block !important;
  width: 100% !important;
  height: 42px !important;
  padding: 0 14px !important;
  font-size: 14px !important;
  font-family: "Inter", ui-sans-serif, sans-serif !important;
  font-weight: 400 !important;
  color: #0F172A !important;
  background-color: #F8FAFC !important;
  background-image: none !important;
  border: 1.5px solid #E2E8F0 !important;
  border-radius: 9px !important;
  box-shadow: none !important;
  outline: none !important;
  line-height: normal !important;
  transition: border-color .15s, box-shadow .15s !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

.sg-marketplace-root .sg-mp-filter-bar .sg-mp-input--has-icon {
  padding-left: 36px !important;
}

.sg-marketplace-root .sg-mp-filter-bar input[type="search"]:focus,
.sg-marketplace-root .sg-mp-filter-bar input[type="text"]:focus,
.sg-marketplace-root .sg-mp-filter-bar select:focus {
  border-color: #6366F1 !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,.12) !important;
  background-color: #fff !important;
  outline: none !important;
}

/* Chevron for selects */
.sg-marketplace-root .sg-mp-filter-bar select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 11px center !important;
  background-size: 14px !important;
  padding-right: 32px !important;
}

/* ── DSP Verified toggle ─────────────────────────────────────── */
.sg-marketplace-root .sg-mp-toggle-label {
  display: inline-flex !important;
  align-items: center !important;
  gap: 9px !important;
  cursor: pointer !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #334155 !important;
  font-family: "Inter", ui-sans-serif, sans-serif !important;
  white-space: nowrap !important;
  margin: 0 !important;
  padding: 8px 0 !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.sg-marketplace-root .sg-mp-toggle-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  clip: rect(0,0,0,0) !important;
  margin: 0 !important;
}

.sg-marketplace-root .sg-mp-toggle-track {
  display: inline-flex !important;
  flex-shrink: 0 !important;
  width: 36px !important;
  height: 20px !important;
  border-radius: 10px !important;
  background: #CBD5E1 !important;
  position: relative !important;
  transition: background .2s !important;
}

.sg-marketplace-root .sg-mp-toggle-thumb {
  position: absolute !important;
  top: 2px !important;
  left: 2px !important;
  width: 16px !important;
  height: 16px !important;
  border-radius: 50% !important;
  background: #fff !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.2) !important;
  transition: transform .18s !important;
}

.sg-marketplace-root .sg-mp-toggle-input:checked + .sg-mp-toggle-track {
  background: #6366F1 !important;
}
.sg-marketplace-root .sg-mp-toggle-input:checked + .sg-mp-toggle-track .sg-mp-toggle-thumb {
  transform: translateX(16px) !important;
}

/* ── Action buttons ─────────────────────────────────────────── */
.sg-marketplace-root .sg-mp-filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #F1F5F9;
}

.sg-marketplace-root .sg-mp-filter-apply {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 40px !important;
  padding: 0 22px !important;
  font-size: 14px !important;
  font-family: "Inter", ui-sans-serif, sans-serif !important;
  font-weight: 600 !important;
  color: #fff !important;
  background: var(--sg-gradient, linear-gradient(135deg,#6366F1,#4F46E5)) !important;
  border: none !important;
  border-radius: 9px !important;
  cursor: pointer !important;
  text-decoration: none !important;
  text-shadow: none !important;
  box-shadow: 0 2px 6px rgba(99,102,241,.28) !important;
  transition: opacity .15s, box-shadow .15s !important;
  white-space: nowrap !important;
  line-height: 1 !important;
}

.sg-marketplace-root .sg-mp-filter-apply:hover {
  opacity: .88 !important;
  box-shadow: 0 4px 12px rgba(99,102,241,.35) !important;
  color: #fff !important;
}

.sg-marketplace-root .sg-mp-filter-reset {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  height: 40px !important;
  padding: 0 16px !important;
  font-size: 13px !important;
  font-family: "Inter", ui-sans-serif, sans-serif !important;
  font-weight: 500 !important;
  color: #64748B !important;
  background: transparent !important;
  border: 1.5px solid #E2E8F0 !important;
  border-radius: 9px !important;
  cursor: pointer !important;
  line-height: 1 !important;
  transition: border-color .15s, color .15s !important;
  white-space: nowrap !important;
  text-shadow: none !important;
}

.sg-marketplace-root .sg-mp-filter-reset:hover {
  border-color: #94A3B8 !important;
  color: #334155 !important;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .sg-marketplace-root .sg-mp-filter-bar { padding: 14px; }
  .sg-marketplace-root .sg-mp-filter-field { flex: 1 1 100%; }
  .sg-marketplace-root .sg-mp-filter-field--verified { flex: 1 1 100%; }
  .sg-marketplace-root .sg-mp-filter-actions { flex-direction: column; }
  .sg-marketplace-root .sg-mp-filter-apply,
  .sg-marketplace-root .sg-mp-filter-reset { width: 100% !important; }
}
