/* =============================================================================
   KALDWIN TECH — components.css
   Layer 2/4: buttons, cards, trust bar, FAQ accordion, CTA bar, forms,
   tables, tags, RFQ basket, floating tools, notices.
   All components are markup-driven (no JS required to render content).
   ============================================================================= */

/* --- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 44px;                 /* touch target ≥ 44px (§10.1-C) */
  padding: .65rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--c-primary); color: var(--c-white); border-color: var(--c-primary); }
.btn--primary:hover { background: var(--c-primary-dark); color: var(--c-white); border-color: var(--c-primary-dark); }
.btn--secondary { background: var(--c-white); color: var(--c-primary-dark); border-color: var(--c-border-strong); }
.btn--secondary:hover { background: var(--c-primary-soft); color: var(--c-primary-dark); border-color: var(--c-primary); }
.btn--outline { background: transparent; color: var(--c-white); border-color: rgba(241,245,241,.72); }
.btn--outline:hover { background: rgba(241,245,241,.14); color: var(--c-white); }
.btn--light { background: var(--c-white); color: var(--c-primary-dark); border-color: var(--c-white); }
.btn--light:hover { background: var(--c-primary-soft); color: var(--c-primary-dark); }
.btn--ghost { background: transparent; color: var(--c-primary-dark); border-color: transparent; text-decoration: underline; }
.btn--sm { min-height: 44px; padding: .5rem .9rem; font-size: var(--fs-sm); }
.btn--block { display: flex; width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }

/* --- Generic card -------------------------------------------------------- */
.card {
  display: flex;
  flex-direction: column;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--c-border-strong); }
.card__body { padding: var(--sp-5); }
.card__title { font-size: var(--fs-md); margin-bottom: var(--sp-2); }
.card__title a { color: var(--c-ink); }
.card__text { color: var(--c-body); font-size: var(--fs-sm); margin-bottom: var(--sp-4); }

/* --- Product card (partials/product-card.html) --------------------------- */
.product-card__media {
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--c-bg-tint);
  border-bottom: 1px solid var(--c-border);
  overflow: hidden;
}
.product-card__media img { width: 100%; height: 100%; object-fit: cover; }
.product-card__body { padding: var(--sp-5); display: flex; flex-direction: column; flex: 1; }
.product-card__title { font-size: var(--fs-md); margin-bottom: var(--sp-2); }
.product-card__title a { color: var(--c-ink); }
.product-card__summary { font-size: var(--fs-sm); color: var(--c-body); margin-bottom: var(--sp-4); }
.product-card__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: auto; }

/* --- Category / application cards --------------------------------------- */
.category-card__media, .application-card__media {
  aspect-ratio: 16 / 9;
  background: var(--c-primary-soft);
  overflow: hidden;
}
.category-card__media img, .application-card__media img { width: 100%; height: 100%; object-fit: cover; }
.link-arrow { font-weight: 700; font-size: var(--fs-sm); }
.link-arrow::after { content: " \2192"; }

/* --- Tags ---------------------------------------------------------------- */
.tag-list { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.tag {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 999px;
  background: var(--c-primary-soft);
  color: var(--c-primary-dark);
  font-size: var(--fs-xs);
  font-weight: 600;
  border: 1px solid var(--c-border);
}
.tag--neutral { background: var(--c-bg-soft); color: var(--c-body); }

/* --- Trust bar (partials/trust-bar.html) --------------------------------- */
.trust-bar { background: var(--c-bg-tint); border-block: 1px solid var(--c-border); }
.trust-bar__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
  padding-block: var(--sp-5);
}
.trust-item { display: flex; align-items: flex-start; gap: var(--sp-3); min-width: 0; }
.trust-item__icon {
  flex: 0 0 36px; width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  color: var(--c-primary);
}
.trust-item__icon svg { width: 20px; height: 20px; }
.trust-item__label { font-size: var(--fs-sm); font-weight: 700; color: var(--c-ink); line-height: 1.3; }
.trust-item__note { font-size: var(--fs-xs); color: var(--c-body); }
@media (min-width: 768px) { .trust-bar__grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (min-width: 1024px) { .trust-bar__grid { grid-template-columns: repeat(6, minmax(0,1fr)); } }

/* --- FAQ accordion (native <details>, works without JS) ----------------- */
.faq-list { display: grid; gap: var(--sp-3); }
.faq-item {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.faq-item[open] { border-color: var(--c-border-strong); box-shadow: var(--shadow-sm); }
.faq-item > summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  min-height: 48px; padding: var(--sp-4) var(--sp-5);
  cursor: pointer; list-style: none;
  color: var(--c-ink); font-weight: 700; font-size: var(--fs-md);
}
/* GEO revision (skill 3.2): the question is carried by <h3>. Keep the native
   <details>/<summary> accordion while letting the heading inherit the summary
   styling, so the visible question keeps its semantic heading without a
   second, conflicting set of font / margin rules. */
.faq-item > summary > h3 { margin: 0; font: inherit; letter-spacing: inherit; color: inherit; }
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after {
  content: "+"; flex: 0 0 auto;
  width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 50%; background: var(--c-primary-soft); color: var(--c-primary-dark);
  font-size: 1.15rem; line-height: 1;
}
.faq-item[open] > summary::after { content: "\2212"; }
.faq-answer { padding: 0 var(--sp-5) var(--sp-5); border-top: 1px solid var(--c-border); padding-top: var(--sp-4); }
.faq-answer p:last-child { margin-bottom: 0; }
.faq-item:target { border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-soft); }

/* --- Full-width CTA bar (partials/cta-bar.html) ------------------------- */
.cta-bar { background: var(--c-primary-dark); color: var(--brand-soft); padding-block: var(--sp-7); }
.cta-bar__inner { display: flex; flex-direction: column; gap: var(--sp-5); align-items: flex-start; }
.cta-bar__title { color: var(--c-white); font-size: var(--fs-xl); margin: 0; }
.cta-bar__text { margin: var(--sp-2) 0 0; color: rgba(241,245,241,.88); font-size: var(--fs-md); }
.cta-bar__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
@media (min-width: 1024px) {
  .cta-bar__inner { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* --- Forms (partials/inquiry-form.html) --------------------------------- */
.form-card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-5);
}
.form-card__title { font-size: var(--fs-lg); margin-bottom: var(--sp-2); }
.form-card__intro { font-size: var(--fs-sm); color: var(--c-body); }
.form-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-4); }
@media (min-width: 768px) { .form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.field { display: flex; flex-direction: column; gap: var(--sp-2); }
.field--full { grid-column: 1 / -1; }
.field > label, .fieldset-label {
  font-size: var(--fs-sm); font-weight: 700; color: var(--c-ink);
}
.field .req { color: var(--c-danger); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 44px;
  padding: .65rem .8rem;
  font: inherit; font-size: var(--fs-sm);
  color: var(--c-ink);
  background: var(--c-white);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-sm);
}
.field textarea { min-height: 130px; resize: vertical; }
.field select[multiple] { min-height: 118px; }
.field input::placeholder, .field textarea::placeholder { color: var(--c-body); opacity: .55; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--c-primary); }
.field-hint { font-size: var(--fs-xs); color: var(--c-body); }
.field-error { color: var(--c-danger); font-size: var(--fs-xs); font-weight: 700; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"],
.field select[aria-invalid="true"] { border-color: var(--c-danger); background: var(--c-danger-soft); }

fieldset { border: 0; margin: 0; padding: 0; }
.fieldset-label { display: block; margin-bottom: var(--sp-3); }
.checkbox-group { display: grid; grid-template-columns: 1fr; gap: var(--sp-2) var(--sp-4); }
@media (min-width: 768px) { .checkbox-group { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.checkbox-item { display: flex; align-items: flex-start; gap: var(--sp-2); min-height: 44px; font-size: var(--fs-sm); }
.checkbox-item input { width: 20px; height: 20px; min-height: 20px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--c-primary); }
.checkbox-item label { cursor: pointer; }
.form-actions { margin-top: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); }
.form-status { min-height: 1.5rem; font-size: var(--fs-sm); font-weight: 700; }
.form-status[data-state="error"] { color: var(--c-danger); }
.form-status[data-state="ok"] { color: var(--c-primary); }
.honeypot { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: var(--fs-xs); color: var(--c-body); margin-top: var(--sp-3); }

/* --- Tables (spec / documents) ------------------------------------------ */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--c-border); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); min-width: 560px; }
caption { text-align: left; padding: var(--sp-3) var(--sp-4); font-size: var(--fs-xs); color: var(--c-body); background: var(--c-bg-soft); }
th, td { padding: .8rem 1rem; border-bottom: 1px solid var(--c-border); text-align: left; vertical-align: top; }
thead th { background: var(--c-primary-soft); color: var(--c-primary-dark); font-weight: 700; white-space: nowrap; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tbody th { width: 32%; color: var(--c-ink); font-weight: 700; }
.table-note { font-size: var(--fs-xs); color: var(--c-body); margin-top: var(--sp-3); }

/* --- Doc rows / notice / disclaimer ------------------------------------- */
.doc-list { display: grid; gap: var(--sp-3); }
.doc-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--sp-3); padding: var(--sp-4);
  background: var(--c-white); border: 1px solid var(--c-border); border-radius: var(--radius-sm);
}
.doc-row__name { font-weight: 700; color: var(--c-ink); }
.doc-row__desc { font-size: var(--fs-sm); color: var(--c-body); }
.callout {
  padding: var(--sp-5); border-radius: var(--radius);
  background: var(--brand-soft); border: 1px solid var(--brand-line);
  border-left: 2px solid var(--brand-forest);
  font-size: var(--fs-sm); color: var(--brand-ink);
}
.callout strong { color: var(--brand-ink); }
.callout p:last-child { margin-bottom: 0; }
.disclaimer {
  padding: var(--sp-4) var(--sp-5);
  background: var(--c-bg-soft); border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-primary);
  font-size: var(--fs-sm); color: var(--c-body);
}
.disclaimer p:last-child { margin-bottom: 0; }
.notice-strip { font-size: var(--fs-xs); color: var(--c-body); }

/* --- Filter bar ---------------------------------------------------------- */
.filter-bar {
  display: grid; grid-template-columns: 1fr; gap: var(--sp-3);
  padding: var(--sp-4); margin-bottom: var(--sp-6);
  background: var(--c-bg-soft); border: 1px solid var(--c-border); border-radius: var(--radius);
}
.filter-bar .field { gap: var(--sp-1); }
@media (min-width: 768px) { .filter-bar { grid-template-columns: repeat(3, minmax(0,1fr)); } }
.filter-empty { padding: var(--sp-6); text-align: center; color: var(--c-body); }

/* --- RFQ checkbox + sticky basket --------------------------------------- */
.rfq-check { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 44px; font-size: var(--fs-sm); font-weight: 700; color: var(--c-primary-dark); }
.rfq-check input { width: 20px; height: 20px; accent-color: var(--c-primary); }
.rfq-basket {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--c-primary-dark); color: var(--c-white);
  border-top: 2px solid var(--brand-leaf);
  box-shadow: 0 -8px 24px rgba(0,0,0,.18);
  padding: var(--sp-3) var(--sp-4);
}
.rfq-basket[hidden] { display: none; }
.rfq-basket__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.rfq-basket__count { font-weight: 700; font-size: var(--fs-sm); }
.rfq-basket__names { font-size: var(--fs-xs); color: var(--brand-soft); }

/* --- Floating quick-contact tools --------------------------------------- */
.floating-tools { position: fixed; right: var(--sp-4); bottom: var(--sp-4); z-index: 55; display: grid; gap: var(--sp-2); justify-items: end; }
.floating-btn {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  min-height: 44px; padding: .6rem 1rem;
  background: var(--c-white); color: var(--c-primary-dark);
  border: 1px solid var(--c-border-strong); border-radius: 999px;
  box-shadow: var(--shadow-md); font: inherit; font-size: var(--fs-sm); font-weight: 700;
  cursor: pointer;
}
.floating-btn--primary { background: var(--c-primary); color: var(--c-white); border-color: var(--c-primary); }
.floating-btn:hover { border-color: var(--c-primary); }
.floating-btn svg { width: 18px; height: 18px; }
.floating-panel {
  max-width: 280px; padding: var(--sp-4);
  background: var(--c-white); border: 1px solid var(--c-border-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  font-size: var(--fs-sm); color: var(--c-body);
}
.floating-panel[hidden] { display: none; }
@media (min-width: 1024px) { .floating-tools { right: var(--sp-6); bottom: var(--sp-6); } }

/* --- Product gallery / PDP sidebar -------------------------------------- */
.pdp-gallery__main { border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; background: var(--c-bg-tint); }
.pdp-gallery__main img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.pdp-gallery__thumbs { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); }
.pdp-gallery__thumbs img { width: 76px; height: 76px; object-fit: cover; border: 1px solid var(--c-border); border-radius: var(--radius-sm); }
.inquiry-sidebar {
  background: var(--c-white); border: 1px solid var(--c-border);
  border-radius: var(--radius); box-shadow: var(--shadow-md); padding: var(--sp-5);
}
.inquiry-sidebar__lead { font-size: var(--fs-sm); color: var(--c-body); }
.inquiry-sidebar .btn { margin-bottom: var(--sp-3); }
.inquiry-sidebar__meta { font-size: var(--fs-xs); color: var(--c-body); border-top: 1px solid var(--c-border); padding-top: var(--sp-4); margin-top: var(--sp-2); }
.inquiry-sidebar__meta p { margin-bottom: var(--sp-2); }
.side-list { list-style: none; padding: 0; margin: 0 0 var(--sp-4); }
.side-list li { padding: .5rem 0; border-bottom: 1px solid var(--c-border); font-size: var(--fs-sm); display: flex; justify-content: space-between; gap: var(--sp-3); }
.side-list li:last-child { border-bottom: 0; }
.pdp-mobile-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 58;
  display: flex; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4);
  background: var(--c-white); border-top: 1px solid var(--c-border);
  box-shadow: 0 -6px 20px rgba(0,0,0,.10);
}
.pdp-mobile-bar .btn { flex: 1; }

/* --- RFQ item rows ------------------------------------------------------- */
.rfq-item {
  display: grid; gap: var(--sp-3); padding: var(--sp-4);
  border: 1px solid var(--c-border); border-radius: var(--radius-sm); background: var(--c-white);
  margin-bottom: var(--sp-3);
}
.rfq-item__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.rfq-item__name { font-weight: 700; color: var(--c-ink); }
@media (min-width: 768px) { .rfq-item { grid-template-columns: 2fr 1fr 1fr auto; align-items: end; } }

/* --- Blog / article ------------------------------------------------------ */
.post-card__media { aspect-ratio: 16 / 9; background: var(--c-primary-soft); overflow: hidden; }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; }
.post-meta { font-size: var(--fs-xs); color: var(--c-body); }
.tldr { padding: var(--sp-5); background: var(--c-primary-soft); border-left: 4px solid var(--c-primary); border-radius: var(--radius-sm); margin-bottom: var(--sp-6); }
.tldr p:last-child { margin-bottom: 0; }
.toc { padding: var(--sp-5); background: var(--c-bg-soft); border: 1px solid var(--c-border); border-radius: var(--radius); margin-bottom: var(--sp-6); }
.toc ol { margin-bottom: 0; }
.article-body h2 { margin-top: var(--sp-7); }
.article-body h3 { margin-top: var(--sp-6); }
.article-body ul { color: var(--c-body); }

/* --- Back to top --------------------------------------------------------- */
.back-to-top {
  position: fixed; left: var(--sp-4); bottom: var(--sp-4); z-index: 50;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--c-white); color: var(--c-primary-dark);
  border: 1px solid var(--c-border-strong); box-shadow: var(--shadow-md);
  cursor: pointer; font-size: 1.1rem;
}
.back-to-top[hidden] { display: none; }
