/* ==========================================================================
   MOLZA B-MOLD™ Global Flagship Site — Design System & Tokens (v12)
   Moodboard C+A: Kyoto/Mino Washi Tactile Luxury × Swiss Precision Engineering
   ========================================================================== */

:root {
  /* 1. Color Tokens (60% Washi Warm White / 30% Pulp Surface / 10% Gifu Forest & Gold Leaf Copper) */
  --bg: #FCFAF6;
  --surface: #F2EFE9;
  --surface-elevated: #FFFFFF;
  --line: #DCD6CC;
  --line-strong: #B8B0A4;

  --ink: #111614;
  --muted: #333A36;

  --brand: #14382E;
  --brand-soft: #E6EFEA;
  --accent: #A85D24;
  --accent-hover: #8C4B1B;
  --ok: #0D6832;
  --ok-bg: #E8F5EE;
  --warn: #9A4B0A;
  --danger: #A61C1C;
  --danger-bg: #FCE8E6;

  /* 2. Multilingual Typography Stack (EN / FR / JA) */
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", "PingFang SC", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  /* 3. Spacing Scale */
  --sp-0: 0;
  --sp-25: 2px;
  --sp-50: 4px;
  --sp-75: 8px;
  --sp-100: 12px;
  --sp-200: 16px;
  --sp-300: 24px;
  --sp-400: 32px;
  --sp-500: 40px;
  --sp-600: 48px;
  --sp-700: 64px;
  --sp-800: 80px;
  --sp-900: 96px;

  /* 4. Border Radius & Warm Shadows */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-2xl: 24px;
  --shadow-sm: 0 2px 6px rgba(20, 56, 46, 0.05);
  --shadow-md: 0 8px 24px rgba(20, 56, 46, 0.08);

  /* 5. Motion Tokens */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 150ms;
  --dur-base: 240ms;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 26px;
  -webkit-text-size-adjust: 100%;
  max-width: 100%;
  overflow-x: clip;
}

body {
  margin: var(--sp-0);
  background-color: var(--bg);
  color: var(--ink);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  max-width: 100%;
  overflow-x: clip;
  overflow-wrap: break-word;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color var(--dur-fast) var(--ease-out);
}

a:hover {
  color: var(--accent);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
.table-wrapper:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ==========================================================================
   Named Typography Styles (Strict Scale: 12, 14, 16, 18, 20, 24, 30, 36, 48, 60)
   Zero Italics, Max Weight 600/700
   ========================================================================== */

.heading-1 {
  font-size: 48px;
  line-height: 52px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: var(--sp-0) var(--sp-0) var(--sp-300);
}

.heading-2 {
  font-size: 36px;
  line-height: 40px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: var(--sp-0) var(--sp-0) var(--sp-200);
}

.heading-3 {
  font-size: 30px;
  line-height: 36px;
  font-weight: 600;
  color: var(--ink);
  margin: var(--sp-0) var(--sp-0) var(--sp-200);
}

.heading-4 {
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  color: var(--ink);
  margin: var(--sp-0) var(--sp-0) var(--sp-100);
}

.title-1 {
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  color: var(--ink);
  margin: var(--sp-0) var(--sp-0) var(--sp-75);
}

.title-2 {
  font-size: 18px;
  line-height: 28px;
  font-weight: 500;
  color: var(--ink);
  margin: var(--sp-0) var(--sp-0) var(--sp-75);
}

.title-3 {
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  color: var(--ink);
}

.body-1 {
  font-size: 18px;
  line-height: 30px;
  font-weight: 400;
  color: var(--muted);
  margin: var(--sp-0) var(--sp-0) var(--sp-300);
}

.body-2 {
  font-size: 16px;
  line-height: 26px;
  font-weight: 400;
  color: var(--ink);
  margin: var(--sp-0) var(--sp-0) var(--sp-200);
}

.body-3 {
  font-size: 14px;
  line-height: 22px;
  font-weight: 400;
  color: var(--muted);
}

.caption-1 {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--muted);
}

.caption-2 {
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  color: var(--muted);
}

.mono-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
  .heading-1 { font-size: 36px; line-height: 40px; }
  .heading-2 { font-size: 30px; line-height: 36px; }
  .heading-3 { font-size: 24px; line-height: 32px; }
  .heading-4 { font-size: 20px; line-height: 28px; }
  .body-1 { font-size: 16px; line-height: 26px; }
}
/* ==========================================================================
   Layout, Grid, Header & Navigation
   ========================================================================== */

.container {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: var(--sp-300);
}

@media (max-width: 640px) {
  .container {
    padding-inline: var(--sp-200);
  }
}

.section {
  padding-block: var(--sp-800);
  border-bottom: 1px solid var(--line);
}

.section-surface {
  background-color: var(--surface);
}

@media (max-width: 768px) {
  .section {
    padding-block: var(--sp-600);
  }
}

.top-bar {
  background-color: var(--brand);
  color: #FFFFFF;
  font-size: 13px;
  line-height: 18px;
  padding-block: 6px;
}

.top-bar-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 12px;
}

.top-bar-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.lang-switcher {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.top-bar a {
  color: #FFFFFF;
  text-decoration: none;
  padding: 2px 7px;
  font-size: 12px;
  line-height: 16px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.top-bar a.active-lang,
.top-bar a:hover {
  background-color: #FFFFFF;
  color: var(--brand);
}

.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 40;
  background-color: var(--bg);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 64px;
  gap: 10px;
  flex-wrap: nowrap;
  padding-block: 8px;
}

.brand-logo {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
  flex: 0 1 auto;
}

.brand-logo-main {
  font-size: 18px;
  line-height: 22px;
  font-weight: 600;
  color: var(--brand);
  letter-spacing: -0.01em;
}

.brand-logo-sub {
  font-size: 11.5px;
  line-height: 15px;
  color: var(--muted);
  white-space: normal;
  overflow-wrap: anywhere;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  order: 3;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background-color: var(--surface-elevated);
  color: var(--brand);
  border: 1px solid var(--brand);
  border-radius: var(--r-md);
  padding: 6px 10px;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  min-height: 36px;
  cursor: pointer;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px;
  order: 2;
  min-width: 0;
}

.main-nav a {
  text-decoration: none;
  color: var(--ink);
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  padding: 5px 7px;
  border-radius: var(--r-sm);
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .top-bar-specs {
    display: none;
  }
  .header-inner {
    flex-wrap: wrap;
    min-height: 54px;
    padding-block: 6px;
  }
  .brand-logo {
    flex: 1 1 160px;
  }
  .brand-logo-sub {
    display: none;
  }
  .header-actions {
    order: 2;
  }
  .header-cta {
    padding: 6px 10px !important;
    font-size: 12.5px !important;
    min-height: 36px !important;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .main-nav {
    display: none;
    order: 3;
    width: 100%;
    padding-top: 8px;
    margin-top: 4px;
    border-top: 1px solid var(--line);
    justify-content: flex-start;
    gap: 6px;
  }
  .main-nav.is-open {
    display: flex;
  }
  .main-nav a {
    background-color: var(--surface);
    border: 1px solid var(--line);
    padding: 6px 10px;
    font-size: 13px;
  }
}

@media (max-width: 640px) {
  .top-bar-origin {
    font-size: 11.5px;
    line-height: 15px;
    flex: 1 1 200px;
  }
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  background-color: var(--brand-soft);
  color: var(--brand);
}

/* ==========================================================================
   Buttons & 6 Interactive States (Default, Hover, Focus, Active, Disabled, Loading)
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-75);
  text-decoration: none;
  border-radius: var(--r-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}

.button-md {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  padding: var(--sp-100) var(--sp-300);
  min-height: 48px;
}

.button-sm {
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  padding: var(--sp-75) var(--sp-200);
  min-height: 40px;
}

.btn-primary {
  background-color: var(--accent);
  color: #FFFFFF;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  color: #FFFFFF;
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-secondary {
  background-color: var(--surface-elevated);
  color: var(--brand);
  border-color: var(--brand);
}

.btn-secondary:hover {
  background-color: var(--brand-soft);
  color: var(--brand);
}

.btn:disabled,
.btn[aria-disabled="true"],
.btn.is-loading {
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
}

/* ==========================================================================
   Hero, Grids, Cards & Badges
   ========================================================================== */

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--sp-600);
  align-items: center;
}

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-400);
  }
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-75);
  margin-bottom: var(--sp-200);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-50);
  background-color: var(--brand-soft);
  color: var(--brand);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  padding: var(--sp-50) var(--sp-100);
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
}

.badge-ok {
  background-color: var(--ok-bg);
  color: var(--ok);
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-200);
  margin-block: var(--sp-300);
}

.proof-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-200);
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-200);
  margin-top: var(--sp-300);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: var(--sp-300);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: var(--sp-400);
}

@media (max-width: 640px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
}

.card {
  background-color: var(--surface-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-300);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  margin-bottom: var(--sp-200);
  background-color: var(--surface);
}
/* ==========================================================================
   Modern Web Guidance: Responsive Data Tables (@container + Sticky Headers)
   Guide ID: responsive-table
   ========================================================================== */

.table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  max-block-size: min(640px, 82vh);
  container-type: inline-size;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background-color: var(--surface-elevated);
  margin-block: var(--sp-300);
}

table.spec-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  line-height: 22px;
  font-variant-numeric: tabular-nums;
}

table.spec-table caption {
  text-align: left;
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  padding: var(--sp-200);
  background-color: var(--surface);
  border-bottom: 1px solid var(--line-strong);
  color: var(--ink);
}

table.spec-table thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
}

table.spec-table th,
table.spec-table td {
  padding: var(--sp-100) var(--sp-200);
  text-align: left;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  vertical-align: top;
}

table.spec-table thead th {
  background-color: var(--surface);
  color: var(--ink);
  font-weight: 600;
  border-bottom: 2px solid var(--line-strong);
}

table.spec-table tbody th {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  background-color: var(--surface-elevated);
  font-weight: 600;
  color: var(--brand);
}

@container (width < 600px) {
  table.spec-table,
  table.spec-table caption,
  table.spec-table thead,
  table.spec-table tbody,
  table.spec-table tr,
  table.spec-table th,
  table.spec-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  table.spec-table thead {
    /* MANDATORY: Hide column header from layout and screen readers on narrow containers */
    display: none;
  }

  table.spec-table tr {
    margin-block-end: var(--sp-200);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
  }

  table.spec-table tbody th {
    position: sticky;
    inset-block-start: 0;
    z-index: 2;
    background-color: var(--brand-soft);
    border-bottom: 1px solid var(--line-strong);
  }

  table.spec-table td:nth-child(2)::before {
    content: var(--label-2, "Spec 1") ": ";
    font-weight: 600;
    color: var(--ink);
  }
  table.spec-table td:nth-child(3)::before {
    content: var(--label-3, "Spec 2") ": ";
    font-weight: 600;
    color: var(--ink);
  }
  table.spec-table td:nth-child(4)::before {
    content: var(--label-4, "Spec 3") ": ";
    font-weight: 600;
    color: var(--ink);
  }
  table.spec-table td:nth-child(5)::before {
    content: var(--label-5, "Spec 4") ": ";
    font-weight: 600;
    color: var(--ink);
  }
  table.spec-table td:nth-child(6)::before {
    content: var(--label-6, "Spec 5") ": ";
    font-weight: 600;
    color: var(--ink);
  }
}

/* ==========================================================================
   Modern Web Guidance: Validate Input After Interaction (:user-invalid)
   Guide ID: validate-input-after-interaction
   ========================================================================== */

.rfq-card {
  background-color: var(--surface-elevated);
  border: 2px solid var(--brand);
  border-radius: var(--r-xl);
  padding: var(--sp-400);
  box-shadow: var(--shadow-md);
}

@media (max-width: 640px) {
  .rfq-card {
    padding: var(--sp-300);
  }
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-200);
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.field {
  margin-bottom: var(--sp-200);
}

.field label {
  display: block;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--sp-25);
}

/* MANDATORY: Place format hints above the input so autocomplete popovers don't cover them */
.field .hint {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
  margin-bottom: var(--sp-50);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 24px;
  color: var(--ink);
  background-color: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: var(--sp-100) var(--sp-200);
  min-height: 48px;
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.error-msg {
  display: none;
  color: var(--danger);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  margin-top: var(--sp-50);
}

/* DO: Only show error styles after user interaction (:user-invalid + fallback) */
.field input:user-invalid,
.field textarea:user-invalid,
.field input.user-invalid-fallback,
.field textarea.user-invalid-fallback {
  border-color: var(--danger);
  background-color: var(--danger-bg);
}

.field input:user-invalid + .error-msg,
.field textarea:user-invalid + .error-msg,
.field input.user-invalid-fallback + .error-msg,
.field textarea.user-invalid-fallback + .error-msg {
  display: block;
}

.field input:user-valid,
.field textarea:user-valid,
.field input.user-valid-fallback,
.field textarea.user-valid-fallback {
  border-color: var(--ok);
}

.field:has(input:user-invalid) .hint,
.field:has(textarea:user-invalid) .hint {
  color: var(--danger);
  font-weight: 600;
}

.hp-wrap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ==========================================================================
   FAQ Details, Footer, Cookie Consent & Mobile Bottom Bar
   ========================================================================== */

details.faq-item {
  background-color: var(--surface-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--sp-200) var(--sp-300);
  margin-bottom: var(--sp-100);
}

details.faq-item summary {
  cursor: pointer;
  font-size: 18px;
  line-height: 28px;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-200);
}

details.faq-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--brand);
}

details.faq-item[open] summary::after {
  content: "−";
}

details.faq-item .faq-body {
  margin-top: var(--sp-100);
  padding-top: var(--sp-100);
  border-top: 1px solid var(--line);
  color: var(--ink);
}

.site-footer {
  background-color: var(--surface);
  border-top: 2px solid var(--line-strong);
  padding-block: var(--sp-700) var(--sp-800);
  color: var(--ink);
}

.button-xs {
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  padding: 5px 10px;
  min-height: 30px;
}

.rfq-fallback-box {
  background-color: #FFF8EB;
  border: 2px solid var(--accent);
  border-radius: var(--r-md);
  padding: 14px 16px;
}

.cookie-banner {
  position: fixed;
  inset-block-end: 10px;
  inset-inline-start: 12px;
  inset-inline-end: 12px;
  max-width: 920px;
  margin-inline: auto;
  background-color: var(--surface-elevated);
  border: 1px solid var(--brand);
  border-radius: var(--r-md);
  padding: 8px 14px;
  box-shadow: var(--shadow-md);
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.cookie-banner-text {
  font-size: 12.5px;
  line-height: 17px;
  color: var(--ink);
  flex: 1 1 240px;
}

.cookie-banner-btns {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.cookie-banner.is-visible {
  display: flex;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-100);
  margin-bottom: var(--sp-300);
}

.filter-tab {
  background-color: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: var(--sp-75) var(--sp-200);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  cursor: pointer;
}

.filter-tab.is-active,
.filter-tab:hover {
  background-color: var(--brand);
  color: #FFFFFF;
  border-color: var(--brand);
}
