/*
 * Home page sections (categories, suppliers, how it works, reviews),
 * categories in the product form, the buyer account area, payments
 * history and messaging extras. Uses the tokens from site.css.
 */

/* ============ SHARED ============ */
.pill-blue { background: #e8f1ff; color: #1c4fae; text-decoration: none; }
.menu-count {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 999px;
  background: #eef1f6;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.dash-menu a[aria-current="page"] .menu-count { background: #d6e6ff; color: var(--blue); }
.menu .menu-count { float: right; }
.menu .menu-all { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 11px 11px; color: var(--blue); }

.section-eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.section-lead { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.section-head h2,
.reviews-head h2,
.catalog-head h2 { margin: 0; color: var(--ink); font-size: clamp(22px, 2.2vw, 30px); font-weight: 800; letter-spacing: -.01em; }
.section-head .text-link { display: inline-flex; align-items: center; gap: 4px; }
.section-head-center { justify-content: center; text-align: center; }

.tip-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding: 14px 18px;
  border: 1px solid #cfe1ff;
  border-radius: 12px;
  background: linear-gradient(120deg, #eef5ff, #f7fbff);
  color: var(--navy);
  font-size: 14px;
  line-height: 1.5;
}
.tip-banner > .icon { flex: 0 0 auto; width: 22px; height: 22px; color: var(--blue); }
.tip-banner .text-link { margin-left: auto; white-space: nowrap; }

/* ============ HOME: CATEGORIES ============ */
.home-section { width: 100%; justify-self: stretch; padding: 56px 20px; background: #fff; }
.home-categories { padding-top: 48px; padding-bottom: 8px; }
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.category-tile {
  display: grid;
  gap: 4px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.category-tile:hover,
.category-tile.is-active { border-color: #b9d2ff; box-shadow: 0 14px 30px rgba(6, 25, 76, .10); transform: translateY(-2px); }
.category-tile strong { font-size: 15px; }
.category-tile > span:last-child { color: var(--muted); font-size: 13px; }
.category-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: #e8f1ff;
  color: var(--blue);
}
.category-icon .icon { width: 24px; height: 24px; }
.cat-industrial { background: #eaf0ff; color: #3451d1; }
.cat-tech { background: #e3f8ff; color: #0089b8; }
.cat-construction { background: #fff1e0; color: #c26a00; }
.cat-consumer { background: #fdeef6; color: #c0307a; }
.cat-services { background: #efeaff; color: #6b46d6; }
.cat-food { background: #e6f7ed; color: #1a7f45; }
.cat-health { background: #ffecec; color: #d23a3a; }

/* ============ HOME: CATALOG FILTERS ============ */
.catalog-head { align-items: flex-end; }
.sort-form { display: flex; align-items: center; gap: 10px; margin: 0; }
.sort-form label { color: var(--muted); font-size: 14px; font-weight: 600; }
.sort-form select {
  padding: 9px 36px 9px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7489' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  appearance: none;
  cursor: pointer;
}
.chip-row {
  display: flex;
  gap: 8px;
  margin: -6px 0 24px;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #3b4357;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.chip span { padding: 0 7px; border-radius: 999px; background: #eef1f6; color: var(--muted); font-size: 12px; }
.chip:hover { border-color: var(--navy); color: var(--ink); }
.chip.is-active { border-color: var(--navy); background: var(--navy); color: #fff; }
.chip.is-active span { background: rgba(255, 255, 255, .2); color: #fff; }
.empty-rich { display: grid; justify-items: center; gap: 10px; }

.product-media { position: relative; }
.product-cat {
  position: absolute;
  z-index: 1;
  left: 12px;
  bottom: 12px;
  max-width: calc(100% - 24px);
  overflow: hidden;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(6, 25, 76, .72);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
  backdrop-filter: blur(6px);
}

/* ============ HOME: STATS ============ */
.home-stats { width: 100%; justify-self: stretch; padding: 34px 20px; background: linear-gradient(120deg, var(--navy-deep), var(--navy) 55%, #0b4fd6); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.stat-item { display: flex; align-items: center; gap: 14px; color: #c9d5ef; }
.stat-item strong { display: block; color: #fff; font-size: 28px; font-weight: 800; line-height: 1.1; }
.stat-item span { font-size: 14px; }
.stat-icon { display: grid; place-items: center; flex: 0 0 50px; width: 50px; height: 50px; border-radius: 14px; background: rgba(255, 255, 255, .1); color: var(--cyan); }
.stat-icon .icon { width: 24px; height: 24px; }

/* ============ HOME: SUPPLIERS ============ */
.supplier-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.supplier-card {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 24px 16px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #f6f9ff, #fff 45%);
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  transition: box-shadow .2s ease, transform .2s ease;
}
.supplier-card:hover { box-shadow: 0 14px 30px rgba(6, 25, 76, .10); transform: translateY(-2px); }
.supplier-logo { width: 64px; height: 64px; margin-bottom: 6px; border: 3px solid #fff; border-radius: 50%; object-fit: cover; font-size: 24px; box-shadow: 0 4px 14px rgba(6, 25, 76, .12); }
.supplier-card strong { font-size: 15px; }
.supplier-loc { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; }
.supplier-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }

/* ============ HOME: HOW IT WORKS ============ */
.home-how { background: #f4f7fb; }
.how-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin: 0; padding: 0; list-style: none; counter-reset: none; }
.how-item {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 26px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.how-item strong { color: var(--ink); font-size: 16px; }
.how-item p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.how-num { position: absolute; top: 18px; right: 20px; color: #dbe3ef; font-size: 34px; font-weight: 800; line-height: 1; }
.how-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 6px; border-radius: 16px; background: linear-gradient(135deg, var(--blue), var(--cyan)); color: #fff; box-shadow: 0 8px 20px rgba(0, 119, 255, .25); }
.how-icon .icon { width: 24px; height: 24px; }
.how-cta { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 30px; }

/* ============ HOME: REVIEWS ============ */
.reviews-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.rating-summary { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.rating-summary > strong { color: var(--ink); font-size: 40px; font-weight: 800; line-height: 1; }
.rating-summary > div { display: grid; gap: 4px; }
.stars { display: inline-flex; gap: 2px; color: var(--star); }
.stars .icon { width: 18px; height: 18px; fill: currentColor; }
.stars-sm .icon { width: 15px; height: 15px; }
.stars .star-off { color: #d9dee8; }
.review-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.review-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 10px;
  margin: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  transition: box-shadow .2s ease;
}
.review-card:hover { box-shadow: 0 16px 34px rgba(6, 25, 76, .10); }
.review-quote { position: absolute; top: 18px; right: 20px; color: #dbe7ff; }
.review-quote .icon { width: 34px; height: 34px; stroke-width: 2.4; }
.review-card h3 { margin: 4px 0 0; color: var(--ink); font-size: 16px; }
.review-card blockquote { flex: 1; margin: 0; color: #3b4357; font-size: 14px; line-height: 1.65; }
.review-card figcaption { display: flex; align-items: center; gap: 12px; margin-top: 8px; padding-top: 14px; border-top: 1px solid #edf0f5; }
.review-card figcaption > span:last-child { display: grid; gap: 1px; }
.review-card figcaption strong { color: var(--ink); font-size: 14px; }
.review-card figcaption span span { color: var(--muted); font-size: 12px; }
.review-avatar { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; font-weight: 800; }

/* ============ HOME: SELLER CTA ============ */
.home-cta { width: 100%; justify-self: stretch; padding: 0 20px 64px; background: #fff; }
.home-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 36px 40px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 90% 10%, rgba(18, 207, 255, .4), transparent 45%),
    linear-gradient(120deg, var(--navy-deep), var(--navy) 50%, #0b4fd6);
  color: #c9d5ef;
}
.home-cta-inner h2 { margin: 0 0 6px; color: #fff; font-size: clamp(22px, 2.2vw, 28px); }
.home-cta-inner p { margin: 0; font-size: 15px; }

/* ============ PRODUCT FORM: CATEGORY ============ */
.category-picker {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: 12px 16px;
  padding: 16px;
  border: 1px solid #dfe8f7;
  border-radius: 12px;
  background: #f8fbff;
}
.category-or { align-self: center; margin-top: 18px; color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; }
.seller-card-cat { margin: 0; color: var(--blue); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.seller-card-cat.is-missing { color: #b07800; text-transform: none; letter-spacing: 0; }

/* ============ BUYER ACCOUNT ============ */
.buyer-avatar { font-size: 20px; }
.sidebar-promo {
  display: grid;
  gap: 4px;
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eef5ff, #e5f9ff);
  color: var(--navy);
  font-size: 13px;
  text-decoration: none;
}
.sidebar-promo strong { font-size: 14px; }
.sidebar-promo:hover { box-shadow: inset 0 0 0 1px #b9d2ff; }

.buyer-welcome { background: radial-gradient(circle at 85% 20%, rgba(18, 207, 255, .35), transparent 45%), linear-gradient(120deg, #052a6b, #0a4bd1 60%, #0a8dff); }
.kpi-rose { background: #fdeef0; color: var(--heart); }
.kpi-amber { background: #fff4d6; color: #a06a00; }
.kpi-sub { color: var(--muted); font-size: 12px; font-weight: 600; }
.kpi-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-value-text { font-size: 22px; }
.card-flush { padding: 0; overflow: hidden; }
.product-grid-compact { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.product-grid-compact .product-price { font-size: 16px; }

.convo-mini { margin: 0; padding: 0; list-style: none; }
.convo-mini li + li { border-top: 1px solid #edf0f5; }
.convo-mini a { display: flex; align-items: center; gap: 12px; padding: 12px 4px; color: var(--ink); text-decoration: none; }
.convo-mini a:hover { background: #f7f9fc; }
.convo-mini-body { flex: 1; display: grid; gap: 2px; min-width: 0; }
.convo-mini-body strong { font-size: 14px; }
.convo-mini-body span { overflow: hidden; color: var(--muted); font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.convo-mini a.is-unread .convo-mini-body span { color: var(--ink); font-weight: 600; }
.convo-mini time { color: var(--muted); font-size: 12px; white-space: nowrap; }

.pay-mini { margin: 0; padding: 0; list-style: none; }
.pay-mini li { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.pay-mini li + li { border-top: 1px solid #edf0f5; }
.pay-mini li > div { flex: 1; display: grid; gap: 2px; min-width: 0; }
.pay-mini strong { overflow: hidden; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.pay-mini li > div span { color: var(--muted); font-size: 13px; }
.pay-mini form { margin: 0; }
.pay-mini-amount { color: var(--ink); font-weight: 800; white-space: nowrap; }

.tip-card h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 16px; }
.tip-card h2 .icon { color: #1a9b54; }
.tip-card .text-link { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; }

.do-dont { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.do-dont > div { padding: 16px 18px; border-radius: 12px; }
.do-dont h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 15px; }
.do-dont ul { margin: 0; padding-left: 18px; font-size: 14px; }
.do { border: 1px solid #b6e3c6; background: #f3fbf6; }
.do h3 { color: #146c3a; }
.dont { border: 1px solid #f3c0c2; background: #fff6f6; }
.dont h3 { color: #a2242a; }

/* ============ PAYMENTS HISTORY ============ */
.pay-list { margin: 0; padding: 0; list-style: none; }
.pay-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 16px; padding: 16px 20px; }
.pay-row + .pay-row { border-top: 1px solid #edf0f5; }
.pay-row:hover { background: #fafbfd; }
.pay-row-main { display: grid; gap: 2px; min-width: 0; }
.pay-row-main strong { overflow: hidden; color: var(--ink); font-size: 15px; white-space: nowrap; text-overflow: ellipsis; }
.pay-row-main span { color: var(--muted); font-size: 13px; }
.pay-row-amount { color: var(--ink); font-size: 17px; font-weight: 800; white-space: nowrap; }
.pay-row-amount small { color: var(--muted); font-size: 11px; font-weight: 600; }
.pay-row-actions { display: flex; gap: 8px; }
.pay-row-actions form { margin: 0; }

/* ============ MESSAGING EXTRAS ============ */
.chat-search { position: relative; padding: 10px 14px; border-bottom: 1px solid #edf0f5; }
.chat-search .icon { position: absolute; top: 50%; left: 26px; width: 16px; height: 16px; color: var(--muted); transform: translateY(-50%); }
.chat-search input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f9fc;
  font: inherit;
  font-size: 13px;
}
.chat-search input:focus { border-color: var(--blue); outline: none; background: #fff; }
.chat-row[hidden] { display: none; }

.chat-thread { position: relative; }
.chat-info-toggle { flex: 0 0 auto; }
.chat-info {
  position: absolute;
  z-index: 5;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: min(320px, 100%);
  border-left: 1px solid var(--line);
  background: #fff;
  box-shadow: -14px 0 34px rgba(6, 25, 76, .12);
  overflow-y: auto;
}
.chat-info[hidden] { display: none; }
.chat-info-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid #edf0f5; }
.chat-info-party { display: grid; justify-items: center; gap: 6px; padding: 22px 18px; border-bottom: 1px solid #edf0f5; text-align: center; }
.chat-info-party strong { color: var(--ink); font-size: 16px; }
.chat-info-party .muted-sm { display: inline-flex; align-items: center; gap: 4px; }
.chat-avatar-lg { flex-basis: 64px; width: 64px; height: 64px; font-size: 24px; }
.chat-info-block { padding: 16px 18px; border-bottom: 1px solid #edf0f5; }
.chat-info-block h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.chat-info-pays { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.chat-info-pays li { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; font-size: 13px; }
.chat-info-pays li > span:first-child { color: var(--ink); }
.chat-info-pays .pay-status { justify-self: start; }
.chat-info-safety { background: #f3fbf6; border-bottom: 0; }
.chat-info-safety h3 { color: #146c3a; }
.chat-info-safety p { margin: 0; color: #2d5c40; font-size: 13px; line-height: 1.5; }

.chat-safety { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px !important; padding: 5px 12px; border-radius: 999px; background: #e6f6ec; color: #146c3a; font-weight: 600; }

.msg-day { display: flex; align-items: center; gap: 12px; align-self: stretch; color: var(--muted); font-size: 12px; font-weight: 700; }
.msg-day::before,
.msg-day::after { content: ""; flex: 1; height: 1px; background: #e2e7f0; }
.msg-day span { padding: 3px 12px; border-radius: 999px; background: #e9eef6; }

.msg { position: relative; }
.msg:not(.is-mine) { padding-left: 40px; }
.msg-avatar {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.quick-replies {
  display: flex;
  gap: 8px;
  padding: 10px 20px 0;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  background: #fff;
  scrollbar-width: none;
}
.quick-replies button {
  flex: 0 0 auto;
  padding: 6px 12px;
  border: 1px solid #cfe1ff;
  border-radius: 999px;
  background: #f2f8ff;
  color: #1c4fae;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.quick-replies button:hover { border-color: var(--blue); background: #e5f0ff; }
.quick-replies + .chat-composer { border-top: 0; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1100px) {
  .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .how-grid,
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-grid,
  .how-grid,
  .do-dont,
  .kpi-grid-3 { grid-template-columns: 1fr; }
  .category-picker { grid-template-columns: 1fr; }
  .category-or { margin: 0; }
  .pay-row { grid-template-columns: auto minmax(0, 1fr); }
  .pay-row-amount,
  .pay-status,
  .pay-row-actions { grid-column: 2; justify-self: start; }
  .home-cta-inner { padding: 26px; }
  .tip-banner { flex-wrap: wrap; }
}

/* ============ VERIFIED REVIEWS & SUPPLIER RATING ============ */
.supplier-rating { display: inline-flex; align-items: center; gap: 5px; color: var(--ink); font-size: 13px; text-decoration: none; }
.supplier-rating strong { font-weight: 700; }
.supplier-rating > span:last-child { color: var(--muted); }
a.supplier-rating:hover strong { color: var(--blue); }
.review-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.review-verified { display: inline-flex; align-items: center; gap: 4px; color: #146c3a; font-size: 12px; font-weight: 600; }
.review-card figcaption a { color: var(--blue); font-weight: 600; text-decoration: none; }
.review-card figcaption a:hover { text-decoration: underline; }
.review-reply { margin-top: 10px; padding: 10px 12px; border-left: 3px solid var(--blue); border-radius: 0 10px 10px 0; background: #f2f7ff; font-size: 13px; }
.review-reply strong { display: block; margin-bottom: 2px; font-size: 12px; color: var(--navy); }
.review-reply p { margin: 0; color: #3b4357; line-height: 1.5; }
.empty-reviews { display: flex; align-items: center; gap: 14px; padding: 20px 22px; border: 1px dashed #cfd7e4; border-radius: 16px; background: #fafbfd; color: #3b4357; }
.empty-reviews > .icon { flex: 0 0 28px; width: 28px; height: 28px; color: var(--star); fill: currentColor; }
.empty-reviews p { margin: 0; line-height: 1.55; }

.rating-panel { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: center; margin-bottom: 18px; }
.rating-panel-score { display: grid; justify-items: center; gap: 4px; min-width: 130px; }
.rating-panel-score > strong { font-size: 40px; font-weight: 800; line-height: 1; }
.rating-bars { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.rating-bars li { display: grid; grid-template-columns: 32px minmax(0, 1fr) 32px; align-items: center; gap: 10px; font-size: 13px; }
.rating-bar { height: 8px; overflow: hidden; border-radius: 999px; background: #edf0f5; }
.rating-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--star); }

.supplier-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 24px; align-items: center; margin-bottom: 28px; padding: 26px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(120deg, #f4f8ff, #fff 60%); }
.supplier-hero-logo { width: 88px; height: 88px; border-radius: 20px; object-fit: cover; background: #fff; border: 1px solid var(--line); font-size: 34px; }
.supplier-hero-main h1 { margin: 0 0 8px; font-size: 28px; font-weight: 800; letter-spacing: -.01em; }
.supplier-hero-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; }
.supplier-hero-about { margin: 12px 0 0; max-width: 70ch; color: #3b4357; line-height: 1.6; }
.supplier-hero-stats { display: flex; gap: 10px; margin: 0; padding: 0; list-style: none; }
.supplier-hero-stats li { display: grid; justify-items: center; min-width: 96px; padding: 12px 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.supplier-hero-stats strong { font-size: 22px; font-weight: 800; }
.supplier-hero-stats span { color: var(--muted); font-size: 12px; }
.supplier-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.supplier-section { margin-bottom: 36px; }
.supplier-section h2 { margin: 0 0 16px; font-size: 22px; font-weight: 800; }
.review-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.seller-profile h3 a { color: inherit; text-decoration: none; }
.seller-profile h3 a:hover { color: var(--blue); }

.review-form { display: grid; gap: 14px; margin: 0; }
.review-form .btn-primary { justify-self: start; }
.star-input-group { margin: 0; padding: 0; border: 0; }
.star-input-group legend { margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.star-input input { position: absolute; opacity: 0; pointer-events: none; }
.star-input label { color: #d9dee8; cursor: pointer; transition: color .12s, transform .12s; }
.star-input label .icon { width: 32px; height: 32px; fill: currentColor; }
.star-input input:checked ~ label,
.star-input label:hover,
.star-input label:hover ~ label { color: var(--star); }
.star-input label:hover { transform: scale(1.08); }
.star-input input:focus-visible + label { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.review-form-card .step-num { background: linear-gradient(135deg, #e5a100, #ffc83d); }
.order-review-body { display: grid; gap: 6px; }
.order-review-body p { margin: 0; color: #3b4357; line-height: 1.55; }
.reply-form { display: grid; gap: 8px; margin: 12px 0 0; }
.reply-form textarea { width: 100%; }
.reply-form .btn-sm { justify-self: start; }
.seller-review-list { display: grid; gap: 14px; margin-top: 18px; }
.seller-review header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.seller-review > p { margin: 0 0 6px; line-height: 1.55; }
.seller-review.is-hidden { opacity: .6; }

@media (max-width: 960px) {
  .supplier-layout { grid-template-columns: 1fr; }
  .supplier-hero { grid-template-columns: auto minmax(0, 1fr); }
  .supplier-hero-stats { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .supplier-hero { grid-template-columns: 1fr; padding: 20px 16px; }
  .supplier-hero-stats li { flex: 1; min-width: 0; }
  .review-list { grid-template-columns: 1fr; }
  .rating-panel { grid-template-columns: 1fr; gap: 14px; }
}

.star-hint { margin-left: 6px; color: var(--muted); font-size: 12px; font-weight: 500; }
.star-input label { display: inline-flex; padding: 2px; }
.star-input label .icon { width: 34px; height: 34px; }
.review-form .form-field { margin: 0; }
.review-form > .btn-primary { margin-top: 6px; }

/* ============ SELLER CARD FIX ============ */
.seller-profile-title .seller-profile-badge { display: inline-flex; margin-top: 8px; }
.seller-profile-title .supplier-rating { margin-top: 4px; flex-wrap: wrap; }
.supplier-rating span { white-space: nowrap; }
.review-top { padding-right: 0; }

/* ============ SUPPLIER PROFILE (advanced) ============ */
.sp-hero { position: relative; overflow: hidden; margin-bottom: 26px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: 0 18px 40px rgba(6, 25, 76, .06); }
.sp-cover { height: 132px; background:
  radial-gradient(circle at 85% 20%, rgba(255, 255, 255, .16) 0 90px, transparent 91px),
  radial-gradient(circle at 12% 120%, rgba(0, 170, 255, .45) 0 160px, transparent 161px),
  linear-gradient(115deg, var(--navy-deep, #061a4a), var(--navy, #0a2a6e) 55%, #0b4fd6); }
.sp-hero-body { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 22px; align-items: end; margin-top: -54px; padding: 0 28px 22px; }
.sp-logo { position: relative; width: 112px; height: 112px; border: 4px solid #fff; border-radius: 24px; object-fit: cover; background: #fff; box-shadow: 0 10px 26px rgba(6, 25, 76, .16); font-size: 42px; }
.sp-identity { min-width: 0; padding-bottom: 4px; }
.sp-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.sp-identity h1 { margin: 0 0 8px; color: var(--ink); font-size: 30px; font-weight: 800; letter-spacing: -.015em; overflow-wrap: anywhere; }
.sp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; color: var(--muted); font-size: 13px; }
.sp-meta-item { display: inline-flex; align-items: center; gap: 5px; }
.sp-actions { display: flex; gap: 10px; padding-bottom: 6px; }
.sp-actions form { margin: 0; }
.sp-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; border-top: 1px solid #edf0f5; }
.sp-stats li { display: flex; align-items: center; gap: 12px; padding: 18px 20px; }
.sp-stats li + li { border-left: 1px solid #edf0f5; }
.sp-stats strong { display: block; color: var(--ink); font-size: 20px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.sp-stats strong small { color: var(--muted); font-size: 12px; font-weight: 600; }
.sp-stats span:not(.sp-stat-icon) { color: var(--muted); font-size: 12px; }
.sp-stat-icon { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 11px; }
.sp-stat-icon .icon { width: 19px; height: 19px; }
.sp-stat-icon.is-amber { background: #fff4d6; color: #b07800; }
.sp-stat-icon.is-green { background: #dff5e7; color: #1a7f45; }
.sp-stat-icon.is-blue { background: #e8f1ff; color: var(--blue); }
.sp-stat-icon.is-cyan { background: #dff6fb; color: #0e7f99; }
.sp-stat-icon.is-violet { background: #eeebff; color: #5a4bd6; }
.sp-stat-icon.is-gray { background: #eef1f6; color: #4a5468; }

.sp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.sp-main { display: grid; gap: 24px; min-width: 0; }
.sp-side { position: sticky; top: 20px; display: grid; gap: 20px; }
.sp-card { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.sp-card h2 { display: flex; align-items: center; gap: 9px; margin: 0 0 16px; color: var(--ink); font-size: 19px; font-weight: 800; }
.sp-card h2 .icon { width: 20px; height: 20px; color: var(--blue); }
.sp-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.sp-card-head h2 { margin: 0; }
.sp-about { margin: 0 0 18px; color: #3b4357; font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.sp-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; }
.sp-facts > div { padding: 12px 14px; border-radius: 12px; background: #f7f9fc; }
.sp-facts dt { color: var(--muted); font-size: 12px; }
.sp-facts dd { margin: 2px 0 0; color: var(--ink); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.sp-categories { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }
.sp-label { margin-right: 4px; color: var(--muted); font-size: 13px; font-weight: 600; }
.sp-categories small { color: var(--muted); font-weight: 600; }
.sp-products { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.sp-contact .seller-contact { margin-bottom: 14px; }
.sp-contact form { margin: 0; }
.sp-wide { width: 100%; justify-content: center; }
.sp-protect { background: linear-gradient(160deg, #f1fbf5, #fff 60%); border-color: #cdebd8; }
.sp-protect h2 .icon { color: #1a7f45; }
.sp-protect .trust-list { margin: 0; padding: 0; border: 0; }
.sp-protect .trust-list .icon { color: #1a7f45; }

/* Product page: reviews inside the main column */
.detail-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.detail-card-head h2 { margin: 0 !important; }
.detail-card .review-list { margin-top: 4px; }
.detail-card .review-card { box-shadow: none; }

@media (max-width: 1100px) {
  .sp-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sp-stats li:nth-child(4) { border-left: 0; }
  .sp-stats li:nth-child(n+4) { border-top: 1px solid #edf0f5; }
  .sp-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .sp-layout { grid-template-columns: 1fr; }
  .sp-side { position: static; }
  .sp-hero-body { grid-template-columns: auto minmax(0, 1fr); }
  .sp-actions { grid-column: 1 / -1; }
  .sp-products { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 640px) {
  .sp-cover { height: 96px; }
  .sp-hero-body { grid-template-columns: 1fr; gap: 12px; margin-top: -46px; padding: 0 16px 18px; }
  .sp-logo { width: 88px; height: 88px; }
  .sp-identity h1 { font-size: 24px; }
  .sp-actions { flex-wrap: wrap; }
  .sp-actions > * { flex: 1; }
  .sp-actions .btn-primary, .sp-actions .btn-outline { width: 100%; justify-content: center; }
  .sp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-stats li { padding: 14px; }
  .sp-stats li:nth-child(odd) { border-left: 0; }
  .sp-stats li:nth-child(4) { border-left: 1px solid #edf0f5; }
  .sp-stats li:nth-child(n+3) { border-top: 1px solid #edf0f5; }
  .sp-card { padding: 18px 16px; }
  .sp-facts { grid-template-columns: 1fr; }
  .sp-products { grid-template-columns: 1fr !important; }
}

/* Header: only the logo overlaps the cover; name and actions sit below it */
.sp-hero-body { align-items: center; margin-top: 0; padding-top: 16px; }
.sp-logo { margin-top: -70px; align-self: start; }
@media (max-width: 640px) {
  .sp-hero-body { margin-top: 0; padding-top: 0; }
  .sp-logo { margin-top: -48px; }
}

/* Long words never overflow review cards */
.review-card { min-width: 0; }
.review-card h3, .review-card blockquote, .review-reply p, .seller-review > p, .order-review-body p { overflow-wrap: anywhere; }
.review-list > * , .review-grid > * { min-width: 0; }

/* Product page: supplier performance card */
.perf-card .perf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.perf-card .perf-grid > div { padding: 12px; border-radius: 12px; background: #f7f9fc; }
.perf-card dt { color: var(--muted); font-size: 12px; }
.perf-card dd { margin: 2px 0 0; color: var(--ink); font-size: 18px; font-weight: 800; }
.perf-card dd small { color: var(--muted); font-size: 12px; font-weight: 600; }
.perf-card .btn-outline { width: 100%; justify-content: center; }
