/* ============================================================
   SpareX - Marketplace landing page
   ============================================================ */
:root {
    --mp-navy: #0A2540;
    --mp-navy-dark: #071b30;
    --mp-amber: #f0a500;
    --mp-amber-dark: #d69300;
    --mp-line: #e2e5ea;
    --mp-text: #16202b;
    --mp-muted: #6b7684;
}

.mp-body { background: #f4f6f8; color: var(--mp-text); }
/* Base sizing for every inline SVG icon (includes/icons.php) - each
   icon carries its own currentColor stroke, so it always matches the
   text color around it unless a specific rule overrides that. */
.icon { width: 18px; height: 18px; flex-shrink: 0; vertical-align: middle; }
/* style.css (the older admin/vendor dashboard theme) is still loaded
   on marketplace pages for shared components, and its "a { color:
   accent }" rule wins by default wherever a marketplace link doesn't
   have its own color set - exactly what caused the topbar email link
   to render amber instead of the intended light color. Reset the
   default here so every marketplace link starts from its surrounding
   text color, and only turns amber/navy/etc where explicitly styled. */
.mp-body a { color: inherit; }

/* ---- Top info bar ---- */
.mp-topbar { background: var(--mp-navy-dark); color: #cfd8e3; font-size: 0.78rem; padding: 6px 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; }
.mp-topbar-left { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.mp-topbar-left a { color: #cfd8e3; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.mp-topbar-left .icon, .mp-topbar-right .icon { width: 13px; height: 13px; }
.mp-topbar-wechat .icon { color: #07c160; }
.mp-topbar-whatsapp .icon { color: #25d366; }
.mp-topbar-right { display: flex; gap: 16px; align-items: center; }
.mp-topbar-right a { color: #cfd8e3; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.mp-topbar select { background: transparent; color: #cfd8e3; border: none; font-size: 0.78rem; }

/* ---- Main header: logo / search / account ---- */
.mp-header { background: var(--mp-navy); padding: 14px 20px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.mp-logo { display: flex; flex-direction: column; text-decoration: none; flex-shrink: 0; }
.mp-logo-mark { color: #fff; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.5px; }
.mp-logo-mark span { color: var(--mp-amber); }
.mp-logo-tag { color: #8fa3ba; font-size: 0.6rem; letter-spacing: 1px; }

.mp-search { flex: 1; min-width: 240px; display: flex; max-width: 720px; height: 44px; }
.mp-search select { border: none; background: #fff; border-right: 1px solid var(--mp-line); padding: 0 12px; font-size: 0.85rem; border-radius: 6px 0 0 6px; color: var(--mp-muted); max-width: 150px; }
.mp-search input { flex: 1; border: none; padding: 0 16px; font-size: 0.95rem; min-width: 0; height: 100%; }
.mp-search button { background: var(--mp-amber); border: none; padding: 0 22px; border-radius: 0 6px 6px 0; cursor: pointer; font-weight: 700; color: #16202b; font-size: 1rem; }

.mp-header-actions { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.mp-header-actions a { color: #fff; text-decoration: none; font-size: 0.82rem; display: flex; align-items: center; gap: 6px; }
.mp-header-actions .icon { width: 19px; height: 19px; }
.mp-header-actions small { display: block; color: #8fa3ba; font-size: 0.68rem; }
.mp-header-actions a.mp-rfq-cta { color: var(--mp-amber); font-weight: 700; }
.mp-header-actions a.mp-rfq-cta .icon { color: var(--mp-amber); }
.mp-cart-count { background: var(--mp-amber); color: #16202b; font-size: 0.65rem; font-weight: 800; border-radius: 50%; width: 17px; height: 17px; display: inline-flex; align-items: center; justify-content: center; margin-left: 3px; }

/* ---- Mobile header: the topbar (email/phone/WeChat/ship-to) is
   desktop contact info that doesn't need to sit above the fold on a
   phone - hidden here, not deleted, so it's still one query away from
   being brought back if wanted. The action row collapses to icons
   only (no "Sign In" / "My Orders" text) so it reads as a compact app
   toolbar instead of a squeezed desktop header, and gets extra
   bottom padding to clear the new bottom nav bar below. ---- */
@media (max-width: 640px) {
    .mp-topbar { display: none; }
    .mp-header { padding: 10px 14px; gap: 10px; }
    .mp-logo-tag { display: none; }
    .mp-logo-mark { font-size: 1.2rem; }
    .mp-search { min-width: 0; height: 40px; }
    .mp-header-actions { gap: 14px; }
    .mp-header-actions a span:not(.mp-cart-count) { display: none; }
    .mp-header-actions a { gap: 0; }
    .mp-header-actions .icon { width: 22px; height: 22px; }
    body { padding-bottom: 58px; }
}

/* ---- Bottom app bar (mobile only): the one addition that most
   makes this read as an app rather than a shrunk desktop site - a
   fixed, always-reachable bar for the handful of things people
   actually jump to constantly while shopping. ---- */
.mp-bottombar { display: none; }
@media (max-width: 640px) {
    .mp-bottombar {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
        background: #fff; border-top: 1px solid var(--mp-line);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .mp-bottombar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 6px; text-decoration: none; color: var(--mp-muted); font-size: 0.65rem; font-weight: 600; position: relative; }
    .mp-bottombar a.active { color: var(--mp-navy); }
    .mp-bottombar a .icon { width: 21px; height: 21px; }
    .mp-bottombar a .mp-cart-count { position: absolute; top: 3px; right: calc(50% - 18px); margin: 0; }
}

/* ---- Category nav bar + mega-menu trigger ---- */
.mp-navbar { background: #fff; border-bottom: 1px solid var(--mp-line); display: flex; align-items: stretch; position: relative; z-index: 30; }
.mp-allcats-btn { background: var(--mp-amber); color: #16202b; border: none; padding: 0 18px; font-weight: 700; font-size: 0.85rem; display: flex; align-items: center; gap: 10px; cursor: pointer; white-space: nowrap; }
.mp-navlinks { display: flex; overflow-x: auto; }
.mp-navlinks a { padding: 12px 14px; color: var(--mp-text); text-decoration: none; font-size: 0.82rem; white-space: nowrap; }
.mp-navlinks a:hover { color: var(--mp-amber-dark); }

/* ---- Mega menu ---- */
.mp-megamenu { display: none; position: absolute; top: 100%; left: 0; width: 680px; max-width: 92vw; background: #fff; box-shadow: 0 16px 40px rgba(0,0,0,.18); border-radius: 0 0 10px 10px; overflow: hidden; z-index: 40; }
.mp-megamenu.open { display: flex; }
.mp-megamenu-list { width: 260px; flex-shrink: 0; background: #fafbfc; border-right: 1px solid var(--mp-line); max-height: 480px; overflow-y: auto; }
.mp-megamenu-list button { width: 100%; text-align: left; background: none; border: none; padding: 11px 16px; font-size: 0.82rem; color: var(--mp-text); cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.mp-megamenu-list button.active { background: #fff; color: var(--mp-navy); font-weight: 700; box-shadow: inset 3px 0 0 var(--mp-amber); }
.mp-megamenu-panel { flex: 1; padding: 18px 20px; display: none; }
.mp-megamenu-panel.active { display: block; }
.mp-megamenu-panel img { width: 100%; max-width: 260px; border-radius: 8px; margin-bottom: 12px; display: block; }
.mp-megamenu-panel h4 { margin: 0 0 10px; font-size: 1rem; color: var(--mp-navy); }
.mp-megamenu-sublist { display: flex; flex-direction: column; gap: 7px; }
.mp-megamenu-sublist a { color: #47525f; text-decoration: none; font-size: 0.85rem; }
.mp-megamenu-sublist a:hover { color: var(--mp-amber-dark); }
.mp-megamenu-viewall { display: inline-flex; align-items: center; gap: 4px; margin-top: 12px; color: var(--mp-navy); font-weight: 700; text-decoration: none; font-size: 0.85rem; }
.mp-megamenu-backdrop { display: none; position: fixed; inset: 0; z-index: 25; }
.mp-megamenu-backdrop.open { display: block; }

/* ---- Hero pair ---- */
.mp-hero-pair { display: grid; grid-template-columns: 2.2fr 1fr; gap: 16px; padding: 20px; max-width: 1400px; margin: 0 auto; }
.mp-hero-main { background: linear-gradient(120deg, var(--mp-navy) 0%, #123457 100%); border-radius: 12px; padding: 34px; color: #fff; display: flex; flex-direction: column; justify-content: center; min-height: 320px; position: relative; overflow: hidden; }
.mp-hero-main img.mp-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 1; }
.mp-hero-main::before { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(10,37,64,.92) 0%, rgba(10,37,64,.72) 45%, rgba(10,37,64,.4) 100%); }
.mp-hero-main-inner { position: relative; z-index: 2; max-width: 480px; }
.mp-hero-eyebrow { color: var(--mp-amber); font-weight: 700; font-size: 0.78rem; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 8px; }
.mp-hero-main h1 { font-size: 2rem; line-height: 1.15; margin: 0 0 12px; }
.mp-hero-main p { color: #cfd8e3; margin: 0 0 20px; font-size: 0.95rem; }
.mp-hero-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--mp-amber); color: #16202b; padding: 11px 22px; border-radius: 8px; font-weight: 700; text-decoration: none; width: fit-content; }
.mp-hero-badges { display: flex; gap: 20px; margin-top: 22px; flex-wrap: wrap; font-size: 0.78rem; color: #cfd8e3; }
.mp-hero-badges span { display: flex; align-items: center; gap: 6px; }
.mp-hero-badges .icon { width: 16px; height: 16px; }

.mp-hero-side { border-radius: 12px; overflow: hidden; position: relative; background: linear-gradient(160deg, #1c3550, var(--mp-navy)); color: #fff; padding: 26px; display: flex; flex-direction: column; justify-content: flex-end; min-height: 320px; }
.mp-hero-side img.mp-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 1; }
.mp-hero-side::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(28,53,80,.3) 0%, rgba(10,37,64,.9) 75%); }
.mp-hero-side-inner { position: relative; z-index: 2; }
.mp-hero-side h2 { font-size: 1.4rem; margin: 0 0 8px; line-height: 1.15; }
.mp-hero-side p { color: #cfd8e3; font-size: 0.85rem; margin: 0 0 16px; }

/* ---- Category icon strip ---- */
.mp-cat-strip { max-width: 1400px; margin: 0 auto; padding: 4px 0 22px; overflow: hidden; display: flex; gap: 18px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); }
.mp-cat-track { display: flex; flex-wrap: nowrap; gap: 18px; width: max-content; animation: mp-cat-scroll 38s linear infinite; }
.mp-cat-strip:hover .mp-cat-track { animation-play-state: paused; }
@keyframes mp-cat-scroll { from { transform: translateX(-50%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .mp-cat-track { animation: none; overflow-x: auto; } }
.mp-cat-circle { text-align: center; text-decoration: none; color: var(--mp-text); flex: 0 0 auto; width: 92px; }
.mp-cat-circle .circle { width: 72px; height: 72px; border-radius: 50%; background: #fff; border: 1px solid var(--mp-line); margin: 0 auto 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.mp-cat-circle .circle img { width: 100%; height: 100%; object-fit: cover; }
.mp-cat-circle .cat-fallback-icon { width: 28px; height: 28px; color: var(--mp-muted); }
.mp-cat-circle span { font-size: 0.75rem; font-weight: 600; display: block; }

/* ---- Three promo tiles ---- */
.mp-tiles { max-width: 1400px; margin: 0 auto; padding: 0 20px 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.mp-tile { position: relative; border-radius: 10px; padding: 20px; min-height: 140px; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; transition: box-shadow .15s ease, transform .15s ease; }
.mp-tile:hover { box-shadow: 0 6px 18px rgba(16,45,67,.12); transform: translateY(-2px); }
.mp-tile.a { background: #faf1de; }
.mp-tile.b { background: #e4eefb; }
.mp-tile.c { background: #e6f4e8; }
.mp-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mp-tile-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.65) 0%, rgba(0,0,0,.15) 55%, transparent 80%); }
.mp-tile-body { position: relative; z-index: 2; }
.mp-tile:not(:has(img)) .mp-tile-body { color: inherit; }
.mp-tile:has(img) h3, .mp-tile:has(img) p { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.mp-tile:has(img) a { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.mp-tile h3 { margin: 0 0 4px; font-size: 1.05rem; }
.mp-tile p { margin: 0 0 8px; font-size: 0.8rem; color: var(--mp-muted); }
.mp-tile a { font-weight: 700; color: var(--mp-navy); text-decoration: none; font-size: 0.85rem; }

/* ---- Featured products ---- */
.mp-featured { max-width: 1400px; margin: 0 auto; padding: 0 20px 30px; }
.mp-featured-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.mp-featured-head h2 { margin: 0; font-size: 1.3rem; }
.mp-featured-tabs { display: flex; gap: 18px; }
.mp-featured-tabs a { color: var(--mp-muted); text-decoration: none; font-size: 0.85rem; padding-bottom: 8px; border-bottom: 2px solid transparent; }
.mp-featured-tabs a.active { color: var(--mp-amber-dark); border-bottom-color: var(--mp-amber-dark); font-weight: 700; }
.mp-featured-head > a { color: var(--mp-navy); text-decoration: none; font-size: 0.85rem; font-weight: 700; margin-left: auto; }

.mp-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; max-height: 900px; overflow-y: auto; padding: 4px 2px 10px; }
.mp-pcard { width: 100%; background: #fff; border: 1px solid var(--mp-line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease; }
.mp-pcard:hover { box-shadow: 0 6px 18px rgba(16,45,67,.1); border-color: #c3d0da; transform: translateY(-2px); }
.mp-pcard-linkarea { text-decoration: none; color: var(--mp-text); display: flex; flex-direction: column; flex: 1; }
.mp-pcard-img { aspect-ratio: 1/1; background: #f4f6f8; border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.pd-img-pending { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #a4adb6; }
.pd-img-pending span { font-size: 0.68rem; font-weight: 600; text-align: center; padding: 0 8px; }
.mp-pcard-img img { width: 100%; height: 100%; object-fit: cover; }
.mp-pcard-brand { font-size: 0.7rem; font-weight: 800; color: var(--mp-navy); text-transform: uppercase; min-height: 16px; }
.mp-pcard-brand-logo { max-height: 16px; max-width: 90px; object-fit: contain; vertical-align: middle; }
.mp-pcard-name { font-size: 0.82rem; font-weight: 600; margin: 3px 0; line-height: 1.3; min-height: 2.6em; }
.mp-pcard-sub { font-size: 0.72rem; color: var(--mp-muted); margin-bottom: 4px; }
.mp-pcard-rating { font-size: 0.72rem; color: var(--mp-amber-dark); margin-bottom: 4px; }
.mp-pcard-rating span { color: var(--mp-muted); }
.mp-pcard-price { font-size: 1.05rem; font-weight: 800; margin-bottom: 2px; }
.mp-pcard-price.masked { color: var(--mp-muted); }
.mp-pcard-stock { font-size: 0.72rem; color: #2f9e44; margin-bottom: 10px; }
.mp-pcard-btn { margin-top: 10px; background: var(--mp-amber); color: #16202b; border: none; border-radius: 7px; padding: 9px 6px; font-weight: 700; font-size: 0.78rem; cursor: pointer; text-align: center; text-decoration: none; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-pcard-btn.quote { background: var(--mp-navy); color: #fff; font-size: 0.72rem; }

/* ---- Trust strip ---- */
.mp-trust { background: #eef1f4; padding: 20px; display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; }
.mp-trust-item { display: flex; align-items: center; gap: 10px; font-size: 0.8rem; max-width: 200px; text-decoration: none; color: inherit; background: none; border: none; padding: 0; font-family: inherit; text-align: left; cursor: default; }
button.mp-trust-item { cursor: pointer; }
button.mp-trust-item:hover b { text-decoration: underline; }

/* ---- Trust badge popup (footer) ---- */
.mp-trust-popup { border: none; border-radius: 14px; padding: 26px 28px; max-width: 420px; width: 90vw; box-shadow: 0 20px 60px rgba(0,0,0,.3); position: relative; }
.mp-trust-popup::backdrop { background: rgba(10,37,64,.55); }
.mp-trust-popup-icon { width: 46px; height: 46px; border-radius: 12px; background: #eef1f4; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.mp-trust-popup-icon .icon { width: 24px; height: 24px; color: var(--mp-navy); }
.mp-trust-popup h3 { margin: 0 0 10px; font-size: 1.1rem; color: var(--mp-navy); }
.mp-trust-popup p { margin: 0; font-size: 0.9rem; line-height: 1.6; color: #3a4552; }
.mp-trust-popup-close { position: absolute; top: 16px; right: 16px; background: none; border: none; font-size: 1.1rem; color: var(--mp-muted); cursor: pointer; line-height: 1; }
.mp-trust-item .icon { width: 26px; height: 26px; color: var(--mp-navy); }
.mp-trust-item b { display: block; font-size: 0.85rem; }
.mp-trust-item span { color: var(--mp-muted); font-size: 0.72rem; }

@media (max-width: 860px) {
    .mp-hero-pair { grid-template-columns: 1fr; }
    .mp-megamenu { width: 100%; flex-direction: column; }
    .mp-megamenu-list { width: 100%; max-height: 240px; }
}

/* ============================================================
   Product detail page
   ============================================================ */
.mp-breadcrumb { max-width: 1400px; margin: 0 auto; padding: 12px 20px 0; font-size: 0.8rem; color: var(--mp-muted); }
.mp-breadcrumb a { color: var(--mp-muted); text-decoration: none; }
.mp-breadcrumb a:hover { color: var(--mp-navy); }

.pd-layout { max-width: 1400px; margin: 0 auto; padding: 16px 20px 30px; display: grid; grid-template-columns: 420px 1fr 320px; gap: 24px; align-items: start; }
.pd-layout > div { min-width: 0; }
@media (max-width: 1100px) { .pd-layout { grid-template-columns: 1fr; } }

/* -- gallery -- */
.pd-gallery2 { aspect-ratio: 1/1; background: #fff; border: 1px solid var(--mp-line); border-radius: 10px; overflow: hidden; position: relative; }
.pd-gallery2 img { width: 100%; height: 100%; object-fit: contain; }
.pd-noimage-icon { width: 60px; height: 60px; color: var(--mp-line); }
.pd-thumbs2 { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.pd-thumb2 { width: 74px; height: 74px; object-fit: contain; background: #fff; border: 2px solid var(--mp-line); border-radius: 8px; cursor: pointer; flex: 0 0 auto; padding: 4px; }
.pd-thumb2.active, .pd-thumb2:hover { border-color: var(--mp-amber); }

/* -- middle info column -- */
.pd-title2 { font-size: 1.5rem; margin: 0 0 8px; }
.pd-brandline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.85rem; color: var(--mp-muted); margin-bottom: 10px; }
.pd-brandline img { max-height: 20px; max-width: 90px; object-fit: contain; vertical-align: middle; }
.pd-brandline b { color: var(--mp-text); }
.pd-rating-row { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; margin-bottom: 12px; }
.pd-rating-row .stars { color: var(--mp-amber-dark); }
.pd-rating-row a { color: var(--mp-navy); text-decoration: none; font-weight: 600; }
.pd-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pd-badge { font-size: 0.75rem; font-weight: 700; padding: 5px 10px; border-radius: 20px; display: inline-flex; align-items: center; gap: 4px; }
.pd-badge.stock { background: #e6f4e8; color: #237a3a; }
.pd-badge.trust { background: #e4eefb; color: #1d5aa8; }
.pd-desc2 { font-size: 0.9rem; color: #3a4552; line-height: 1.6; margin-bottom: 16px; }
.pd-feature-icons { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.pd-feature-icon { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: #3a4552; }
.pd-feature-icon .icon { color: #2f9e44; width: 16px; height: 16px; }
.pd-spec-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-bottom: 4px; }
.pd-spec-table tr:nth-child(odd) { background: #f7f8fa; }
.pd-spec-table td { padding: 10px 14px; }
.pd-spec-table td:first-child { font-weight: 700; width: 35%; color: #3a4552; }

/* -- tabs -- */
.pd-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--mp-line); margin: 26px 0 18px; overflow-x: auto; }
.pd-tabs a { padding-bottom: 10px; color: var(--mp-muted); text-decoration: none; font-size: 0.9rem; white-space: nowrap; border-bottom: 2px solid transparent; }
.pd-tabs a.active { color: var(--mp-amber-dark); border-bottom-color: var(--mp-amber-dark); font-weight: 700; }
.pd-tab-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; }
@media (max-width: 760px) { .pd-tab-grid { grid-template-columns: 1fr; } }
.pd-feature-list { list-style: none; padding: 0; margin: 0; }
.pd-feature-list li { padding: 6px 0; font-size: 0.88rem; display: flex; gap: 8px; }
.pd-feature-list li::before { content: "✔"; color: #2f9e44; flex-shrink: 0; }
.pd-doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }

/* ---- Product reviews ---- */
.pd-review-notice { padding: 12px 16px; border-radius: 8px; font-size: 0.85rem; margin-bottom: 18px; }
.pd-review-notice.ok { background: #e6f4e8; color: #237a3a; border: 1px solid #bfe3c6; }
.pd-review-notice.warn { background: #fdf1e0; color: #8a5a1f; border: 1px solid #f0d3a3; }
.pd-review-form { max-width: 480px; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--mp-line); }
.pd-review-form label { display: block; font-size: 0.82rem; font-weight: 600; margin: 12px 0 6px; }
.pd-review-form input[type=text], .pd-review-form textarea { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--mp-line); font-size: 0.88rem; font-family: inherit; }
.pd-review-form textarea { resize: vertical; }
.pd-star-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; font-size: 1.8rem; }
.pd-star-input input { position: absolute; opacity: 0; pointer-events: none; }
.pd-star-input label { margin: 0 !important; cursor: pointer; color: #d8dde3; }
.pd-star-input input:checked ~ label, .pd-star-input label:hover, .pd-star-input label:hover ~ label { color: var(--mp-amber); }
.pd-review-list { display: flex; flex-direction: column; gap: 18px; }
.pd-review-item { padding-bottom: 18px; border-bottom: 1px solid var(--mp-line); }
.pd-review-item:last-child { border-bottom: none; }
.pd-review-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pd-review-head .stars { color: var(--mp-amber); letter-spacing: 1px; }
.pd-review-head .date { color: var(--mp-muted); font-size: 0.78rem; margin-left: auto; }
.pd-review-title { font-weight: 700; margin: 6px 0 2px; }
.pd-review-item p { margin: 0; font-size: 0.88rem; color: #3a4552; }
.pd-doc-card { background: #fff; border: 1px solid var(--mp-line); border-radius: 8px; padding: 12px; text-align: center; text-decoration: none; color: var(--mp-text); }
.pd-doc-card .icon { width: 28px; height: 28px; color: #d94040; }
.pd-doc-card .label { font-size: 0.8rem; font-weight: 600; margin: 6px 0 2px; }
.pd-doc-card .meta { font-size: 0.7rem; color: var(--mp-muted); margin-bottom: 6px; }
.pd-doc-card .dl { font-size: 0.75rem; color: var(--mp-navy); font-weight: 700; }

/* -- purchase box (right column) -- */
.pd-buybox { background: #fff; border: 1px solid var(--mp-line); border-radius: 10px; padding: 18px; position: sticky; top: 16px; }
.pd-price2 { font-size: 1.6rem; font-weight: 800; color: #c0392b; }
.pd-qty-total { font-size: 0.85rem; color: var(--mp-muted); margin: 2px 0 10px; font-weight: 600; }
.pd-listprice { font-size: 0.9rem; color: var(--mp-muted); text-decoration: line-through; margin-left: 8px; }
.pd-save-badge { background: #fdeaea; color: #c0392b; font-size: 0.72rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; margin-left: 6px; }
.pd-masked-price { font-size: 1.3rem; font-weight: 800; color: var(--mp-muted); }
.pd-stock-row { font-size: 0.8rem; color: #237a3a; margin: 8px 0 14px; display: flex; align-items: center; gap: 6px; }
.pd-qty-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.pd-qty-stepper { display: flex; align-items: center; border: 1px solid var(--mp-line); border-radius: 6px; }
.pd-qty-stepper button { background: none; border: none; width: 32px; height: 32px; font-size: 1rem; cursor: pointer; }
.pd-qty-stepper input { width: 44px; text-align: center; border: none; border-left: 1px solid var(--mp-line); border-right: 1px solid var(--mp-line); height: 32px; }
.pd-buybox .btn-block { display: block; width: 100%; text-align: center; padding: 12px; border-radius: 8px; font-weight: 700; text-decoration: none; margin-bottom: 10px; box-sizing: border-box; border: none; cursor: pointer; font-size: 0.9rem; }
.pd-buybox .btn-cart2 { background: var(--mp-amber); color: #16202b; }
.pd-buybox .btn-buy2 { background: #fff; color: var(--mp-navy); border: 1px solid var(--mp-navy); }
.pd-buybox .btn-quote2 { background: #eaf2fb; color: #1d5aa8; border: 1px solid #cfe0f5; }
.pd-info-block { display: flex; gap: 10px; padding: 14px 0; border-top: 1px solid var(--mp-line); font-size: 0.8rem; }
.pd-info-block .icon { width: 22px; height: 22px; color: var(--mp-navy); flex-shrink: 0; margin-top: 2px; }
.pd-info-block b { display: block; font-size: 0.85rem; }
.pd-info-block a { color: var(--mp-navy); }
.pd-info-block .muted { color: var(--mp-muted); }

/* -- related products -- */
.pd-related { max-width: 1400px; margin: 0 auto; padding: 0 20px 30px; }
.pd-related h2 { font-size: 1.2rem; margin-bottom: 14px; }

/* ============================================================
   Search / category results page
   ============================================================ */
.sr-layout { max-width: 1400px; margin: 0 auto; padding: 16px 20px 30px; }
.sr-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.sr-title { font-size: 1.6rem; margin: 4px 0 2px; }
.sr-count { color: var(--mp-muted); font-size: 0.85rem; margin: 0; }

.sr-promo-strip { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; flex: 1; min-width: 320px; max-width: 960px; align-items: stretch; }
@media (max-width: 900px) { .sr-promo-strip { grid-template-columns: 1fr; } .sr-title-row { flex-direction: column; } }
.sr-promo-banner { background: linear-gradient(120deg, rgba(234,242,251,.97), rgba(234,242,251,.85)), url('/storage/site/misc/rfq-banner-bg.jpg'); background-size: cover; background-position: right center; border-radius: 10px; padding: 16px 20px; }
.sr-promo-banner h3 { margin: 0 0 4px; font-size: 1rem; color: #1d5aa8; }
.sr-promo-banner p { margin: 0 0 10px; font-size: 0.82rem; color: var(--mp-muted); }
.sr-trust-row { display: flex; align-items: center; justify-content: space-around; background: #fff; border: 1px solid var(--mp-line); border-radius: 10px; padding: 14px 10px; }
.sr-trust-mini { display: flex; gap: 8px; align-items: center; font-size: 0.8rem; padding: 0 10px; border-left: 1px solid var(--mp-line); }
.sr-trust-mini:first-child { border-left: none; }
.sr-trust-mini b { display: block; white-space: nowrap; }
.sr-trust-mini .muted { color: var(--mp-muted); font-size: 0.7rem; white-space: nowrap; }
.sr-trust-mini .icon { color: var(--mp-navy); flex-shrink: 0; }
@media (max-width: 700px) { .sr-trust-row { flex-direction: column; gap: 10px; align-items: flex-start; } .sr-trust-mini { border-left: none; padding: 0; } }

.sr-body { display: grid; grid-template-columns: 230px 1fr; gap: 22px; align-items: start; }
@media (max-width: 860px) { .sr-body { grid-template-columns: 1fr; } }

.sr-sidebar { background: #fff; border: 1px solid var(--mp-line); border-radius: 10px; padding: 16px; }
.sr-sidebar-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.sr-sidebar-head h3 { margin: 0; font-size: 1rem; }
.sr-sidebar-head a { font-size: 0.78rem; color: var(--mp-navy); text-decoration: none; }
.sr-filter-group { padding: 12px 0; border-top: 1px solid var(--mp-line); }
.sr-filter-group:first-child { border-top: none; padding-top: 0; }
.sr-filter-group h4 { margin: 0 0 8px; font-size: 0.85rem; }
.sr-filter-group select { width: 100%; padding: 7px 8px; border-radius: 6px; border: 1px solid var(--mp-line); font-size: 0.82rem; }
.sr-check { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; padding: 4px 0; cursor: pointer; }
.sr-check span { color: var(--mp-muted); }

.sr-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.sr-toolbar select { padding: 6px 8px; border-radius: 6px; border: 1px solid var(--mp-line); font-size: 0.82rem; }
.sr-toolbar-right { display: flex; align-items: center; gap: 10px; }
.sr-view-label { font-size: 0.82rem; color: var(--mp-muted); }
.sr-view-toggle { display: flex; border: 1px solid var(--mp-line); border-radius: 6px; overflow: hidden; }
.sr-view-toggle a { display: flex; align-items: center; justify-content: center; width: 32px; height: 30px; text-decoration: none; color: var(--mp-muted); font-size: 0.95rem; background: #fff; }
.sr-view-toggle a.active { background: var(--mp-navy); color: #fff; }

.sr-grid-list { grid-template-columns: 1fr !important; }
.sr-grid-list .sr-card { flex-direction: row; }
.sr-grid-list .sr-card-img { width: 160px; aspect-ratio: auto; flex-shrink: 0; }
.sr-grid-list .sr-card-body { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 20px; }
.sr-grid-list .sr-card-body > * { margin: 0; }
.sr-grid-list .sr-card-btns { flex-direction: column; width: 160px; margin-left: auto; }

.sr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.sr-card { background: #fff; border: 1px solid var(--mp-line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.sr-card-img { display: block; aspect-ratio: 1/1; background: #f4f6f8; }
.sr-card-img img { width: 100%; height: 100%; object-fit: contain; }
.sr-card-body { padding: 12px 14px; display: flex; flex-direction: column; flex: 1; }
.sr-card-brand { font-size: 0.7rem; font-weight: 800; color: var(--mp-navy); text-transform: uppercase; min-height: 14px; }
.sr-card-name { color: var(--mp-text); text-decoration: none; font-weight: 700; font-size: 0.9rem; margin: 3px 0; display: block; }
.sr-card-sku { font-size: 0.72rem; color: var(--mp-muted); margin-bottom: 6px; }
.sr-card-specs { list-style: none; padding: 0; margin: 0 0 6px; font-size: 0.75rem; color: #47525f; }
.sr-card-specs li { padding: 1px 0; }
.sr-card-desc { font-size: 0.75rem; color: var(--mp-muted); margin: 0 0 6px; }
.sr-card-rating { font-size: 0.75rem; margin-bottom: 4px; }
.sr-card-rating .stars { color: var(--mp-amber-dark); }
.sr-card-rating span:last-child { color: var(--mp-muted); }
.sr-card-price { font-size: 1.05rem; font-weight: 800; margin-bottom: 4px; }
.sr-card-price.rfq { color: var(--mp-muted); }
.sr-card-stock { font-size: 0.72rem; display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sr-card-stock .in { color: #237a3a; }
.sr-card-stock .out { color: #c0392b; }
.sr-card-stock .ships { color: var(--mp-muted); }
.sr-card-btns { display: flex; gap: 6px; margin-top: auto; }
.sr-card-btns form { flex: 1; }
.sr-btn-cart, .sr-btn-details { display: block; width: 100%; text-align: center; padding: 8px; border-radius: 7px; font-size: 0.78rem; font-weight: 700; text-decoration: none; border: none; cursor: pointer; box-sizing: border-box; }
.sr-btn-cart { background: var(--mp-amber); color: #16202b; }
.sr-btn-details { background: #fff; color: var(--mp-navy); border: 1px solid var(--mp-navy); flex: 1; }

/* ============================================================
   Rich footer (5 link columns + brand + social + tagline),
   shared across every marketplace page via includes/site_footer.php
   ============================================================ */
.mp-footer { background: var(--mp-navy-dark); color: #b9c4d1; padding: 36px 20px 0; }
.mp-footer-inner { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: 1.6fr repeat(5, 1fr); gap: 20px; padding-bottom: 28px; }
@media (max-width: 900px) { .mp-footer-inner { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .mp-footer-inner { grid-template-columns: 1fr; } }
.mp-footer-col h4 { color: #fff; font-size: 0.85rem; margin: 0 0 12px; }
.mp-footer-col a, .mp-footer-col span { display: block; color: #b9c4d1; text-decoration: none; font-size: 0.8rem; margin-bottom: 9px; }
.mp-footer-col a:hover { color: var(--mp-amber); }
.mp-footer-brand .mp-logo-mark { font-size: 1.3rem; margin-bottom: 4px; white-space: nowrap; }
.mp-footer-brand .mp-logo-mark span { display: inline; }
.mp-footer-brand .mp-logo-tag { color: #7c8ba0; font-size: 0.6rem; letter-spacing: 1px; margin-bottom: 14px; }
.mp-footer-copy { color: #7c8ba0; font-size: 0.75rem; }
.mp-footer-bottom { max-width: 1400px; margin: 0 auto; border-top: 1px solid #1c344f; padding: 16px 0; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.mp-footer-social { display: flex; align-items: center; gap: 10px; font-size: 0.78rem; color: #b9c4d1; }
.mp-footer-social a { width: 28px; height: 28px; border-radius: 50%; background: #12283f; color: #fff; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-size: 0.75rem; font-weight: 700; }
.mp-footer-social a:hover { background: var(--mp-amber); color: #16202b; }
.mp-footer-tagline { font-style: italic; color: #7c8ba0; font-size: 0.85rem; }
.mp-footer-build { color: #4a5568; font-size: 0.7rem; margin-top: 6px; }

/* ---- Simple static content pages (About, Help, Terms, etc.) ---- */
.static-page { max-width: 820px; margin: 0 auto; padding: 20px 20px 50px; }
.static-page h1 { font-size: 1.6rem; margin-bottom: 6px; }
.static-page-body { font-size: 0.9rem; line-height: 1.7; color: #3a4552; }
.static-page-body h2 { font-size: 1.1rem; margin: 24px 0 8px; color: var(--mp-navy); }
.static-page-body ul { padding-left: 20px; }
.static-page-body li { margin-bottom: 6px; }

/* ============================================================
   RFQ page (rfq/index.php)
   ============================================================ */
.rfq-hero { position: relative; background: linear-gradient(100deg, var(--mp-navy) 40%, #123457 100%); overflow: hidden; }
.rfq-hero img.mp-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 1; }
.rfq-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(10,37,64,.9) 0%, rgba(10,37,64,.65) 50%, rgba(10,37,64,.75) 100%); }
.rfq-hero-inner { position: relative; z-index: 2; max-width: 1400px; margin: 0 auto; padding: 34px 20px; display: flex; justify-content: space-between; gap: 30px; color: #fff; }
.rfq-hero-left { max-width: 640px; }
.rfq-hero-left h1 { font-size: 2rem; margin: 0 0 10px; }
.rfq-hero-sub { font-size: 1.05rem; color: var(--mp-amber); font-weight: 700; margin: 0 0 10px; }
.rfq-hero-desc { color: #cfd8e3; font-size: 0.9rem; margin: 0 0 20px; }
.rfq-hero-badges { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.78rem; color: #cfd8e3; }
.rfq-hero-badges span { display: flex; align-items: center; gap: 6px; }
.rfq-hero-right { text-align: right; flex-shrink: 0; padding-top: 10px; }
.rfq-hero-right h2 { font-size: 1.3rem; margin: 0 0 10px; line-height: 1.3; }
.rfq-hero-rule { width: 60px; height: 3px; background: var(--mp-amber); margin: 0 0 10px auto; }
.rfq-hero-right p { color: #cfd8e3; font-size: 0.85rem; margin: 0; }
@media (max-width: 800px) { .rfq-hero-inner { flex-direction: column; } .rfq-hero-right { text-align: left; } .rfq-hero-rule { margin: 0 0 10px 0; } }

.rfq-layout { max-width: 1400px; margin: 0 auto; padding: 24px 20px 40px; display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
@media (max-width: 980px) { .rfq-layout { grid-template-columns: 1fr; } }

.rfq-form-card { background: #fff; border: 1px solid var(--mp-line); border-radius: 12px; padding: 26px; }
.rfq-form-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.rfq-form-head h2 { margin: 0 0 4px; font-size: 1.3rem; }
.rfq-form-head p { margin: 0; color: var(--mp-muted); font-size: 0.85rem; }
.rfq-required-note { color: #c0392b; font-size: 0.78rem; white-space: nowrap; }

.rfq-field-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.rfq-field-grid.cols-1 { grid-template-columns: 1fr; }
.rfq-field-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.rfq-field-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.rfq-field-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 760px) { .rfq-field-grid.cols-2, .rfq-field-grid.cols-3, .rfq-field-grid.cols-4 { grid-template-columns: 1fr; } .rfq-field-grid > div[style] { grid-column: auto !important; } }

.rfq-field label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 6px; color: #3a4552; }
.rfq-field label .optional { font-weight: 400; color: var(--mp-muted); }
.rfq-field label .req, .rfq-required-note { color: #d92d20; }
.rfq-field input, .rfq-field textarea { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--mp-line); font-size: 0.88rem; box-sizing: border-box; font-family: inherit; }
.rfq-field select {
    width: 100%; padding: 10px 34px 10px 12px; border-radius: 8px; border: 1px solid var(--mp-line);
    font-size: 0.88rem; box-sizing: border-box; font-family: inherit; height: 42px;
    -webkit-appearance: none; -moz-appearance: none; appearance: none; background-color: #fff;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7684'%3E%3Cpath d='M5.5 7.5l4.5 5 4.5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
.rfq-field textarea { resize: vertical; }
.rfq-phone-row { display: flex; gap: 6px; }
.rfq-phone-row input[type=text] { flex: 1 1 0%; width: auto; min-width: 0; }
.rfq-phone-row .rfq-dial-select { width: 100px; flex-shrink: 0; padding: 10px 4px; border-radius: 8px; border: 1px solid var(--mp-line); font-size: 0.85rem; }
.rfq-wechat-icon { display: flex; align-items: center; padding: 0 10px; color: #07c160; }
.rfq-wechat-icon .icon { width: 20px; height: 20px; }
.rfq-char-count { text-align: right; font-size: 0.72rem; color: var(--mp-muted); margin-top: 4px; }

.rfq-upload-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 2px dashed var(--mp-line); border-radius: 10px; padding: 26px; text-align: center; cursor: pointer; color: var(--mp-muted); background: #fafbfc; }
.rfq-upload-drop .icon { width: 28px; height: 28px; color: var(--mp-navy); }
.rfq-upload-drop strong { color: var(--mp-navy); }
.rfq-upload-drop small { font-size: 0.75rem; }
.rfq-file-list { font-size: 0.78rem; color: var(--mp-muted); margin-top: 8px; }

.rfq-form-footer { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.rfq-submit-btn { background: var(--mp-amber); color: #16202b; border: none; padding: 13px 26px; border-radius: 8px; font-weight: 700; font-size: 0.9rem; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.rfq-secure-note { font-size: 0.78rem; color: var(--mp-muted); }

.rfq-sidebar { display: flex; flex-direction: column; gap: 18px; }
.rfq-side-box { border-radius: 12px; padding: 20px; }
.rfq-side-box h3 { margin: 0 0 14px; font-size: 1.05rem; color: var(--mp-navy); }
.rfq-side-box.why { background: #eaf2fb; }
.rfq-why-item { display: flex; gap: 12px; margin-bottom: 16px; align-items: flex-start; }
.rfq-why-item:last-child { margin-bottom: 0; }
.rfq-why-icon { flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(29,90,168,.15); }
.rfq-why-icon .icon { width: 19px; height: 19px; color: #1d5aa8; }
.rfq-why-item b { display: block; font-size: 0.88rem; margin-bottom: 2px; color: var(--mp-navy); }
.rfq-why-item p { margin: 0; font-size: 0.78rem; color: var(--mp-muted); line-height: 1.4; }

.rfq-side-box.faq { background: #fff; border: 1px solid var(--mp-line); }
.rfq-side-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; padding-bottom: 12px; border-bottom: 2px solid var(--mp-navy); }
.rfq-side-head h3 { margin: 0; color: var(--mp-navy); }
.rfq-side-head a { font-size: 0.78rem; color: var(--mp-amber-dark); text-decoration: none; font-weight: 700; white-space: nowrap; }
.rfq-faq-item { border-top: 1px solid var(--mp-line); padding: 10px 0; }
.rfq-faq-item summary { cursor: pointer; font-size: 0.85rem; font-weight: 600; list-style: none; }
.rfq-faq-item summary::-webkit-details-marker { display: none; }
.rfq-faq-item summary::after { content: '⌄'; float: right; }
.rfq-faq-item[open] summary::after { content: '⌃'; }
.rfq-faq-item p { font-size: 0.8rem; color: var(--mp-muted); margin: 8px 0 0; }

.rfq-side-box.help { background: #fdf1e2; display: flex; gap: 14px; }
.rfq-help-icon { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(181,101,10,.2); }
.rfq-help-icon .icon { width: 20px; height: 20px; color: #b5650a; }
.rfq-side-box.help h3 { font-size: 1rem; margin: 0 0 4px; color: #7a4a0a; }
.rfq-side-box.help > div > p { margin: 0 0 10px; font-size: 0.8rem; color: #6b5030; }
.rfq-help-contacts { display: flex; flex-direction: column; gap: 6px; font-size: 0.8rem; }
.rfq-help-contacts span { display: flex; align-items: center; gap: 6px; }
.rfq-help-contacts .icon { width: 15px; height: 15px; color: #b5650a; }
