/*
Theme Name: Jingwei Equipment
Theme URI: https://shop.xmjw.ltd
Author: Jingwei
Description: English industrial equipment catalogue theme with USD pricing, specification detail and quote requests.
Version: 1.0.0
Text Domain: jingwei
*/

/* ---------------------------------------------------------------
   1. Tokens
--------------------------------------------------------------- */
:root {
  --ink: #0b0f14;
  --ink-soft: #2b3540;
  --muted: #6a7480;
  --paper: #f6f3ee;
  --paper-2: #fbf9f6;
  --card: #ffffff;
  --line: #e2dbd1;
  --line-strong: #cfc6b8;
  --accent: #b8451b;
  --accent-dark: #8f3313;
  --accent-soft: #f6e7df;
  --steel: #39424c;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(11, 15, 20, .05);
  --shadow-md: 0 14px 34px -18px rgba(11, 15, 20, .35);
  --max: 1240px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

/* ---------------------------------------------------------------
   2. Base
--------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 28px; }

.eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
}

.section { padding: 92px 0; }
.section--tight { padding: 64px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
.section-head p { color: var(--muted); max-width: 460px; font-size: 15px; }

/* ---------------------------------------------------------------
   3. Header
--------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(246, 243, 238, .88);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 74px; gap: 28px; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--ink); color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 15px; letter-spacing: .02em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-weight: 800; font-size: 15px; letter-spacing: .16em; }
.brand-sub { font-size: 10px; letter-spacing: .28em; color: var(--muted); text-transform: uppercase; }

.nav { display: flex; align-items: center; gap: 28px; }
.nav a { font-size: 14px; color: var(--ink-soft); font-weight: 500; }
.nav a:hover { color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; border-radius: 999px;
  font-size: 13px; font-weight: 700; letter-spacing: .02em;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .16s ease, background .16s ease, color .16s ease, border-color .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); }
.btn--ghost { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--ink); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--sm { height: 38px; padding: 0 16px; font-size: 12px; }

/* ---------------------------------------------------------------
   4. Hero
--------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; padding: 86px 0 70px; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background:
    linear-gradient(180deg, rgba(246,243,238,0) 60%, var(--paper) 100%),
    repeating-linear-gradient(90deg, rgba(11,15,20,.045) 0 1px, transparent 1px 120px),
    repeating-linear-gradient(0deg, rgba(11,15,20,.045) 0 1px, transparent 1px 120px);
  mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: 64px; align-items: center; }
.hero h1 {
  font-size: clamp(2.4rem, 4.6vw, 4.1rem);
  margin: 18px 0 22px;
  max-width: 15ch;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-lead { color: var(--ink-soft); font-size: 17px; max-width: 46ch; }
.hero-actions { display: flex; align-items: center; gap: 14px; margin-top: 34px; flex-wrap: wrap; }

.stats { display: flex; gap: 40px; margin-top: 52px; flex-wrap: wrap; }
.stat strong { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

.hero-panel {
  position: relative;
  border-radius: 18px;
  background: linear-gradient(160deg, #10161d 0%, #1b242e 55%, #2a3540 100%);
  color: #f4efe8;
  padding: 34px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.hero-panel::after {
  content: ""; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 1px, transparent 1px 44px);
  pointer-events: none;
}
.panel-label { font-size: 10px; letter-spacing: .26em; text-transform: uppercase; color: rgba(244,239,232,.55); }
.panel-figure { font-size: 84px; font-weight: 800; line-height: .95; letter-spacing: -.05em; margin: 26px 0 6px; font-variant-numeric: tabular-nums; }
.panel-figure small { font-size: 13px; letter-spacing: .18em; font-weight: 600; color: var(--accent); vertical-align: super; margin-left: 8px; }
.panel-rows { margin-top: 30px; border-top: 1px solid rgba(255,255,255,.14); }
.panel-row { display: flex; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid rgba(255,255,255,.1); font-size: 13px; }
.panel-row span { color: rgba(244,239,232,.6); }
.panel-row b { font-weight: 600; letter-spacing: .04em; }

/* ---------------------------------------------------------------
   5. Value strip
--------------------------------------------------------------- */
.value-strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper-2); }
.value-strip .wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.value-item { padding: 26px 26px 26px 0; display: flex; gap: 14px; align-items: flex-start; }
.value-item + .value-item { padding-left: 26px; border-left: 1px solid var(--line); }
.value-item svg { flex: none; width: 22px; height: 22px; color: var(--accent); }
.value-item h4 { font-size: 14px; margin-bottom: 3px; }
.value-item p { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ---------------------------------------------------------------
   6. Categories
--------------------------------------------------------------- */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.cat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.cat-card:hover { border-color: var(--line-strong); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.cat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent-dark);
  display: grid; place-items: center;
}
.cat-icon svg { width: 22px; height: 22px; }
.cat-card h3 { font-size: 15px; line-height: 1.3; }
.cat-card .cat-meta { margin-top: auto; display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }
.cat-card .cat-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------
   7. Product cards
--------------------------------------------------------------- */
.prod-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.prod-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.prod-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }

.prod-visual {
  position: relative;
  height: 118px;
  background: linear-gradient(140deg, #12191f, #232e39 70%, #2f3b47);
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  color: #f2ece4;
  overflow: hidden;
}
.prod-visual::after {
  content: ""; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(0deg, rgba(255,255,255,.06) 0 1px, transparent 1px 34px);
}
.prod-visual svg { position: relative; z-index: 1; width: 34px; height: 34px; opacity: .8; }
.prod-sku { position: relative; z-index: 1; font-size: 10px; letter-spacing: .18em; opacity: .7; }

/* real supplier photo replaces the glyph panel */
.prod-visual.has-photo { padding: 0; }
.prod-visual.has-photo::after { display: none; }
.prod-photo {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}
.prod-visual.has-photo .prod-sku {
  position: absolute; right: 10px; bottom: 8px;
  background: rgba(10, 14, 18, .62); color: #fff;
  padding: 3px 8px; border-radius: 4px; opacity: 1;
}
.prod-video-badge {
  position: absolute; left: 10px; bottom: 8px; z-index: 2;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(184, 69, 27, .92); color: #fff;
  display: grid; place-items: center;
  font-size: 10px; line-height: 1;
}

.prod-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.prod-tag { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.prod-name { font-size: 16px; line-height: 1.35; min-height: 44px; }
.prod-specs { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 11px; line-height: 1.35; color: var(--steel);
  background: #f3eee7; border-radius: 999px; padding: 5px 10px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.prod-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 8px; }
.price { font-size: 21px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.price small { font-size: 10px; letter-spacing: .14em; color: var(--muted); font-weight: 600; display: block; }
.price--quote { font-size: 15px; color: var(--accent-dark); }

.link-more {
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  border-bottom: 1px solid var(--line-strong); padding-bottom: 2px;
  background: none; border-top: 0; border-left: 0; border-right: 0; cursor: pointer; color: var(--ink);
}
.link-more:hover { color: var(--accent); border-color: var(--accent); }

/* ---------------------------------------------------------------
   8. Catalogue page
--------------------------------------------------------------- */
.cat-hero { padding: 64px 0 40px; border-bottom: 1px solid var(--line); background: var(--paper-2); }
.cat-hero h1 { font-size: clamp(2rem, 3.6vw, 3rem); margin: 14px 0 14px; }
.cat-hero p { color: var(--muted); max-width: 60ch; font-size: 15px; }

.toolbar {
  position: sticky; top: 74px; z-index: 30;
  background: rgba(246,243,238,.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.toolbar-inner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.search {
  flex: 1 1 260px; display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 999px;
  height: 42px; padding: 0 16px; min-width: 200px;
}
.search input { border: 0; outline: 0; width: 100%; font: inherit; font-size: 14px; background: transparent; color: var(--ink); }
.search svg { width: 16px; height: 16px; color: var(--muted); flex: none; }

.chips-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 0 2px; }
.chip-btn {
  height: 34px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent;
  font-size: 12px; font-weight: 600; color: var(--ink-soft); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip-btn span { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-btn[aria-pressed="true"] span { color: rgba(255,255,255,.6); }

.toolbar-right { display: flex; align-items: center; gap: 12px; }
.select {
  height: 42px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: #fff; padding: 0 14px; font: inherit; font-size: 13px; color: var(--ink);
}
.count-note { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.catalog-body { padding: 34px 0 96px; }
.empty { text-align: center; padding: 80px 0; color: var(--muted); }

/* ---------------------------------------------------------------
   9. Modal
--------------------------------------------------------------- */
.modal {
  position: fixed; inset: 0; z-index: 90;
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.modal[open] { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(9, 12, 16, .62); backdrop-filter: blur(3px); }
.modal-panel {
  position: relative; z-index: 1;
  width: min(760px, 100%); max-height: 88vh; overflow: auto;
  background: var(--paper-2); border-radius: 18px;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.6);
}
.modal-head {
  padding: 28px 30px 22px; border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  background: linear-gradient(150deg, #10161d, #232e39);
  color: #f4efe8;
}
.modal-head h2 { font-size: 22px; line-height: 1.25; }
.modal-head .prod-tag { color: #e8a17f; }
.modal-close {
  border: 0; background: rgba(255,255,255,.12); color: #fff; width: 36px; height: 36px;
  border-radius: 50%; cursor: pointer; font-size: 18px; line-height: 1; flex: none;
}
.modal-body { padding: 26px 30px 30px; }
.modal-hero {
  margin: -26px -30px 22px;
  background: #0f151b;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.modal-hero img { width: 100%; height: 100%; object-fit: contain; display: block; }
.modal-overview {
  font-size: 13px; line-height: 1.7; color: var(--ink-soft);
  background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0; padding: 14px 16px; margin: 0 0 24px;
}
.modal-links { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.modal-link { font-size: 12px; font-weight: 600; color: var(--accent-dark); border-bottom: 1px solid transparent; }
.modal-link:hover { border-color: var(--accent); }
.spec-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 26px; margin: 0 0 26px; padding: 0; list-style: none; }
.spec-list li { font-size: 13px; color: var(--ink-soft); padding-left: 16px; position: relative; line-height: 1.5; }
.spec-list li::before { content: ""; position: absolute; left: 0; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.modal-price-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); padding-top: 22px; flex-wrap: wrap; }
.modal-price-row .price { font-size: 30px; }

/* ---------------------------------------------------------------
   10. Quote / contact
--------------------------------------------------------------- */
.quote-band { background: var(--ink); color: #f4efe8; padding: 74px 0; }
.quote-band .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.quote-band h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
.quote-band p { color: rgba(244,239,232,.66); font-size: 15px; margin-top: 14px; max-width: 44ch; }
.quote-band .btn--primary { margin-top: 26px; }

.form { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field label { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: rgba(244,239,232,.6); margin-bottom: 7px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06);
  color: #fff; border-radius: 10px; padding: 12px 14px; font: inherit; font-size: 14px; outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: rgba(255,255,255,.5); }
.field textarea { min-height: 96px; resize: vertical; }
.form .btn { width: 100%; height: 48px; }

.form--light .field label { color: var(--muted); }
.form--light .field input, .form--light .field textarea { background: #fff; border-color: var(--line-strong); color: var(--ink); }

.notice { border-radius: 10px; padding: 12px 16px; font-size: 13px; margin-bottom: 16px; }
.notice--ok { background: #e7f4ea; color: #215c33; border: 1px solid #bfe2c8; }

/* ---------------------------------------------------------------
   11. Footer
--------------------------------------------------------------- */
.site-footer { background: #0a0e12; color: #cfc9c1; padding: 60px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.footer-brand .brand-mark { background: #f4efe8; color: #0a0e12; }
.site-footer .brand-name { color: #fff; }
.site-footer .brand-sub { color: rgba(207,201,193,.6); }
.footer-about { font-size: 13px; line-height: 1.7; color: rgba(207,201,193,.66); margin-top: 18px; max-width: 34ch; }
.footer-col h4 { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: rgba(207,201,193,.55); margin-bottom: 14px; }
.footer-col a, .footer-col p { display: block; font-size: 13px; color: rgba(207,201,193,.8); margin-bottom: 9px; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  margin-top: 46px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.1);
  display: flex; justify-content: space-between; gap: 16px; font-size: 12px; color: rgba(207,201,193,.5); flex-wrap: wrap;
}

/* ---------------------------------------------------------------
   12. Responsive
--------------------------------------------------------------- */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero h1 { max-width: 20ch; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .prod-grid { grid-template-columns: repeat(2, 1fr); }
  .value-strip .wrap { grid-template-columns: repeat(2, 1fr); }
  .value-item:nth-child(3) { border-left: 0; padding-left: 0; }
  .quote-band .wrap { grid-template-columns: 1fr; gap: 34px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .wrap { padding: 0 18px; }
  .section { padding: 66px 0; }
  .nav { display: none; }
  .hero { padding: 56px 0 48px; }
  .panel-figure { font-size: 62px; }
  .stats { gap: 26px; margin-top: 38px; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .prod-grid { grid-template-columns: 1fr; }
  .spec-list { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .value-strip .wrap { grid-template-columns: 1fr; }
  .value-item { padding: 20px 0; border-left: 0 !important; }
  .value-item + .value-item { border-top: 1px solid var(--line); }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 12px; }

  /* mobile: keep chips and toolbar inside the viewport */
  .search { min-width: 0; flex-basis: 100%; }
  .toolbar-right { width: 100%; justify-content: space-between; }
  .select { max-width: 62vw; }
  .chips-row { gap: 6px; }
  .chip-btn {
    max-width: 100%;
    height: auto;
    min-height: 32px;
    padding: 7px 12px;
    white-space: normal;
    text-align: left;
    line-height: 1.25;
  }
  .chip { white-space: normal; word-break: break-word; }
  .prod-card, .prod-body, .prod-specs { min-width: 0; }
  .panel-row { gap: 12px; }
  .panel-row b { text-align: right; }
  .modal { padding: 12px; }
  .modal-head { padding: 22px 20px 18px; }
  .modal-body { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
