/* =========================
   ScanWin — merchant-profile.css
   -------------------------
   Merchant "My Profile" deltas layered over the shared profile.css
   (reused from the Influencer build). Loaded last on merchant/profile.html.
   Holds: store-icon banner avatar, the account-level header badge, the
   Holdings child-entity roster (higher levels), and the merchant-only
   Premium unlock card. (Social handles / Message preview were removed —
   the new merchant Profile design has no social section.)
   Figma: Desktop 1567:12611 · Mobile 1567:22088
========================= */

/* Banner avatar — merchant uses a store icon instead of a photo:
   white circle, soft drop shadow, violet glyph (figma 1567:12611 / 22123). */
.sw-prof-banner__store {
  width: 64px;
  height: 64px;
  background: #fff;
  color: var(--sw-violet);
  box-shadow: 0 6px 16px rgba(15, 16, 32, 0.12);
}
.sw-prof-banner__store svg {
  width: 30px;
  height: 30px;
}

/* Mobile: centered banner, avatar overlaps the gradient strip, and the
   tier pill wraps onto its own line below name + verified (figma 1567:22123). */
@media (max-width: 575.98px) {
  .sw-prof-banner__store {
    width: 80px;
    height: 80px;
    margin-top: -60px;
  }
  .sw-prof-banner__body {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .sw-prof-banner__text {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
  .sw-prof-banner__name-row {
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    column-gap: 8px;
    row-gap: 8px;
  }
  .sw-prof-banner__name { order: 1; }
  .sw-verified-chip { order: 2; }
  /* zero-height full-width break → forces the tier pill to the next line */
  .sw-prof-banner__name-row::after {
    content: "";
    order: 3;
    flex-basis: 100%;
    height: 0;
  }
  .sw-tier-pill { order: 4; }
}

/* =========================
   Account-level badge (header name row) — figma 1567:12611.
   One profile template, four scopes. The word + colour are swapped
   from account.level: distributor / chain / division / location.
========================= */
.sw-prof-banner__level {
  --bs-badge-padding-y: 4px;
  --bs-badge-padding-x: 10px;
  --bs-badge-font-size: 10px;
  --bs-badge-font-weight: 700;
  line-height: inherit;
  letter-spacing: 0.5px;
}
.sw-prof-banner__level--distributor { --bs-badge-color: #fff; background: var(--sw-violet); }
.sw-prof-banner__level--chain { --bs-badge-color: #2973d9; background: #e5f0fc; }
.sw-prof-banner__level--division { --bs-badge-color: #6d28d9; background: #efeafe; }
.sw-prof-banner__level--location { --bs-badge-color: #047857; background: #e7f7ee; }

/* Mobile: keep the level badge with the verified chip on the wrapped row */
@media (max-width: 575.98px) {
  .sw-prof-banner__level { order: 2; }
}

/* =========================
   Holdings card — child-entity roster with rolled-up metrics.
   Shown on the Distributor / Chain / Division variants only; a
   Location profile does not have this section (figma dev note).
========================= */
.sw-hold-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--sw-border);
}
.sw-hold-row:first-of-type { padding-top: 4px; }
.sw-hold-row:last-child { border-bottom: 0; padding-bottom: 0; }
.sw-hold-ico {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--sw-violet-50, #f5f4fe);
  color: var(--sw-violet);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sw-hold-ico svg { width: 20px; height: 20px; }
.sw-hold-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sw-hold-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sw-hold-name {
  font-size: 14px;
  font-weight: 600;
  color: #0f1020;
}
.sw-hold-lvl {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.sw-hold-lvl--chain { background: #e5f0fc; color: #2973d9; }
.sw-hold-lvl--division { background: #efeafe; color: #6d28d9; }
.sw-hold-lvl--location { background: #e7f7ee; color: #047857; }
.sw-hold-meta {
  font-size: 12px;
  color: var(--sw-text-muted);
}
.sw-hold-stats {
  display: flex;
  gap: 26px;
  flex-shrink: 0;
}
.sw-hold-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.25;
}
.sw-hold-stat__val {
  font-size: 14px;
  font-weight: 700;
  color: #0f1020;
}
.sw-hold-stat__lbl {
  font-size: 11px;
  color: var(--sw-text-faint);
}
.sw-hold-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sw-violet);
  text-decoration: none;
  flex-shrink: 0;
}
.sw-hold-link svg { width: 14px; height: 14px; }

/* Stack the roll-up stats under the name on narrower viewports */
@media (max-width: 991.98px) {
  .sw-hold-stats { gap: 18px; }
}
@media (max-width: 575.98px) {
  .sw-hold-row { flex-wrap: wrap; }
  .sw-hold-stats {
    width: 100%;
    justify-content: flex-start;
    gap: 22px;
    padding-left: 56px;
  }
  .sw-hold-stat { align-items: flex-start; }
  .sw-hold-link { padding-left: 56px; }
}

/* =========================
   Premium unlock card — violet-accented variant of the shared comp-card
========================= */
.sw-comp-card--premium {
  --bs-card-bg: #efeafe;
  --bs-card-border-width: 1px;
  --bs-card-border-color: #e2dbfb;
}
.sw-comp-card--premium .sw-comp-card__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--sw-violet);
}
.sw-comp-card--premium .sw-comp-card__title svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.sw-comp-card--premium .sw-comp-card__pct {
  color: var(--sw-violet);
}

/* Social handles + message preview — figma 1567:12753 · mobile 1567:22190 */
.sw-soc {
  gap: 18px;
}
.sw-soc__intro {
  gap: 2px;
}
.sw-soc__sub {
  font-size: 12px;
  line-height: 16px;
  color: #6b7280;
}
.sw-soc__cadence {
  font-size: 11px;
  line-height: 13px;
  color: #9499a8;
}
.sw-soc__count {
  --bs-badge-padding-y: 4px;
  --bs-badge-padding-x: 10px;
  --bs-badge-font-size: 10px;
  --bs-badge-font-weight: 600;
  --bs-badge-color: #047857;
  gap: 5px;
  padding-left: 8px;
  line-height: 12px;
  letter-spacing: 0.4px;
  background: #d1fae5;
}
.sw-soc__row {
  padding: 10px 16px;
  border-radius: 12px;
  background: #f3f4f6;
}
.sw-soc__id {
  flex: 1 0 0;
  gap: 12px;
  min-width: 1px;
}
.sw-soc__logo-crop {
  width: 36px;
  height: 36px;
}
.sw-soc__logo-crop img {
  top: -25%;
  left: -25.29%;
  width: 150%;
  height: 150%;
}
.sw-soc__name--linked {
  gap: 2px;
}
.sw-soc__platform {
  font-size: 14px;
  line-height: 20px;
}
.sw-soc__handle {
  font-size: 12px;
  line-height: 16px;
}
.sw-soc__verif {
  font-size: 10.5px;
  line-height: 13px;
  color: #059669;
}
.sw-soc__verif--pending {
  color: #b4761a;
}
.sw-soc__status {
  gap: 12px;
}
.sw-soc__followers {
  font-size: 11px;
  line-height: 13px;
  color: #6b6f7b;
}
.sw-soc__pill {
  --bs-badge-padding-y: 4px;
  --bs-badge-padding-x: 10px;
  --bs-badge-font-size: 10px;
  --bs-badge-font-weight: 600;
  --bs-badge-color: #047857;
  padding-left: 8px;
  line-height: 12px;
  background: #d1fae5;
}
.sw-soc__pill--pending {
  --bs-badge-color: #b4761a;
  background: #fdf0dc;
}
.sw-soc__disconnect {
  --bs-btn-padding-y: 0px;
  --bs-btn-padding-x: 0px;
  --bs-btn-font-size: 12.5px;
  --bs-btn-font-weight: 600;
  --bs-btn-line-height: 15px;
  --bs-btn-color: #d13d3d;
  --bs-btn-bg: transparent;
  --bs-btn-border-width: 0px;
  --bs-btn-border-color: transparent;
  --bs-btn-border-radius: var(--bs-border-radius-pill);
  --bs-btn-hover-color: #d13d3d;
  --bs-btn-hover-bg: transparent;
  --bs-btn-hover-border-color: transparent;
  --bs-btn-active-color: #d13d3d;
  --bs-btn-active-bg: transparent;
  --bs-btn-active-border-color: transparent;
}
.sw-soc__connect {
  --bs-btn-padding-y: 5px;
  --bs-btn-padding-x: 11px;
  --bs-btn-font-size: 11px;
  --bs-btn-font-weight: 600;
  --bs-btn-line-height: 13px;
  --bs-btn-border-radius: var(--bs-border-radius-pill);
}
.sw-soc-preview {
  gap: 10px;
}
.sw-soc-preview__label {
  gap: 3px;
}
.sw-soc-preview__title {
  font-size: 13px;
  line-height: 16px;
}
.sw-soc-preview__sub {
  font-size: 12px;
  line-height: 15px;
  color: #6b7280;
}
.sw-soc-post {
  gap: 12px;
  padding: 15px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}
.sw-soc-post__author {
  gap: 10px;
}
.sw-soc-post__avatar {
  width: 32px;
  height: 32px;
  background: var(--sw-violet-500);
}
.sw-soc-post__stack {
  gap: 2px;
}
.sw-soc-post__name {
  font-size: 13px;
  line-height: 16px;
}
.sw-soc-post__meta {
  font-size: 11px;
  line-height: 13px;
  color: #6b7280;
}
.sw-soc-post__text {
  font-size: 13px;
  line-height: 20px;
  color: #373a46;
}
.sw-soc-post__cta {
  gap: 10px;
  padding: 10px 12px;
  background: #f3f4f6;
}
.sw-soc-post__scan-title {
  font-size: 12px;
  line-height: 15px;
}
.sw-soc-post__url {
  font-size: 11px;
  line-height: 13px;
  color: var(--sw-violet-500);
}

@media (max-width: 575.98px) {
  .sw-soc__intro {
    gap: 4px;
  }
  .sw-soc__cadence {
    color: #9ca3af;
  }
  .sw-soc__count {
    --bs-badge-padding-x: 8px;
  }
  .sw-soc__row {
    gap: 12px;
    padding: 12px 14px;
  }
  .sw-soc__row--tall {
    height: 64px;
  }
  .sw-soc__status {
    gap: 6px;
  }
  .sw-soc__pill {
    --bs-badge-padding-x: 0px;
    padding-left: 0;
  }
  .sw-soc__disconnect {
    --bs-btn-padding-y: 5px;
    --bs-btn-padding-x: 9px;
    --bs-btn-font-size: 11.5px;
    --bs-btn-line-height: 14px;
    --bs-btn-bg: #fff;
    --bs-btn-border-width: 1px;
    --bs-btn-border-color: #e7c3c3;
    --bs-btn-hover-bg: #fff;
    --bs-btn-hover-border-color: #e7c3c3;
    --bs-btn-active-bg: #fff;
    --bs-btn-active-border-color: #e7c3c3;
  }
}

/* =========================
   Edit profile modal — opened by the banner "Edit profile" button.
   Style adapted from figma 2588:15568 (content is merchant-specific:
   it mirrors this page's detail fields + content niches). Email is
   read-only; every other field is editable. Bootstrap modal shell.
========================= */
.sw-edit-modal .modal-dialog {
  max-width: 720px;
}
.sw-edit-modal__content {
  border-radius: 18px;
  overflow: hidden;
  max-height: calc(100vh - 3.5rem);
}
.sw-edit-modal__head {
  padding: 24px 24px 16px;
}
.sw-edit-modal__subtitle {
  font-size: 13px;
  color: var(--sw-text-muted);
}
.sw-edit-modal__close {
  --bs-btn-padding-y: 1px;
  --bs-btn-padding-x: 6px;
  --bs-btn-color: #6b7280;
  --bs-btn-bg: #f3f4f6;
  --bs-btn-border-width: 0px;
  --bs-btn-border-radius: var(--bs-border-radius-pill);
  --bs-btn-hover-color: #0f1020;
  --bs-btn-hover-bg: #e7e8ec;
  --bs-btn-active-color: #0f1020;
  --bs-btn-active-bg: #e7e8ec;
  width: 32px;
  height: 32px;
}
.sw-edit-modal__close svg { width: 16px; height: 16px; }

.sw-edit-modal__body {
  padding: 4px 24px 8px;
}

/* avatar row */
.sw-ef-avatar {
  margin-bottom: 22px;
}
.sw-ef-avatar__pic {
  width: 64px;
  height: 64px;
  background: var(--sw-violet);
}
.sw-ef-avatar__pic svg { width: 30px; height: 30px; }
.sw-ef-avatar__hint { font-size: 12px; color: var(--sw-text-faint); }
.sw-ef-btn {
  --bs-btn-padding-y: 8px;
  --bs-btn-padding-x: 14px;
  --bs-btn-font-size: 13px;
  --bs-btn-font-weight: 600;
  --bs-btn-color: #0f1020;
  --bs-btn-bg: #fff;
  --bs-btn-border-color: var(--sw-border);
  --bs-btn-border-radius: 9px;
  --bs-btn-hover-color: #0f1020;
  --bs-btn-hover-bg: #f7f7fa;
  --bs-btn-hover-border-color: var(--sw-border);
  --bs-btn-active-color: #0f1020;
  --bs-btn-active-bg: #f7f7fa;
  --bs-btn-active-border-color: var(--sw-border);
}
.sw-ef-btn--primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--sw-violet);
  --bs-btn-border-color: var(--sw-violet);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--sw-violet);
  --bs-btn-hover-border-color: var(--sw-violet);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--sw-violet);
  --bs-btn-active-border-color: var(--sw-violet);
}
.sw-ef-btn--primary:hover { filter: brightness(0.96); }

/* form grid */
.sw-ef-grid {
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.sw-ef-field { gap: 6px; }
.sw-ef-field--full { grid-column: 1 / -1; }
.sw-ef-label {
  font-size: 11px;
  letter-spacing: 0.4px;
  color: var(--sw-text-muted);
  gap: 6px;
}
.sw-ef-label svg { width: 12px; height: 12px; }
.sw-ef-input {
  font-size: 14px;
  color: #0f1020;
  background: #fff;
  border: 1px solid var(--sw-border);
  border-radius: 10px;
  padding: 11px 14px;
  font-family: inherit;
  appearance: auto;
}
.sw-ef-input:focus {
  color: #0f1020;
  outline: none;
  border-color: var(--sw-violet);
  box-shadow: 0 0 0 3px rgba(109, 94, 247, 0.15);
}
textarea.sw-ef-input { resize: vertical; min-height: 84px; line-height: 1.5; }
/* read-only (email + structural) fields */
.sw-ef-input[readonly] {
  background: #f3f4f6;
  color: #6b7280;
  cursor: not-allowed;
}
.sw-ef-input[readonly]:focus { border-color: var(--sw-border); box-shadow: none; }
.sw-ef-note { font-size: 11.5px; color: var(--sw-text-faint); margin-top: 2px; }

/* niches section inside modal */
.sw-ef-sep { border: 0; border-top: 1px solid var(--sw-border); margin: 22px 0; }
.sw-ef-section__sub { font-size: 13px; color: var(--sw-text-muted); margin: 4px 0 14px; }

/* footer */
.sw-edit-modal__foot {
  gap: 10px;
  padding: 16px 24px 22px;
  border-top: 1px solid var(--sw-border);
}

/* =========================
   Mobile: the Edit-profile modal becomes a bottom sheet — figma 2588:15712.
   Pinned flush to the bottom, rounded top, drag handle, scrollable form,
   sticky Cancel/Save footer. Slides up on open; swipe-down to dismiss (JS).
========================= */
@media (max-width: 575.98px) {
  .sw-ef-grid { grid-template-columns: 1fr; }
  .sw-edit-modal__head,
  .sw-edit-modal__body,
  .sw-edit-modal__foot { padding-left: 18px; padding-right: 18px; }
  .sw-edit-modal__foot .sw-ef-btn { flex: 1; }

  /* pin the dialog to the bottom edge, full width */
  .sw-edit-modal .modal-dialog {
    margin: 0;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    min-height: 0;
  }
  .sw-edit-modal__content {
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
  }
  /* drag handle */
  .sw-edit-modal__head { padding-top: 22px; }
  .sw-edit-modal__content::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 38px;
    height: 4px;
    border-radius: 999px;
    background: #d6d8de;
    z-index: 2;
  }
  /* slide up on open */
  .sw-edit-modal.fade .modal-dialog {
    transform: translateY(100%);
    transition: transform 0.28s ease;
  }
  .sw-edit-modal.show .modal-dialog {
    transform: none;
  }
}
