/* StockDivar V74 — Front-end Architecture Cleanup & UX Foundation */
html[data-ui-version="74"] {
  --v74-brand: #a71928;
  --v74-brand-strong: #7f101c;
  --v74-brand-soft: #fff2f3;
  --v74-ink: #161b26;
  --v74-muted: #667085;
  --v74-line: #e4e7ec;
  --v74-surface: #ffffff;
  --v74-soft: #f7f8fa;
  --v74-success: #087a55;
  --v74-warning: #a15c00;
  --v74-radius: 18px;
  --v74-shadow: 0 10px 30px rgba(16, 24, 40, .07);
}
html[data-ui-version="74"][data-theme="dark"] {
  --v74-ink: #f4f6fb;
  --v74-muted: #aeb7c8;
  --v74-line: #2c384b;
  --v74-surface: #111827;
  --v74-soft: #182235;
  --v74-brand-soft: #2a1820;
  --v74-shadow: 0 14px 38px rgba(0,0,0,.25);
}
html[data-ui-version="74"] body { min-width: 0; }
html[data-ui-version="74"] :where(button, a, input, select, textarea, summary):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--v74-brand) 48%, transparent);
  outline-offset: 3px;
}
html[data-ui-version="74"] :where(button, a, input, select, textarea) { touch-action: manipulation; }
html[data-ui-version="74"] :where(input, select, textarea) { min-height: 44px; }
html[data-ui-version="74"] .site-header { border-bottom-color: var(--v74-line); }
html[data-ui-version="74"] .site-header .header-inner { min-height: 70px; gap: 14px; }
html[data-ui-version="74"] .site-header .header-search { flex: 1 1 360px; max-width: 680px; }
html[data-ui-version="74"] .site-header .header-actions { gap: 8px; }
html[data-ui-version="74"] .site-header .theme-toggle { flex: 0 0 auto; }
html[data-ui-version="74"] .site-footer { border-top: 1px solid var(--v74-line); }
html[data-ui-version="74"] .site-footer .owner-line { color: var(--v74-ink); padding-block: 16px; }
html[data-ui-version="74"] .site-footer .owner-line strong { font-size: 13px; font-weight: 850; }

/* Shared system states */
.v74-network-banner {
  position: fixed; z-index: 3000; inset: auto 50% 20px auto; transform: translateX(50%) translateY(18px);
  display: flex; align-items: center; gap: 9px; max-width: min(92vw, 540px); padding: 11px 15px;
  border: 1px solid #f0c36b; border-radius: 13px; background: #fff7df; color: #704a00;
  box-shadow: 0 14px 35px rgba(16,24,40,.18); opacity: 0; pointer-events: none; transition: .22s ease;
  font-size: 13px; font-weight: 800;
}
.v74-network-banner.is-visible { opacity: 1; transform: translateX(50%) translateY(0); }
.v74-system-state { grid-column: 1/-1; min-height: 260px; display: grid; place-items: center; padding: 30px; border: 1px dashed var(--v74-line); border-radius: 20px; background: var(--v74-surface); text-align: center; color: var(--v74-muted); }
.v74-system-state__inner { max-width: 390px; }
.v74-system-state__icon { display: grid; place-items: center; width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 20px; background: var(--v74-brand-soft); color: var(--v74-brand); font-size: 28px; }
.v74-system-state h2 { margin: 0 0 7px; color: var(--v74-ink); font-size: 19px; }
.v74-system-state p { margin: 0 0 16px; line-height: 1.8; }
.v74-system-state button, .v74-system-state a { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 0 16px; border: 0; border-radius: 12px; background: var(--v74-brand); color: #fff; font: inherit; font-weight: 900; text-decoration: none; cursor: pointer; }
.v74-skeleton-card { overflow: hidden; min-height: 330px; border: 1px solid var(--v74-line); border-radius: var(--v74-radius); background: var(--v74-surface); }
.v74-skeleton-card::before { content: ""; display: block; aspect-ratio: 4/3; background: linear-gradient(100deg, var(--v74-soft) 25%, color-mix(in srgb,var(--v74-line) 64%,var(--v74-soft)) 42%, var(--v74-soft) 60%); background-size: 240% 100%; animation: v74Shimmer 1.25s infinite linear; }
.v74-skeleton-card::after { content: ""; display: block; height: 88px; margin: 16px; border-radius: 12px; background: linear-gradient(100deg, var(--v74-soft) 25%, color-mix(in srgb,var(--v74-line) 64%,var(--v74-soft)) 42%, var(--v74-soft) 60%); background-size: 240% 100%; animation: v74Shimmer 1.25s infinite linear; }
@keyframes v74Shimmer { to { background-position: -140% 0; } }
@media (prefers-reduced-motion: reduce) { .v74-skeleton-card::before, .v74-skeleton-card::after { animation: none; } }

/* Stable, server-renderable home hero (no JS layout injection) */
html[data-ui-version="74"] .v74-home-hero { margin-top: 22px; }
html[data-ui-version="74"] .v74-home-hero .v73-market-hero__card {
  grid-template-columns: minmax(0,1.32fr) minmax(330px,.68fr); padding: clamp(22px,3.4vw,42px);
  border-radius: 28px; box-shadow: var(--v74-shadow);
}
html[data-ui-version="74"] .v74-home-hero h1 { max-width: 780px; margin-bottom: 12px; font-size: clamp(30px,4vw,52px); line-height: 1.23; letter-spacing: -.5px; }
html[data-ui-version="74"] .v74-home-hero p { max-width: 690px; margin: 0 0 18px; font-size: 15px; line-height: 1.9; }
html[data-ui-version="74"] .v74-home-hero .v73-market-hero__search { max-width: 710px; }
html[data-ui-version="74"] .v74-home-hero .v73-market-hero__side { align-self: stretch; }
html[data-ui-version="74"] .v74-home-hero .v73-vertical-card { min-height: 136px; }
html[data-ui-version="74"] .v74-value-strip { margin-top: 12px; margin-bottom: 4px; }
html[data-ui-version="74"] .v74-value-strip .v73-value-card { min-height: 90px; }

/* Home listings: image-first, clearer hierarchy, two-column mobile */
html[data-ui-version="74"] #latestProducts.content-layout { grid-template-columns: 224px minmax(0,1fr); gap: 18px; }
html[data-ui-version="74"] #latestProducts .home-filter { top: 88px; border: 1px solid var(--v74-line); border-radius: 18px; background: var(--v74-surface); box-shadow: none; }
html[data-ui-version="74"] #latestProducts .home-filter h2 { color: var(--v74-ink); font-size: 17px; }
html[data-ui-version="74"] #latestProducts .home-filter :is(button,.filter-link) { min-height: 42px; font-size: 13px; }
html[data-ui-version="74"] #latestProducts .section-head { margin-bottom: 14px; }
html[data-ui-version="74"] #latestProducts .section-head h1 { color: var(--v74-ink); font-size: clamp(22px,2.3vw,31px); }
html[data-ui-version="74"] #productGrid.product-grid { grid-template-columns: repeat(3,minmax(0,1fr)) !important; gap: 14px; }
html[data-ui-version="74"] #productGrid .product-card {
  position: relative; display: block; min-width: 0; min-height: 0; overflow: hidden;
  border: 1px solid var(--v74-line); border-radius: var(--v74-radius); background: var(--v74-surface); box-shadow: 0 3px 16px rgba(16,24,40,.045);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
html[data-ui-version="74"] #productGrid .product-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb,var(--v74-brand) 28%,var(--v74-line)); box-shadow: var(--v74-shadow); }
html[data-ui-version="74"] #productGrid .product-link { display: block; height: 100%; color: inherit; text-decoration: none; }
html[data-ui-version="74"] #productGrid .product-thumb { position: relative; width: 100%; aspect-ratio: 4/3; overflow: hidden; border: 0; background: var(--v74-soft); }
html[data-ui-version="74"] #productGrid .product-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
html[data-ui-version="74"] #productGrid .product-card:hover .product-thumb img { transform: scale(1.035); }
html[data-ui-version="74"] #productGrid .listing-badges { position: absolute; z-index: 2; inset: 10px 10px auto 10px; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
html[data-ui-version="74"] #productGrid .listing-badge { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 8px; border: 1px solid rgba(255,255,255,.65); border-radius: 999px; background: rgba(255,255,255,.9); color: #6f1019; backdrop-filter: blur(8px); font-size: 10px; font-weight: 900; }
html[data-ui-version="74"] #productGrid .listing-badge--urgent { background: rgba(167,25,40,.92); color: #fff; border-color: transparent; }
html[data-ui-version="74"] #productGrid .media-indicator { inset: auto auto 9px 9px; }
html[data-ui-version="74"] #productGrid .product-save-btn { z-index: 5; top: 10px; left: 10px; width: 38px; height: 38px; border-color: rgba(255,255,255,.72); background: rgba(255,255,255,.92); color: #374151; backdrop-filter: blur(8px); }
html[data-ui-version="74"] #productGrid .product-body { min-height: 170px; padding: 13px 14px 14px; gap: 8px; align-content: start; }
html[data-ui-version="74"] #productGrid .listing-trust-line { display: flex; align-items: center; min-height: 20px; gap: 7px; overflow: hidden; color: var(--v74-success); font-size: 10.5px; font-weight: 850; }
html[data-ui-version="74"] #productGrid .listing-trust-line span { white-space: nowrap; }
html[data-ui-version="74"] #productGrid .listing-trust-line span + span::before { content: "•"; margin-left: 7px; color: var(--v74-line); }
html[data-ui-version="74"] #productGrid .product-body h3 { min-height: 46px; margin: 0; overflow: hidden; color: var(--v74-ink); font-size: 15px; line-height: 1.55; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
html[data-ui-version="74"] #productGrid .product-meta-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--v74-muted); font-size: 11.5px; }
html[data-ui-version="74"] #productGrid .product-meta-line span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[data-ui-version="74"] #productGrid .product-meta-line span:last-child { flex: 0 0 auto; }
html[data-ui-version="74"] #productGrid .product-price-row { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--v74-line); }
html[data-ui-version="74"] #productGrid .price { color: var(--v74-ink); font-size: 14px; }
html[data-ui-version="74"] #productGrid .condition-chip { flex: 0 0 auto; padding: 4px 7px; border-radius: 999px; background: var(--v74-soft); color: var(--v74-muted); font-size: 10px; font-weight: 800; }

/* Filter chips and accessibility normalization */
html[data-ui-version="74"] .filter-count-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-inline-start: 5px; padding: 0 6px; border-radius: 999px; background: var(--v74-brand); color: #fff; font-size: 10px; font-weight: 900; }
html[data-ui-version="74"] [aria-invalid="true"] { border-color: #d92d20; box-shadow: 0 0 0 3px rgba(217,45,32,.11); }
html[data-ui-version="74"] .sr-only-v74 { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 1100px) {
  html[data-ui-version="74"] #productGrid.product-grid { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
  html[data-ui-version="74"] .v74-home-hero .v73-market-hero__card { grid-template-columns: 1fr; }
  html[data-ui-version="74"] .v74-home-hero .v73-market-hero__side { grid-template-columns: repeat(4,minmax(170px,1fr)); overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 4px; }
  html[data-ui-version="74"] .v74-home-hero .v73-vertical-card { scroll-snap-align: start; }
}
@media (max-width: 760px) {
  html[data-ui-version="74"] .site-header .header-inner { min-height: 62px; gap: 7px; }
  html[data-ui-version="74"] .site-header .header-actions .theme-toggle { display: none; }
  html[data-ui-version="74"] .v74-home-hero { margin-top: 10px; }
  html[data-ui-version="74"] .v74-home-hero .v73-market-hero__card { padding: 17px; border-radius: 22px; gap: 14px; }
  html[data-ui-version="74"] .v74-home-hero h1 { font-size: 26px; line-height: 1.35; }
  html[data-ui-version="74"] .v74-home-hero p { margin-bottom: 12px; font-size: 13px; line-height: 1.75; }
  html[data-ui-version="74"] .v74-home-hero .v73-market-hero__search { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
  html[data-ui-version="74"] .v74-home-hero .v73-market-hero__search input { min-width: 0; }
  html[data-ui-version="74"] .v74-home-hero .v73-market-hero__search button { width: auto; min-width: 88px; padding-inline: 12px; }
  html[data-ui-version="74"] .v74-home-hero .v73-trust-pills { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 7px; margin-top: 12px; padding-bottom: 3px; scrollbar-width: none; }
  html[data-ui-version="74"] .v74-home-hero .v73-trust-pill { flex: 0 0 auto; white-space: nowrap; font-size: 10px; }
  html[data-ui-version="74"] .v74-home-hero .v73-market-hero__side { grid-template-columns: repeat(4,145px); gap: 8px; margin-inline: -17px; padding-inline: 17px; }
  html[data-ui-version="74"] .v74-home-hero .v73-vertical-card { min-height: 92px; padding: 11px; border-radius: 14px; }
  html[data-ui-version="74"] .v74-home-hero .v73-vertical-card > span { font-size: 24px; }
  html[data-ui-version="74"] .v74-home-hero .v73-vertical-card strong { font-size: 12px; }
  html[data-ui-version="74"] .v74-home-hero .v73-vertical-card small { display: none; }
  html[data-ui-version="74"] .v74-value-strip { display: flex; overflow-x: auto; scroll-snap-type: x proximity; gap: 8px; padding-bottom: 5px; scrollbar-width: none; }
  html[data-ui-version="74"] .v74-value-strip .v73-value-card { flex: 0 0 78%; min-height: 72px; padding: 12px; scroll-snap-align: start; }
  html[data-ui-version="74"] #latestProducts.content-layout { display: block; padding-top: 17px; }
  html[data-ui-version="74"] #latestProducts .home-filter { position: static; display: flex; gap: 7px; overflow-x: auto; margin-bottom: 13px; padding: 8px; border-radius: 15px; scrollbar-width: none; }
  html[data-ui-version="74"] #latestProducts .home-filter h2 { display: none; }
  html[data-ui-version="74"] #latestProducts .home-filter :is(button,.filter-link) { flex: 0 0 auto; min-height: 38px; padding: 7px 11px; border-radius: 999px; white-space: nowrap; font-size: 11.5px; }
  html[data-ui-version="74"] #latestProducts .section-head { align-items: end; }
  html[data-ui-version="74"] #latestProducts .section-head h1 { font-size: 20px; }
  html[data-ui-version="74"] #latestProducts .section-head .eyebrow { font-size: 10px; }
  html[data-ui-version="74"] #latestProducts .section-head .text-link { font-size: 11px; }
  html[data-ui-version="74"] #productGrid.product-grid { grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 9px; }
  html[data-ui-version="74"] #productGrid .product-card { border-radius: 14px; }
  html[data-ui-version="74"] #productGrid .listing-badges { inset: 7px 7px auto 7px; }
  html[data-ui-version="74"] #productGrid .listing-badge { min-height: 22px; padding: 2px 6px; font-size: 8px; }
  html[data-ui-version="74"] #productGrid .product-save-btn { top: 7px; left: 7px; width: 32px; height: 32px; }
  html[data-ui-version="74"] #productGrid .product-body { min-height: 145px; padding: 10px; gap: 6px; }
  html[data-ui-version="74"] #productGrid .listing-trust-line { font-size: 8.5px; }
  html[data-ui-version="74"] #productGrid .listing-trust-line span:nth-child(2) { display: none; }
  html[data-ui-version="74"] #productGrid .product-body h3 { min-height: 40px; font-size: 12.5px; line-height: 1.55; }
  html[data-ui-version="74"] #productGrid .product-meta-line { display: grid; gap: 2px; font-size: 9.5px; }
  html[data-ui-version="74"] #productGrid .product-meta-line span:last-child { display: none; }
  html[data-ui-version="74"] #productGrid .product-price-row { padding-top: 6px; }
  html[data-ui-version="74"] #productGrid .price { font-size: 11.5px; }
  html[data-ui-version="74"] #productGrid .condition-chip { display: none; }
  .v74-network-banner { bottom: 78px; }
}

@media (max-width: 760px) {
  html[data-ui-version="74"] body[data-page="home"] .site-header .header-search { display: none !important; }
  html[data-ui-version="74"] body[data-page="home"] .site-header .header-inner { min-height: 58px; height: 58px; }
  html[data-ui-version="74"] .v74-home-hero .v73-market-hero__card { padding: 13px 14px 14px; gap: 10px; }
  html[data-ui-version="74"] .v74-home-hero .v73-market-hero__eyebrow { margin-bottom: 5px; font-size: 10px; }
  html[data-ui-version="74"] .v74-home-hero h1 { margin: 0 0 9px; font-size: 21px; line-height: 1.42; letter-spacing: 0; }
  html[data-ui-version="74"] .v74-home-hero p { display: none; }
  html[data-ui-version="74"] .v74-home-hero .v73-market-hero__search { display: flex; flex-direction: row; gap: 6px; }
  html[data-ui-version="74"] .v74-home-hero .v73-market-hero__search input { flex: 1 1 auto; width: 1%; min-width: 0; min-height: 42px; padding-inline: 11px; font-size: 11px; box-sizing: border-box; }
  html[data-ui-version="74"] .v74-home-hero .v73-market-hero__search button { flex: 0 0 82px; width: 82px; min-width: 82px; min-height: 42px; padding-inline: 7px; font-size: 10.5px; }
  html[data-ui-version="74"] .v74-home-hero .v73-trust-pills { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; margin-top: 9px; overflow: visible; }
  html[data-ui-version="74"] .v74-home-hero .v73-trust-pill { min-width: 0; min-height: 27px; justify-content: center; padding: 4px 6px; overflow: hidden; font-size: 8.5px; text-overflow: ellipsis; }
  html[data-ui-version="74"] .v74-home-hero .v73-market-hero__side { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; margin: 0; padding: 0; overflow: visible; }
  html[data-ui-version="74"] .v74-home-hero .v73-vertical-card { min-width: 0; min-height: 58px; padding: 6px 3px; border-radius: 12px; gap: 2px; text-align: center; }
  html[data-ui-version="74"] .v74-home-hero .v73-vertical-card > span { font-size: 19px; }
  html[data-ui-version="74"] .v74-home-hero .v73-vertical-card strong { max-width: 100%; overflow: hidden; font-size: 8.5px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
  html[data-ui-version="74"] .v74-value-strip { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; margin-top: 7px; margin-bottom: 0; overflow: visible; padding-bottom: 0; }
  html[data-ui-version="74"] .v74-value-strip .v73-value-card { display: grid; place-items: center; align-content: center; min-width: 0; min-height: 56px; padding: 6px 2px; text-align: center; gap: 2px; }
  html[data-ui-version="74"] .v74-value-strip .v73-value-card > span { font-size: 17px; }
  html[data-ui-version="74"] .v74-value-strip .v73-value-card strong { display: block; max-width: 100%; overflow: hidden; font-size: 8px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
  html[data-ui-version="74"] .v74-value-strip .v73-value-card small { display: none; }
  html[data-ui-version="74"] #latestProducts.content-layout { padding-top: 11px; }
  html[data-ui-version="74"] #latestProducts .home-filter { margin-bottom: 8px; }
  html[data-ui-version="74"] #latestProducts .section-head { margin-bottom: 8px; }
}

@media (max-width: 370px) {
  html[data-ui-version="74"] .v74-home-hero .v73-market-hero__search { grid-template-columns: 1fr; }
  html[data-ui-version="74"] .v74-home-hero .v73-market-hero__search button { width: 100%; }
  html[data-ui-version="74"] #productGrid .product-body h3 { font-size: 12px; }
}

/* V74 — seller review and trust completion */
.seller-reviews-title{align-items:flex-start;gap:12px}.seller-reviews-title>div{flex:1}.seller-reviews-title p{margin:5px 0 0;color:var(--color-text-muted,#697386);font-size:13px;line-height:1.8}.review-add-btn{white-space:nowrap}.seller-service-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:18px 0}.seller-service-metrics>div{padding:14px 10px;border:1px solid var(--color-border,#dde2ea);border-radius:16px;background:var(--color-soft,#f6f7f9);text-align:center}.seller-service-metrics strong{display:block;color:var(--color-text,#1b2430);font-size:18px}.seller-service-metrics span{display:block;margin-top:4px;color:var(--color-text-muted,#697386);font-size:11px}.rating-overview small{display:block;margin-top:6px;color:var(--color-text-muted,#697386)}#reviewModal select,#reviewModal textarea{width:100%;margin:7px 0 14px}.seller-reviews-card .rating-bar{grid-template-columns:58px 1fr 32px}
@media (max-width:700px){.seller-reviews-title{display:grid;grid-template-columns:auto 1fr}.seller-reviews-title .review-add-btn{grid-column:1/-1;width:100%}.seller-service-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.reviews-summary{grid-template-columns:1fr}.rating-overview{padding:15px}.rating-overview strong{font-size:34px}}
