/* ==========================================================================
   Shangpinwu storefront — design tokens, resets, base typography.
   Sportswear B2B trading company — energetic orange + dark base.
   ========================================================================== */

:root {
  /* Color palette — Energetic Sport Orange + Dark Base (sportswear B2B). */
  --color-bg: #fafafa;
  --color-bg-elev: #f3f4f6;
  --color-bg-inverse: #0d1117;
  --color-surface: #ffffff;
  --color-surface-translucent: rgba(255, 255, 255, 0.7);
  --color-surface-glass: rgba(255, 255, 255, 0.12);
  --color-border: rgba(26, 26, 46, 0.08);
  --color-border-strong: rgba(26, 26, 46, 0.16);
  --color-text: #1a1a2e;
  --color-text-soft: #374151;
  --color-text-muted: #9ca3af;
  --color-text-on-dark: #f9fafb;
  --color-text-on-dark-soft: #d1d5db;
  --color-text-on-dark-muted: rgba(249, 250, 251, 0.78);
  /* Glass surfaces (frosted dividers/fills on dark panels). */
  --color-glass-line: rgba(255, 255, 255, 0.12);
  --color-glass-fill: rgba(255, 255, 255, 0.04);
  --color-accent: #ff4d00;
  --color-accent-soft: #ff8c42;
  --color-accent-deep: #cc3d00;
  --color-accent-contrast: #ffffff;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #dc2626;
  --color-info: #2563eb;

  /* Brand gradient stops used in hero / cta. */
  --gradient-hero: linear-gradient(135deg, #0d1117 0%, #1a1a2e 55%, #0d1117 100%);
  --gradient-cta: linear-gradient(120deg, #ff4d00 0%, #cc3d00 100%);
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.4));

  /* Typography. */
  --font-sans: "Source Sans 3", "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: "Lexend", "Source Sans 3", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-serif: "Playfair Display", "Source Serif Pro", "Noto Serif SC", "Songti SC", Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;

  --fs-xs: 0.75rem;     /* 12 */
  --fs-sm: 0.875rem;    /* 14 */
  --fs-base: 1rem;      /* 16 */
  --fs-md: 1.125rem;    /* 18 */
  --fs-lg: 1.375rem;    /* 22 */
  --fs-xl: 1.75rem;     /* 28 */
  --fs-2xl: 2.25rem;    /* 36 */
  --fs-3xl: 3rem;       /* 48 */
  --fs-4xl: 4rem;       /* 64 */
  --fs-5xl: 5.25rem;    /* 84 */

  --lh-tight: 1.15;
  --lh-snug: 1.35;
  --lh-base: 1.6;

  /* Spacing scale. */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;

  /* Radii. */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  /* Shadows. */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
  --shadow-xl: 0 40px 80px rgba(15, 23, 42, 0.18);
  --shadow-glow: 0 20px 50px rgba(255, 77, 0, 0.25);

  /* Motion. */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 160ms;
  --duration-base: 280ms;
  --duration-slow: 520ms;

  /* Layout. */
  --container-max: 1280px;
  --container-gutter: clamp(1.5rem, 5vw, 5rem);
  --header-h: 84px;
  --header-h-condensed: 64px;
  --z-header: 80;
  --z-drawer: 100;
  --z-lightbox: 120;
  --z-toast: 140;
}

/* ---------- Reset (compact, modern) ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
}
ul, ol { padding: 0; list-style: none; }
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 4px;
}
::selection { background: var(--color-accent-soft); color: var(--color-accent-deep); }

/* ---------- Base typography ---------- */
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: var(--lh-tight); color: var(--color-text); }
h1 { font-size: var(--fs-3xl); letter-spacing: -0.02em; }
h2 { font-size: var(--fs-2xl); letter-spacing: -0.015em; }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }
p  { line-height: var(--lh-base); color: var(--color-text-soft); }
a  { transition: color var(--duration-fast) var(--ease-out); }
a:hover { color: var(--color-accent-deep); }

/* Round standalone content images, but skip images that live inside a
   card/media wrapper which already clips its own corners — otherwise a
   "rounded inside rounded" artifact appears. :where() keeps specificity 0. */
img:where(:not(.product-card__media img, .certs__card img, .cert-frame__mat img, .feature__icon img, .profile__link-icon img, .category-feature__media img, .factory-gallery img, .qv-drawer__media img)) { border-radius: var(--radius-md); }

::placeholder { color: var(--color-text-muted); }

/* ---------- Layout primitives ---------- */
.container,
body.kd-shell-body .container { width: 100%; max-width: calc(var(--container-max) + (var(--container-gutter) * 2)); margin-inline: auto; padding-inline: var(--container-gutter); }
.section { padding-block: clamp(3rem, 8vw, 6rem); position: relative; }
.section--tight { padding-block: clamp(2rem, 5vw, 3.5rem); }
.section--inverse { background: var(--color-bg-inverse); color: var(--color-text-on-dark); }
.section--inverse h1, .section--inverse h2, .section--inverse h3, .section--inverse h4 { color: var(--color-text-on-dark); }
.section--inverse p { color: var(--color-text-on-dark-soft); }

.grid { display: grid; gap: var(--space-5); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* Eyebrow / section title. */
.eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent-deep);
  margin-bottom: var(--space-3);
}
.section-title {
  font-size: clamp(1.75rem, 3.2vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
}
.section-subtitle {
  font-size: var(--fs-md);
  color: var(--color-text-soft);
  max-width: 60ch;
  margin: 0 auto;
}
.section-head { text-align: center; margin-bottom: var(--space-7); }

/* Section divider (replaces elementor-divider markup). */
.kd-divider {
  display: flex; align-items: center; gap: var(--space-4);
  margin-block: var(--space-6);
}
.kd-divider::before, .kd-divider::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border-strong), transparent);
}
.kd-divider__label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-lg);
  color: var(--color-text-soft);
  letter-spacing: 0.02em;
}

/* Scroll-reveal animation. */
[data-reveal] { opacity: 0; transform: translate3d(0, 24px, 0); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); }
[data-reveal].is-visible { opacity: 1; transform: none; }
[data-reveal-delay="1"] { transition-delay: 80ms; }
[data-reveal-delay="2"] { transition-delay: 160ms; }
[data-reveal-delay="3"] { transition-delay: 240ms; }
[data-reveal-delay="4"] { transition-delay: 320ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
  [data-reveal] { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* Skip link. */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--color-accent); color: #fff;
  padding: var(--space-3) var(--space-4);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  z-index: var(--z-toast);
}
.skip-link:focus { left: var(--space-4); top: var(--space-3); color: #fff; }

/* Screen reader only. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Generic visually-hidden focusable. */
.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Shell layout. */
.kd-shell { display: flex; flex-direction: column; min-height: 100vh; }
.kd-shell > main { flex: 1; }
