:root {
  --ink: #172033;
  --muted: #687284;
  --line: #dde4ee;
  --panel: #ffffff;
  --soft: #f4f7fb;
  --blue: #0f5fb8;
  --blue-dark: #083f7f;
  --red: #cf2530;
  --green: #16875a;
  --shadow: 0 18px 45px rgba(23, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #f7f9fc;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px clamp(16px, 4vw, 56px);
  color: #ffffff;
  background: #172033;
  font-size: 13px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 74px;
  padding: 0 clamp(16px, 4vw, 56px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.eyebrow,
.finder-panel p,
.footer span {
  color: var(--muted);
}

.nav-links {
  display: flex;
  gap: 24px;
  font-weight: 700;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-button,
.account-button,
.primary-button,
.secondary-button,
.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
}

.cart-button {
  gap: 10px;
  padding: 0 16px;
  color: #ffffff;
  background: var(--ink);
}

.account-button {
  padding: 0 16px;
  color: var(--blue);
  background: #ffffff;
  border: 1px solid #bdd8f6;
}

.cart-button strong {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  color: var(--ink);
  background: #ffffff;
  border-radius: 50%;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  min-height: calc(100vh - 110px);
  padding: clamp(28px, 5vw, 72px) clamp(16px, 4vw, 56px);
  overflow: hidden;
}

.hero-copy {
  max-width: 690px;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 13px;
  font-weight: 900;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 20px;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.12;
}

h3 {
  font-size: 20px;
}

.hero-copy p:not(.eyebrow) {
  max-width: 620px;
  color: var(--muted);
  font-size: 19px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.primary-link,
.primary-button {
  padding: 0 20px;
  color: #ffffff;
  background: var(--blue);
}

.primary-link:hover,
.primary-button:hover {
  background: var(--blue-dark);
}

.secondary-link,
.secondary-button {
  padding: 0 20px;
  color: var(--blue);
  background: #e8f2ff;
}

.hero-media {
  position: relative;
  min-height: 420px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero-media img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
}

.finder,
.visual-categories,
.catalog,
.products-section,
.support {
  padding: 64px clamp(16px, 4vw, 56px);
}

.section-heading,
.products-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.finder-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
}

.finder-panel,
.product-card,
.support,
.modal-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(23, 32, 51, 0.07);
}

.finder-panel {
  padding: 24px;
}

label {
  display: grid;
  gap: 8px;
  color: #354056;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  padding: 0 12px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #cfd8e5;
  border-radius: 6px;
}

input,
select {
  min-height: 46px;
}

textarea {
  padding-top: 12px;
  resize: vertical;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 16px 0;
}

.vehicle-result {
  margin: 16px 0 0;
  padding: 12px;
  background: var(--soft);
  border-radius: 6px;
}

.search-panel {
  display: grid;
  align-content: start;
  gap: 16px;
}

.visual-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.visual-category {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(23, 32, 51, 0.07);
}

.visual-category h3 {
  margin-bottom: 0;
}

.visual-category p {
  color: var(--muted);
}

.category-photo {
  position: relative;
  min-height: 150px;
  overflow: hidden;
  background-color: #eef5ff;
  background-position: center;
  background-size: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.engine-photo {
  background-image: url("assets/category-engine.png");
}

.lamps-photo {
  background-image: url("assets/category-lamps.png");
}

.wheels-photo {
  background-image: url("assets/category-wheels.png");
}

.brakes-photo {
  background-image: url("assets/category-brakes.png");
}

.body-photo {
  background-image: url("assets/category-body.png");
}

.interior-photo {
  background-image: url("assets/category-interior.png");
}

.category-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
}

.subcategory-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.subcategory-tabs[hidden] {
  display: none;
}

.subcategory-tab {
  min-height: 38px;
  padding: 0 14px;
  color: #354056;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
}

.subcategory-tab.active {
  color: #ffffff;
  background: var(--blue);
  border-color: var(--blue);
}

.category-tab {
  min-height: 82px;
  padding: 14px;
  text-align: left;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.category-tab strong,
.category-tab span {
  display: block;
}

.category-tab span {
  color: var(--muted);
  font-size: 13px;
}

.category-tab.active {
  color: #ffffff;
  background: var(--blue);
  border-color: var(--blue);
}

.category-tab.active span {
  color: #dbeeff;
}

.sort-box {
  display: grid;
  min-width: 210px;
  gap: 6px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.product-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.part-visual {
  display: grid;
  height: 126px;
  place-items: center;
  color: var(--blue);
  background: linear-gradient(145deg, #eef5ff, #ffffff);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 42px;
  font-weight: 900;
}

.product-card h3 {
  margin-bottom: 2px;
}

.part-number {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.stock-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #354056;
  font-size: 14px;
  font-weight: 800;
}

.channel-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.channel-badge {
  padding: 4px 8px;
  color: #354056;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.compatibility {
  color: #354056;
  font-size: 14px;
}

.product-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.price {
  font-size: 21px;
  font-weight: 900;
}

.small-button {
  min-height: 38px;
  padding: 0 12px;
  color: #ffffff;
  background: var(--ink);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
}

.ghost-button {
  min-height: 38px;
  padding: 0 12px;
  color: var(--blue);
  background: transparent;
  border: 1px solid #bdd8f6;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
}

.empty-state {
  padding: 22px;
  color: var(--muted);
  background: #ffffff;
  border: 1px dashed #b9c7d8;
  border-radius: 8px;
}

.support {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 24px clamp(16px, 4vw, 56px) 64px;
}

.cart-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 40;
  display: flex;
  width: min(430px, 100vw);
  padding: 20px;
  flex-direction: column;
  background: #ffffff;
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translateX(100%);
  transition: transform 180ms ease;
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-head,
.cart-summary,
.cart-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-head button,
.modal-close {
  width: 38px;
  height: 38px;
  background: var(--soft);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 24px;
}

.cart-items {
  display: grid;
  gap: 12px;
  margin: 14px 0;
  overflow: auto;
}

.cart-line {
  padding: 12px;
  background: var(--soft);
  border-radius: 6px;
}

.cart-line small {
  display: block;
  color: var(--muted);
}

.cart-summary {
  margin-top: auto;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  font-size: 20px;
}

.checkout-form,
.account-form {
  display: grid;
  gap: 12px;
}

.checkout-form {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.logout-button {
  width: 100%;
  margin-top: 12px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 32, 51, 0.45);
}

.modal[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  width: min(620px, 100%);
  padding: 28px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.spec-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin: 20px 0;
}

.spec-list dt {
  color: var(--muted);
  font-weight: 800;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 26px clamp(16px, 4vw, 56px);
  color: #ffffff;
  background: var(--ink);
}

.admin-page {
  background: #f3f6fb;
}

.admin-hero,
.admin-layout,
.warehouse-section {
  margin: 0 clamp(16px, 4vw, 56px);
}

.admin-hero {
  padding: 56px 0 28px;
}

.admin-hero h1 {
  max-width: 960px;
  font-size: clamp(36px, 5vw, 64px);
}

.admin-hero p:not(.eyebrow) {
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
  align-items: start;
}

.admin-card {
  padding: 24px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(23, 32, 51, 0.07);
}

.platform-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.platform-picker legend {
  padding: 0 8px;
  color: #354056;
  font-weight: 900;
}

.platform-picker label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.platform-picker input {
  width: auto;
  min-height: auto;
}

.platform-status,
.warehouse-list {
  display: grid;
  gap: 12px;
}

.integration-item,
.warehouse-row {
  padding: 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.integration-item strong,
.integration-item span,
.warehouse-row strong,
.warehouse-row span {
  display: block;
}

.integration-item span,
.warehouse-row span {
  color: var(--muted);
  font-size: 14px;
}

.warehouse-section {
  margin-top: 24px;
  margin-bottom: 64px;
}

.warehouse-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(160px, 0.5fr) minmax(220px, 0.8fr);
  gap: 14px;
}

@media (max-width: 980px) {
  .nav {
    flex-wrap: wrap;
    padding-block: 12px;
  }

  .nav-links {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }

  .nav-actions {
    margin-left: auto;
  }

  .hero,
  .finder-grid,
  .admin-layout,
  .warehouse-row {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .category-tabs,
  .product-grid,
  .visual-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .topbar,
  .section-heading,
  .products-head,
  .support,
  .footer,
  .field-row {
    display: grid;
  }

  .topbar {
    gap: 4px;
  }

  .hero-media,
  .hero-media img {
    min-height: 270px;
  }

  .category-tabs,
  .product-grid,
  .visual-category-grid {
    grid-template-columns: 1fr;
  }

  .sort-box {
    min-width: 0;
  }
}
