:root {
  --ink: #122433;
  --ink-soft: #294250;
  --muted: #6d7f89;
  --line: #dce6e9;
  --line-strong: #c7d7dc;
  --bg: #f4f7f8;
  --card: #fff;
  --accent: #ff6436;
  --accent-dark: #e94b20;
  --teal: #087f82;
  --teal-dark: #07666a;
  --teal-soft: #eaf6f5;
  --success: #167653;
  --shadow: 0 18px 50px rgba(18, 36, 51, .10);
  --shadow-soft: 0 10px 28px rgba(18, 36, 51, .07);
  --radius: 20px;
}

body {
  background: #fff;
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.container { width: min(1320px, calc(100% - 48px)); }

.header {
  position: sticky;
  top: 0;
  z-index: 80;
  box-shadow: 0 1px 0 rgba(18, 36, 51, .08), 0 8px 30px rgba(18, 36, 51, .035);
}

.header__main { padding-top: 16px; padding-bottom: 16px; }
.logo__mark { border-radius: 15px; box-shadow: 0 9px 24px rgba(255, 100, 54, .24); }
.search { border-color: #cad8dc; background: #f8fafb; transition: .2s ease; }
.search:focus-within { border-color: var(--teal); background: #fff; box-shadow: 0 0 0 4px rgba(8, 127, 130, .10); }
.search button { display: inline-flex; align-items: center; gap: 8px; background: var(--ink); }
.search button:hover { background: var(--teal-dark); }
.header-action { gap: 3px; color: var(--ink-soft); }
.header-action > span { display: grid; width: 32px; height: 28px; place-items: center; }
.header-action:hover { color: var(--teal); }
.main-nav { height: 48px; }
.main-nav .catalog-button { border-radius: 11px 11px 0 0; }

.button {
  border-radius: 11px;
  box-shadow: 0 8px 20px rgba(255, 100, 54, .14);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.button:hover { transform: translateY(-1px); box-shadow: 0 11px 26px rgba(255, 100, 54, .20); }
.button--ghost { border: 1px solid var(--line); background: #fff; box-shadow: none; }
.button--ghost:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); box-shadow: none; }

.page-hero {
  padding: 48px 0 52px;
  background:
    radial-gradient(circle at 86% 20%, rgba(96, 208, 202, .22), transparent 28%),
    linear-gradient(120deg, #102735 0%, #16485a 58%, #0b7475 100%);
}
.page-hero h1 { max-width: 980px; margin-bottom: 14px; font-size: clamp(36px, 5vw, 58px); }
.page-hero p { max-width: 760px; margin-bottom: 0; font-size: 16px; }
.breadcrumbs { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section { padding-top: 58px; padding-bottom: 64px; }
.section-head { gap: 24px; margin-bottom: 24px; }
.section-head h2 { font-size: clamp(27px, 3vw, 36px); }
.eyebrow { color: var(--accent); }

/* Visual vehicle and category picker */
.vehicle-visual-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.vehicle-visual-grid--makes { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.vehicle-visual-grid--categories { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.vehicle-visual-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 230px;
  overflow: hidden;
  grid-template-rows: 148px 1fr;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 7px 22px rgba(18, 36, 51, .045);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.vehicle-visual-card:hover {
  border-color: #85bcc0;
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}
.vehicle-visual-card__media {
  position: relative;
  display: grid;
  min-width: 0;
  place-items: center;
  overflow: hidden;
  padding: 18px;
  background: linear-gradient(145deg, #f8fbfb, #edf4f5);
}
.vehicle-visual-card__media img { width: 100%; height: 100%; object-fit: contain; transition: transform .25s ease; }
.vehicle-visual-card:hover .vehicle-visual-card__media img { transform: scale(1.035); }
.vehicle-visual-card__media b {
  position: absolute;
  right: 12px;
  bottom: 10px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 11px;
  color: #fff;
  background: rgba(18, 36, 51, .78);
  font-size: 11px;
  letter-spacing: .05em;
  backdrop-filter: blur(8px);
}
.vehicle-visual-card__body { display: flex; min-width: 0; padding: 17px 42px 18px 18px; flex-direction: column; justify-content: center; }
.vehicle-visual-card__body strong { overflow: hidden; font-size: 17px; line-height: 1.25; text-overflow: ellipsis; }
.vehicle-visual-card__body small { margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.vehicle-visual-card__arrow { position: absolute; right: 17px; bottom: 23px; color: var(--teal); font-size: 22px; transition: transform .2s ease; }
.vehicle-visual-card:hover .vehicle-visual-card__arrow { transform: translateX(4px); }
.vehicle-visual-card--make { min-height: 190px; grid-template-rows: 112px 1fr; }
.vehicle-visual-card--make .vehicle-visual-card__media { padding: 22px; }
.vehicle-visual-card--category { min-height: 250px; grid-template-rows: 168px 1fr; }
.parts-groups > [data-part-group] { min-width: 0; }
.parts-groups > [data-part-group][hidden] { display: none; }

/* Vehicle category tree with real section imagery */
.cars-parts-tree { gap: 18px; }
.cars-parts-tree__level--0 > li { border-radius: 18px; box-shadow: var(--shadow-soft); }
.cars-parts-tree__level--0 > li > details > summary { min-height: 76px; background: linear-gradient(105deg, #f4f9f9, #eef6f6); }
.cars-tree-item { display: flex; min-width: 0; align-items: center; gap: 13px; }
.cars-tree-item > span:last-child { min-width: 0; }
.cars-tree-item__image { display: grid; width: 54px; height: 44px; flex: 0 0 54px; overflow: hidden; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.cars-tree-item__image img { width: 100%; height: 100%; object-fit: contain; }
.cars-parts-tree__level--2 .cars-tree-item__image { width: 42px; height: 36px; flex-basis: 42px; }

/* Product results: image-led cards instead of rows */
.cars-category-summary { border: 0; border-radius: 16px; background: var(--teal-soft); }
.cars-category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.cars-part-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 440px;
  overflow: hidden;
  padding: 0;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(18, 36, 51, .05);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.cars-part-card:hover { border-color: #9ac4c7; box-shadow: var(--shadow); transform: translateY(-3px); }
.cars-part-card__photo {
  position: relative;
  display: grid;
  width: 100%;
  height: 220px;
  flex: 0 0 220px;
  min-width: 0;
  min-height: 0;
  place-items: center;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  overflow: hidden;
  padding: 20px;
  box-sizing: border-box;
  background: linear-gradient(145deg, #fafcfc, #f1f6f7);
}
.cars-part-card__photo img {
  display: block;
  width: min(100%, 300px);
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  place-self: center;
  object-fit: contain;
  object-position: center;
  mix-blend-mode: multiply;
}
.cars-part-card__photo.is-disabled { pointer-events: none; }
.cars-part-card__badge {
  position: absolute;
  top: 13px;
  left: 13px;
  padding: 6px 9px;
  border-radius: 999px;
  color: #087451;
  background: #e6f8f0;
  font-size: 10px;
  font-weight: 800;
}
.cars-part-card__body { display: flex; min-width: 0; padding: 18px 18px 12px; flex: 1; flex-direction: column; }
.cars-part-card__code { justify-content: space-between; gap: 8px; text-transform: none; }
.cars-part-card__code strong { overflow: hidden; color: var(--teal); font-size: 12px; letter-spacing: .045em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.cars-part-card__code code { padding: 4px 7px; border-radius: 7px; color: var(--ink-soft); background: #eef3f4; font-family: inherit; font-size: 11px; font-weight: 800; }
.cars-part-card h3 { display: -webkit-box; min-height: 46px; overflow: hidden; margin: 12px 0 0; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 16px; line-height: 1.4; }
.cars-part-card h3 a:hover { color: var(--teal); }
.cars-part-card__fitment { width: max-content; max-width: 100%; margin-top: 10px; padding: 5px 8px; border-radius: 999px; color: #45606b; background: #f0f5f6; font-size: 10px; }
.cars-part-card__crosses { margin-top: auto; padding-top: 12px; }
.cars-part-card__crosses summary { font-size: 11px; }
.cars-part-card__crosses > div { max-height: 86px; overflow: auto; }
.cars-part-card__price { display: block; width: 100%; padding: 14px 18px 18px; border-top: 1px solid #edf1f2; background: #fbfcfc; }
.cars-part-card__price > a { align-items: flex-start; text-align: left; }
.cars-part-card__price small { margin: 0; font-size: 10px; }
.cars-part-card__price strong { margin: 4px 0 8px; color: var(--ink); font-size: 22px; }
.cars-part-card__price [data-category-price-availability] { display: flex; width: 100%; align-items: center; justify-content: space-between; color: var(--success); font-size: 12px; }
.cars-part-card__price [data-category-price-availability] b { font-size: 18px; }

/* Product page */
.product-page { align-items: start; gap: 52px; }
.product-gallery { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(145deg, #fbfcfc, #edf4f5); }
.product-info h1 { font-size: clamp(30px, 4vw, 46px); }
.buy-box { border: 1px solid var(--line); border-radius: 18px; background: #f7fafb; }
.product-card { border-radius: 18px; box-shadow: 0 7px 22px rgba(18, 36, 51, .045); }

.footer { background: #0d202c; }

@media (max-width: 1120px) {
  .vehicle-visual-grid--makes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .vehicle-visual-grid, .vehicle-visual-grid--categories { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cars-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .container { width: min(100% - 28px, 1320px); }
  .header { position: relative; }
  .section { padding-top: 42px; padding-bottom: 48px; }
  .vehicle-visual-grid--makes, .vehicle-visual-grid, .vehicle-visual-grid--categories { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vehicle-visual-card { min-height: 200px; grid-template-rows: 122px 1fr; }
  .vehicle-visual-card--category { min-height: 220px; grid-template-rows: 142px 1fr; }
  .cars-parts-tree__level--2 { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .container { width: min(100% - 22px, 1320px); }
  .page-hero { padding: 32px 0 35px; }
  .page-hero h1 { font-size: 32px; line-height: 1.08; }
  .page-hero p { font-size: 14px; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .vehicle-visual-grid--makes, .vehicle-visual-grid, .vehicle-visual-grid--categories { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .vehicle-visual-card, .vehicle-visual-card--make, .vehicle-visual-card--category { min-height: 164px; grid-template-rows: 98px 1fr; border-radius: 14px; }
  .vehicle-visual-card__media { padding: 12px; }
  .vehicle-visual-card__body { padding: 12px 28px 13px 12px; }
  .vehicle-visual-card__body strong { font-size: 14px; }
  .vehicle-visual-card__body small { margin-top: 4px; font-size: 10px; }
  .vehicle-visual-card__arrow { right: 11px; bottom: 16px; font-size: 17px; }
  .vehicle-visual-card__media b { display: none; }
  .cars-category-grid { grid-template-columns: 1fr; gap: 13px; }
  .cars-part-card { min-height: 0; border-radius: 16px; }
  .cars-part-card__photo { height: 210px; flex-basis: 210px; }
  .cars-part-card__body { padding: 15px 15px 11px; }
  .cars-part-card__price { padding: 13px 15px 16px; }
  .cars-part-card__price strong { font-size: 21px; }
  .cars-tree-item__image { width: 46px; height: 40px; flex-basis: 46px; }
}
