/* Shared chrome for every page — visual language mirrors cswautoparts.com:
   white surfaces, DM Sans, black type, #F9BB1D yellow accent, pill search,
   black footer. Page-specific styles live in each page's own <style>. */
:root {
  --bg: #ffffff;
  --bg-soft: #fafbfd;
  --text: #000000;
  --text-soft: #313131;
  --muted: #7f7f7f;
  --line: #e9e9e9;
  --pill: #eeeeee;
  --accent: #f9bb1d;
  --accent-fg: #ffffff;
  --footer-bg: #000000;
  --header-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  --container: 1140px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "DM Sans", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 25px;
  border: none;
  border-radius: 5px;
  background: var(--accent);
  color: var(--accent-fg);
  font-family: inherit;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease;
}
.btn:hover, .btn:focus-visible { color: var(--text); }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Pill search (header, hero, sidebar) */
.pill-search { position: relative; width: 100%; }
.pill-search svg {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 19px;
  height: 19px;
  pointer-events: none;
}
.pill-search input {
  width: 100%;
  height: 54px;
  padding: 0 22px 0 50px;
  border: none;
  border-radius: 100px;
  font-family: inherit;
  font-size: 16px;
  background: var(--pill);
  color: var(--text);
  outline: none;
  transition: box-shadow 0.15s ease;
}
.pill-search input::placeholder { color: var(--muted); font-weight: 300; }
.pill-search input:focus { box-shadow: 0 0 0 2px var(--accent); }

/* Live search suggestions (navbar + homepage hero). The dropdown is injected
   by search-suggest.js into the .pill-search wrapper and shows up to 7
   matches plus a "see all results" row. */
.search-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 70;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
}
.search-suggest[hidden] { display: none; }
.search-suggest-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: #fff;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.search-suggest-item:last-of-type { border-bottom: none; }
.search-suggest-item.active { background: #fff7df; }
.search-suggest-thumb {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--pill);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-suggest-thumb img { width: 100%; height: 100%; object-fit: cover; }
.search-suggest-thumb.none {
  background: var(--pill) url("/public/site/csw-logo.png") center/60% no-repeat;
  opacity: 0.7;
}
.search-suggest-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.search-suggest-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.search-suggest-code { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-suggest-more {
  display: block;
  padding: 12px 14px;
  background: var(--text);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
}
.search-suggest-more:hover, .search-suggest-more.active { background: #222; }
.search-suggest-empty { padding: 14px; font-size: 14px; color: var(--muted); text-align: center; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  box-shadow: var(--header-shadow);
}
.site-header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 15px 50px;
}
.site-logo img { height: 46px; width: auto; }
.site-nav { display: flex; gap: 36px; }
.site-nav a {
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  transition: color 0.15s ease;
}
.site-nav a:hover, .site-nav a.active { color: var(--accent); }
.site-tools { justify-self: end; display: flex; align-items: center; gap: 14px; min-width: 0; }
.site-header .pill-search { width: 236px; }

/* Account */
.account { position: relative; flex-shrink: 0; }
.account-login { font-size: 15px; font-weight: 600; text-decoration: none; color: var(--text); white-space: nowrap; }
.account-login:hover { color: var(--accent); }
.account-btn {
  display: flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 10px 0 5px;
  border: 1px solid var(--line); border-radius: 100px;
  background: #fff; font-family: inherit; font-size: 14px; font-weight: 600; color: var(--text);
  cursor: pointer;
}
.account-btn:hover { border-color: var(--text); }
.account-btn .chev { width: 16px; height: 16px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--text); font-weight: 700;
}
.account-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  width: 260px; padding: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
}
.account-who { display: flex; flex-direction: column; gap: 2px; padding: 10px 10px 12px; font-size: 13px; color: var(--muted); }
.account-who b { font-size: 15px; color: var(--text); }
.account-who .role { margin-top: 6px; align-self: flex-start; padding: 2px 8px; border-radius: 100px; background: var(--pill); color: var(--text); font-weight: 600; }
.account-note { margin: 0 2px 6px; padding: 10px; border-radius: 8px; background: #fff7df; font-size: 13px; line-height: 1.45; color: var(--text-soft); max-width: none; }
.account-item {
  display: block; width: 100%; padding: 10px; border: none; border-radius: 8px;
  background: none; font-family: inherit; font-size: 15px; color: var(--text); text-align: left; text-decoration: none; cursor: pointer;
}
.account-item:hover { background: var(--pill); }
.nav-toggle {
  display: none;
  justify-self: end;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  color: var(--text);
}
.nav-toggle svg { width: 24px; height: 24px; }

/* Footer */
.site-footer { background: var(--footer-bg); color: #fff; padding: 70px 0 60px; }
.site-footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 0.8fr 0.9fr 1.3fr;
  gap: 40px;
}
.site-footer .footer-logo { height: 46px; width: auto; margin-bottom: 18px; }
.site-footer p { margin: 0; font-size: 14px; line-height: 1.6; max-width: 340px; }
.site-footer h4 { margin: 8px 0 22px; font-size: 16px; font-weight: 600; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.site-footer li { font-size: 14px; line-height: 1.5; }
.site-footer li a { text-decoration: none; transition: color 0.15s ease; }
.site-footer li a:hover { color: var(--accent); }
.site-footer .contact-list li { display: flex; gap: 10px; align-items: flex-start; }
.site-footer .contact-list svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 3px; }

/* WhatsApp float */
.wa-float {
  position: fixed;
  right: 28px;
  bottom: 24px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.wa-float span {
  background: #fff;
  color: var(--text-soft);
  font-size: 15px;
  padding: 6px 14px;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}
.wa-float b {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #49e670;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
}
.wa-float svg { width: 30px; height: 30px; }

/* Photo banner used on About / Contact */
.page-hero {
  position: relative;
  min-height: clamp(420px, 70vh, 720px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  background: #111 center/cover no-repeat;
  padding: 60px 20px;
}
.page-hero::before { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); }
.page-hero > * { position: relative; }
.page-hero .eyebrow { font-size: 14px; letter-spacing: 0.02em; margin: 0 0 10px; }
.page-hero h1 { font-size: 64px; font-weight: 600; margin: 0; line-height: 1.1; }

@media (max-width: 1024px) {
  .site-header-inner { grid-template-columns: 1fr auto; padding: 14px 20px; row-gap: 12px; }
  .nav-toggle { display: block; order: 1; }
  .site-nav {
    display: none;
    order: 2;
    grid-column: 1 / -1;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--line);
  }
  .site-nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .site-header.nav-open .site-nav { display: flex; }
  .site-tools { grid-column: 1 / -1; order: 3; justify-self: stretch; }
  .site-header .pill-search { width: auto; flex: 1; }
  .account-name { display: none; }
  .site-header .pill-search input { height: 46px; font-size: 15px; }
  .site-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .site-logo img { height: 36px; }
  .site-footer { padding: 50px 0 90px; }
  .site-footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .page-hero h1 { font-size: 40px; }
  .wa-float { right: 16px; bottom: 16px; }
  .wa-float span { display: none; }
}
