/* Perfil público do vendedor (v2). Usa as variáveis do site (navbar.css): --card-color, --border-color,
   --text-primary, --text-secondary, --primary-color. Referências: 21st.dev (densidade), cta.gallery (CTA),
   unsection (seções). */
.sp { --sp-radius: 14px; --sp-soft: color-mix(in srgb, var(--primary-color) 12%, transparent); --sp-muted: var(--text-secondary); --sp-line: var(--border-color); --sp-surface-2: color-mix(in srgb, var(--card-color) 92%, var(--text-primary) 8%); --sp-pos: #16a34a; --sp-neg: #dc2626; }
body.dark-theme .sp { --sp-muted: #a8b2c7; --sp-pos: #4ade80; --sp-neg: #f87171; }
.sp .hidden { display: none !important; }
.sp .banner-img { height: 220px; }
.sp .profile-container { margin-top: -84px; padding-bottom: 48px; }

.sp-card { background: var(--card-color); border: 1px solid var(--sp-line); border-radius: var(--sp-radius); padding: 20px; color: var(--text-primary); }
.sp-card h2 { font-family: var(--font-heading); font-size: 1.15rem; font-weight: 800; margin: 0; display: flex; align-items: center; gap: 8px; }
.sp-count { font-family: var(--font-body); font-size: .8rem; font-weight: 600; color: var(--sp-muted); background: var(--sp-surface-2); border-radius: 999px; padding: 2px 9px; }
.sp-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }

/* ---------- topo ---------- */
.sp-head { display: grid; grid-template-columns: auto 1fr auto; gap: 18px 20px; align-items: center; }
.sp-avatar { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; border: 4px solid var(--card-color); margin-top: -56px; background: var(--card-color); box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }
.sp-id { min-width: 0; }
.sp-id h1 { font-family: var(--font-heading); font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 800; margin: 0 0 8px; overflow-wrap: anywhere; }
.sp-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-tag { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--sp-surface-2); color: var(--text-primary); font-size: .8rem; font-weight: 500; }
.sp-tag i { color: var(--primary-color); font-size: .8rem; }
.sp-tag img { width: 18px; height: 18px; object-fit: contain; }
.sp-tag.is-ok i { color: var(--sp-pos); }
.sp-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.sp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--sp-line); background: transparent; color: var(--text-primary); font-weight: 600; font-size: .92rem; text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s, transform .1s; }
.sp-btn:hover { border-color: var(--primary-color); color: var(--text-primary); }
.sp-btn:active { transform: translateY(1px); }
.sp-btn:focus-visible, .sp-chip:focus-visible, .sp-cat:focus-visible, .sp-game-top:focus-visible, .sp-more:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }
.sp-btn--primary { background: #2563eb; border-color: #2563eb; color: #fff !important; box-shadow: 0 6px 18px rgba(37, 99, 235, .28); }
.sp-btn--primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.sp-btn--icon { width: 42px; padding: 0; }
.sp-btn--icon.is-done { border-color: var(--sp-pos); color: var(--sp-pos); }

.sp-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 4px 0 0; border: 1px solid var(--sp-line); border-radius: 12px; overflow: hidden; }
.sp-stats > div { padding: 12px 16px; border-right: 1px solid var(--sp-line); min-width: 0; }
.sp-stats > div:last-child { border-right: 0; }
.sp-stats dt { font-size: .75rem; font-weight: 500; color: var(--sp-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.sp-stats dd { margin: 0; font-family: var(--font-heading); font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.sp-stats dd small { display: block; font-family: var(--font-body); font-size: .75rem; font-weight: 500; color: var(--sp-muted); }

/* ---------- ofertas + sobre ---------- */
.sp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; margin: 16px 0; align-items: start; }
.sp-toolbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.sp-search { position: relative; }
.sp-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--sp-muted); font-size: .9rem; }
.sp-search input { width: 100%; height: 42px; padding: 0 14px 0 38px; border-radius: 10px; border: 1px solid var(--sp-line); background: var(--sp-surface-2); color: var(--text-primary); font-size: .92rem; outline: none; transition: border-color .15s, box-shadow .15s; }
.sp-search input::placeholder { color: var(--sp-muted); }
.sp-search input:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px var(--sp-soft); }
.sp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--sp-line); background: transparent; color: var(--sp-muted); font-size: .82rem; font-weight: 500; cursor: pointer; transition: all .15s; }
.sp-chip span { font-size: .72rem; font-weight: 700; background: var(--sp-surface-2); color: var(--text-primary); border-radius: 999px; padding: 1px 7px; }
.sp-chip:hover { border-color: var(--primary-color); color: var(--text-primary); }
.sp-chip.is-active { background: var(--sp-soft); border-color: var(--primary-color); color: var(--primary-color); font-weight: 600; }
.sp-chip.is-active span { background: var(--primary-color); color: #fff; }

.sp-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.sp-game { border: 1px solid var(--sp-line); border-radius: 12px; overflow: hidden; background: var(--sp-surface-2); display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
.sp-game:hover { border-color: var(--primary-color); }
.sp-game[hidden] { display: none; }
.sp-game-top { display: flex; align-items: center; gap: 12px; padding: 12px; text-decoration: none; color: var(--text-primary); }
.sp-game-top img, .sp-game-ph { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; background: var(--card-color); }
.sp-game-ph { display: flex; align-items: center; justify-content: center; color: var(--sp-muted); }
.sp-game-top h3 { font-size: .95rem; font-weight: 600; margin: 0 0 2px; line-height: 1.25; }
.sp-game-top span { font-size: .8rem; color: var(--sp-muted); }
.sp-game-cats { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 12px; margin-top: auto; }
.sp-cat { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px; background: var(--card-color); border: 1px solid var(--sp-line); color: var(--text-primary); font-size: .78rem; font-weight: 500; text-decoration: none; transition: all .15s; }
.sp-cat i { color: var(--primary-color); font-size: .75rem; }
.sp-cat b { font-weight: 700; color: var(--primary-color); }
.sp-cat:hover { border-color: var(--primary-color); background: var(--sp-soft); color: var(--text-primary); }
.sp-cat.is-dim { opacity: .45; }

.sp-about h2 { margin-bottom: 12px; }
.sp-desc { font-size: .9rem; line-height: 1.6; color: var(--text-primary); overflow-wrap: anywhere; }
.sp-desc.is-clamped { max-height: 200px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.sp-more { margin-top: 6px; border: 0; background: none; padding: 0; color: var(--primary-color); font-weight: 600; font-size: .85rem; cursor: pointer; }
.sp-rank { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--sp-line); }
.sp-rank img { object-fit: contain; }
.sp-rank small { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--sp-muted); }
.sp-rank strong { display: block; font-size: 1rem; }
.sp-rank a { font-size: .82rem; font-weight: 600; color: var(--primary-color); text-decoration: none; }

/* ---------- avaliações ---------- */
.sp-score { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .85rem; color: var(--sp-muted); }
.sp-score b { font-weight: 700; margin-right: 6px; }
.sp-score .is-pos { color: var(--sp-pos); }
.sp-score .is-neg { color: var(--sp-neg); }
.sp-bar { width: 140px; height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--sp-neg) 35%, transparent); overflow: hidden; }
.sp-bar span { display: block; height: 100%; background: var(--sp-pos); border-radius: 999px; }
.sp-reviews .sp-chips { margin-bottom: 8px; }
.sp-rev { display: grid; grid-template-columns: 118px 1fr auto; gap: 14px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--sp-line); }
.sp-rev:last-child { border-bottom: 0; }
.sp-rev-type { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; justify-self: start; }
.sp-rev-type.is-pos { color: var(--sp-pos); background: color-mix(in srgb, var(--sp-pos) 14%, transparent); }
.sp-rev-type.is-neg { color: var(--sp-neg); background: color-mix(in srgb, var(--sp-neg) 14%, transparent); }
.sp-rev-type.is-rep { color: #b45309; background: rgba(245, 158, 11, .15); }
body.dark-theme .sp-rev-type.is-rep { color: #fbbf24; }
.sp-rev-main { min-width: 0; }
.sp-rev-main p { margin: 0 0 2px; font-size: .9rem; overflow-wrap: anywhere; }
.sp-rev-main p.is-muted { color: var(--sp-muted); font-style: italic; }
.sp-rev-main small, .sp-rev time { font-size: .78rem; color: var(--sp-muted); }
.sp-rev time { white-space: nowrap; }
.sp-empty { text-align: center; padding: 28px 12px; color: var(--sp-muted); }
.sp-empty i { font-size: 1.8rem; opacity: .6; margin-bottom: 8px; }
.sp-empty p { margin: 0; }
.sp-empty-line { padding: 16px 4px; color: var(--sp-muted); margin: 0; }
.sp-skel { display: grid; gap: 10px; padding: 8px 0; }
.sp-skel i { display: block; height: 44px; border-radius: 10px; background: var(--sp-surface-2); }
@media (prefers-reduced-motion: no-preference) { .sp-skel { animation: sp-pulse 1.4s ease-in-out infinite; } }
@keyframes sp-pulse { 50% { opacity: .55; } }

/* ---------- responsivo ---------- */
@media (max-width: 991px) {
    .sp-grid { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
    .sp .banner-img { height: 150px; }
    .sp .profile-container { margin-top: -60px; }
    .sp-head { grid-template-columns: 1fr; justify-items: center; text-align: center; }
    .sp-avatar { width: 96px; height: 96px; margin-top: -60px; }
    .sp-tags, .sp-actions { justify-content: center; }
    .sp-actions { width: 100%; }
    .sp-actions .sp-btn--primary { flex: 1 1 auto; }
    .sp-stats { grid-template-columns: repeat(2, 1fr); text-align: left; width: 100%; }
    .sp-stats > div:nth-child(2) { border-right: 0; }
    .sp-stats > div:nth-child(-n+2) { border-bottom: 1px solid var(--sp-line); }
    .sp-rev { grid-template-columns: 1fr auto; }
    .sp-rev-main { grid-column: 1 / -1; grid-row: 2; }
    .sp-card { padding: 16px; }
}

/* ---------- perfil do próprio vendedor (edição) ---------- */
.sp-muted { color: var(--sp-muted); font-weight: 500; }
.sp-sub { margin: 4px 0 0; font-size: .85rem; color: var(--sp-muted); }
.sp-link { border: 0; background: none; padding: 0; color: var(--primary-color); font-weight: 600; font-size: .85rem; text-decoration: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.sp-link:hover { text-decoration: underline; color: var(--primary-color); }
.sp-btn--sm { height: 34px; padding: 0 12px; font-size: .82rem; }
.sp-banner-edit { position: relative; }
.sp-banner-btn { position: absolute; right: 16px; bottom: 100px; z-index: 3; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .35); background: rgba(15, 23, 42, .62); color: #fff; font-size: .82rem; font-weight: 600; cursor: pointer; backdrop-filter: blur(6px); }
.sp-banner-btn small { font-weight: 400; opacity: .75; }
.sp-banner-btn:hover { background: rgba(15, 23, 42, .8); }
.sp-avatar-edit { position: relative; border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; align-self: start; }
.sp-avatar-edit span { position: absolute; right: 4px; bottom: 4px; width: 32px; height: 32px; border-radius: 50%; background: #2563eb; color: #fff; display: flex; align-items: center; justify-content: center; border: 3px solid var(--card-color); font-size: .8rem; }
.sp-avatar-edit:hover .sp-avatar { filter: brightness(.85); }
.sp-avatar-edit:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 3px; }
.sp-level { display: flex; align-items: center; gap: 10px; margin-top: 10px; max-width: 360px; }
.sp-level small { font-size: .75rem; color: var(--sp-muted); white-space: nowrap; }
.sp-bar--brand { background: var(--sp-surface-2); flex: 1 1 auto; }
.sp-bar--brand span { background: linear-gradient(90deg, #3b82f6, #2563eb); }

.sp-setup { margin-top: 16px; }
.sp-setup-bar { width: 180px; height: 8px; }
.sp-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.sp-steps li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--sp-line); border-radius: 10px; font-size: .88rem; }
.sp-steps li > i { color: var(--sp-muted); font-size: .95rem; }
.sp-steps li span { flex: 1 1 auto; min-width: 0; }
.sp-steps li.is-done { background: var(--sp-surface-2); }
.sp-steps li.is-done > i { color: var(--sp-pos); }
.sp-steps li.is-done span { color: var(--sp-muted); }
.sp-steps li small { font-size: .78rem; color: var(--sp-pos); font-weight: 600; }
.sp-steps li a, .sp-steps li button { border: 0; background: none; padding: 0; color: var(--primary-color); font-size: .8rem; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }

.sp-about .sp-sec-head { margin-bottom: 10px; }
.sp-about h3 { font-size: .95rem; font-weight: 700; margin: 0; }
.sp-sub-sec { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--sp-line); }
.sp-textarea { width: 100%; min-height: 160px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--sp-line); background: var(--sp-surface-2); color: var(--text-primary); font-size: .9rem; line-height: 1.5; resize: vertical; outline: none; }
.sp-textarea:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px var(--sp-soft); }
.sp-edit-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.sp-edit-row > div { display: flex; gap: 6px; }
.sp-edit-row small { color: var(--sp-muted); font-size: .75rem; }
.sp-langs { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-lang { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 4px 0 10px; border-radius: 999px; background: var(--sp-surface-2); font-size: .82rem; }
.sp-lang b { font-weight: 600; }
.sp-lang small { color: var(--sp-muted); }
.sp-lang.is-busy { opacity: .5; pointer-events: none; }
.sp-lang-x { width: 24px; height: 24px; border-radius: 50%; border: 0; background: transparent; color: var(--sp-muted); font-size: .7rem; cursor: pointer; }
.sp-lang-x:hover { background: color-mix(in srgb, var(--sp-neg) 15%, transparent); color: var(--sp-neg); }
.sp-lang-form { display: grid; gap: 8px; margin-top: 10px; }
.sp-lang-form .form-select { background-color: var(--sp-surface-2); color: var(--text-primary); border-color: var(--sp-line); }
.sp-rank--owner strong { font-size: .95rem; }
.sp-rank--owner .sp-bar { margin: 6px 0; height: 8px; }
.sp-rank-msg { margin: 0 0 4px; font-size: .78rem; color: var(--sp-muted); }
body.sp-uploading { cursor: progress; }
@media (max-width: 767px) {
    .sp-banner-btn { bottom: 72px; right: 10px; }
    .sp-banner-btn small { display: none; }
    .sp-avatar-edit { justify-self: center; }
    .sp-level { margin: 10px auto 0; }
    .sp-setup-bar { width: 100%; }
}
