/* ═══════════════════════════════════════════════════════════════════════════
   Seller Profile Screen
   ═══════════════════════════════════════════════════════════════════════════ */

#screen-seller-profile {
  background: #F3F4F6;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  overflow: hidden;
  z-index: 300;
}
/* ── Header ────────────────────────────────────────────────────────────────── */
.sp-header {
  background: #FFFFFF;
  flex-shrink: 0;
  z-index: 310;
  position: sticky;
  top: 0;
}

body.platform-ios.tg-fullscreen .sp-header,
body.platform-android.tg-expanded .sp-header {
  padding-top: max(
    env(safe-area-inset-top, 0px),
    var(--tg-content-safe-area-inset-top, 0px)
  );
}

body.tg-active.platform-ios:not(.tg-fullscreen) .sp-header,
body.tg-active.platform-android:not(.tg-expanded) .sp-header {
  padding-top: 0;
}

.sp-header-inner {
  display: flex;
  height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
}

.sp-header-title {
  font-size: 16px;
  font-weight: 600;
  color: #000;
  text-align: center;
  flex: 1;
}

.sp-back-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: 12px;
  color: #635CFB;
}

/* В Telegram скрываем HTML-кнопку назад — используем нативную BackButton */
body.tg-active .sp-back-btn {
  visibility: hidden;
  pointer-events: none;
}

/* ── Scroll Area ───────────────────────────────────────────────────────────── */
.sp-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0 0;
}
.sp-scroll::-webkit-scrollbar { display: none; }

/* ── Cards / Sections ──────────────────────────────────────────────────────── */
.sp-card {
  background: #FFFFFF;
  border-radius: 8px;
  margin: 0 0;
  padding: 16px 12px;
}
.sp-card:last-of-type {
  flex-grow: 1;
  border-radius: 8px 8px 0 0;
  padding-bottom: 32px;
}

/* ── Profile Card ──────────────────────────────────────────────────────────── */
.sp-profile-card {
  padding: 20px 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.sp-avatar-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  background: #F3F4F6;
  flex-shrink: 0;
}
.sp-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.sp-avatar-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  color: #635CFB;
  background: #EEEDFF;
  border-radius: 50%;
}

.sp-profile-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}
.sp-seller-name {
  font-size: 16px;
  font-weight: 600;
  color: #000;
  text-align: center;
}
.sp-member-since {
  font-size: 12px;
  font-weight: 400;
  color: #000;
  text-align: center;
}
.sp-location-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.sp-location-row svg {
  flex-shrink: 0;
}
.sp-location-text {
  font-size: 12px;
  color: #8E8E93;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-online-badge {
  background: #34C759;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 99px;
  white-space: nowrap;
}

/* ── Stats Row ─────────────────────────────────────────────────────────────── */
.sp-stats-box {
  border: 1px solid #E5E5EA;
  border-radius: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-top: 4px;
  width: 100%;
  padding: 15px 12px;
  box-sizing: border-box;
  gap: 14px;
}
.sp-stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0;
}
.sp-stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sp-stat-icon--red   { background: rgba(255, 56, 60, 0.12); }
.sp-stat-icon--green { background: rgba(52, 199, 89, 0.12); }
.sp-stat-icon--purple{ background: rgba(99, 92, 251, 0.12); }
.sp-stat-icon--orange{ background: rgba(255, 141, 40, 0.12); }

.sp-stat-icon svg { width: 20px; height: 20px; }

.sp-stat-texts {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.sp-stat-val {
  font-size: 14px;
  font-weight: 700;
  color: #000;
  line-height: 1.4;
}
.sp-stat-lbl {
  font-size: 12px;
  color: #8E8E93;
  text-align: center;
  line-height: 1.4;
}

/* ── Trust Section ─────────────────────────────────────────────────────────── */
.sp-trust-title {
  font-size: 14px;
  font-weight: 600;
  color: #000;
  margin-bottom: 16px;
}
.sp-trust-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sp-trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sp-trust-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(99, 92, 251, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #635CFB;
  flex-shrink: 0;
}
.sp-trust-text {
  font-size: 14px;
  color: #000;
  font-weight: 400;
}

/* ── Reviews Section ───────────────────────────────────────────────────────── */
.sp-reviews-title {
  font-size: 14px;
  font-weight: 600;
  color: #000;
  margin-bottom: 14px;
}
.sp-reviews-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sp-review-card {
  border: 1px solid #E5E5EA;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sp-review-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.sp-review-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: #F3F4F6;
  flex-shrink: 0;
}
.sp-review-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.sp-review-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.sp-review-name {
  font-size: 14px;
  font-weight: 600;
  color: #000;
  line-height: 1;
}
.sp-review-stars {
  display: flex;
  gap: 4px;
  align-items: center;
}
.sp-review-stars svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.sp-review-date {
  font-size: 14px;
  font-weight: 400;
  color: #8E8E93;
  white-space: nowrap;
  margin-left: auto;
  flex-shrink: 0;
}
.sp-review-text {
  font-size: 12px;
  font-weight: 400;
  color: #000;
  line-height: 1.5;
}

/* ── Write Review CTA ──────────────────────────────────────────────────────── */
.sp-review-cta {
  border: 1px solid #635CFB;
  border-radius: 16px;
  background: rgba(99, 92, 251, 0.12);
  padding: 12px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sp-review-cta-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.sp-review-cta-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(99, 92, 251, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sp-review-cta-texts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.sp-review-cta-title {
  font-size: 14px;
  font-weight: 600;
  color: #000;
}
.sp-review-cta-desc {
  font-size: 12px;
  color: #8E8E93;
  line-height: 1.5;
}
.sp-review-btn {
  background: #635CFB;
  color: #FFFFFF;
  border: none;
  border-radius: 12px;
  height: 40px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  font-family: var(--font);
  transition: transform 0.15s;
}
.sp-review-btn:active { transform: scale(0.97); }

/* ── Other Ads Section ─────────────────────────────────────────────────────── */
.sp-other-ads-title {
  font-size: 14px;
  font-weight: 600;
  color: #000;
  margin-bottom: 14px;
}
.sp-ads-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.sp-ad-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
}
.sp-ad-img-wrap {
  position: relative;
  width: 100%;
  height: 148px;
  border-radius: 16px;
  overflow: hidden;
  background: #F3F4F6;
  flex-shrink: 0;
}
.sp-ad-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sp-ad-fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #FFFFFF;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.sp-ad-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sp-ad-price {
  font-size: 16px;
  font-weight: 700;
  color: #000;
  line-height: 18px;
}
.sp-ad-title {
  font-size: 14px;
  font-weight: 400;
  color: #000;
  line-height: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-ad-meta {
  font-size: 12px;
  color: #8E8E93;
  line-height: 18px;
}

/* ── See All Button ────────────────────────────────────────────────────────── */
.sp-see-all-btn {
  border: 1px solid #E5E5EA;
  border-radius: 12px;
  height: 40px;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 500;
  color: #635CFB;
  font-family: var(--font);
  width: 100%;
  transition: transform 0.15s;
}
.sp-see-all-btn:active { transform: scale(0.97); }

/* ── iOS Fullscreen offset — обрабатывается через padding-top выше ─────────── */