:root {
  color-scheme: light;
  --ink: #111111;
  --muted: #5f6563;
  --line: #ded5cb;
  --paper: #fff8ec;
  --panel: #fffdf8;
  --white: #ffffff;
  --red: #d90808;
  --red-dark: #8d0808;
  --orange: #ff7a00;
  --amber: #ffc52e;
  --grass: #2f7d32;
  --charcoal: #161616;
  --deep: #101211;
  --shadow: 0 20px 54px rgba(17, 17, 17, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, rgba(217, 8, 8, 0.08), rgba(255, 248, 236, 0) 460px),
    var(--paper);
  color: var(--ink);
}

body.drawer-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 12px clamp(18px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(17, 17, 17, 0.12);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--white);
  background: linear-gradient(135deg, var(--red), var(--orange));
  border-radius: 6px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.05;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2vw, 28px);
  color: var(--charcoal);
  font-size: 0.95rem;
}

.main-nav a {
  padding: 8px 2px;
  border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  border-color: var(--red);
}

.icon-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 42px;
  color: var(--ink);
  background: var(--white);
  border: 2px solid var(--charcoal);
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 850;
}

.cart-count {
  position: absolute;
  right: -7px;
  top: -7px;
  display: grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  color: var(--white);
  background: var(--red);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.storefront {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(380px, 1.1fr);
  gap: clamp(30px, 5vw, 76px);
  align-items: center;
  min-height: min(780px, calc(100vh - 72px));
  padding: clamp(34px, 5vw, 76px) clamp(18px, 5vw, 70px) 34px;
}

.storefront-copy {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1;
  letter-spacing: 0;
}

h1 {
  display: grid;
  gap: 0.04em;
  max-width: 100%;
  font-size: clamp(3rem, 6vw, 5.7rem);
  text-transform: uppercase;
  text-shadow: 0 3px 0 rgba(217, 8, 8, 0.1);
}

h1 span {
  display: block;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.6rem);
}

p {
  line-height: 1.65;
}

.storefront-copy > p:not(.eyebrow) {
  max-width: 650px;
  color: #3d3d3d;
  font-size: 1.13rem;
}

.part-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  max-width: 680px;
  margin: 28px 0 18px;
  padding: 8px;
  background: var(--white);
  border: 2px solid var(--charcoal);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(17, 17, 17, 0.12);
}

.part-search input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  outline: 0;
}

.part-search button,
.fitment-form button,
.checkout-button {
  min-height: 48px;
  padding: 0 18px;
  color: var(--white);
  background: linear-gradient(180deg, var(--red), var(--red-dark));
  border: 1px solid var(--red-dark);
  border-radius: 8px;
  font-weight: 800;
}

.part-search button:hover,
.fitment-form button:hover,
.checkout-button:hover {
  background: linear-gradient(180deg, #f20d0d, #720606);
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trust-strip span {
  padding: 8px 10px;
  background: #fff1df;
  border: 1px solid rgba(217, 8, 8, 0.28);
  border-radius: 6px;
  color: var(--charcoal);
  font-size: 0.88rem;
}

.hero-media {
  position: relative;
  min-height: 570px;
  overflow: hidden;
  border: 1px solid rgba(17, 17, 17, 0.18);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(135deg, rgba(217, 8, 8, 0.18), rgba(255, 122, 0, 0.08) 36%, transparent 64%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.34), transparent 50%);
  pointer-events: none;
}

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

.quote-panel {
  z-index: 2;
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: min(280px, calc(100% - 36px));
  padding: 18px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(17, 17, 17, 0.2);
  border-radius: 6px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}

.quote-panel span,
.quote-panel small {
  display: block;
  color: var(--muted);
}

.quote-panel strong {
  display: block;
  margin: 5px 0;
  font-size: 2.2rem;
  color: var(--red);
}

.category-showcase {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 0 clamp(18px, 5vw, 70px) 22px;
}

.category-showcase button {
  appearance: none;
  border: 0;
  position: relative;
  min-height: 170px;
  padding: 0;
  overflow: hidden;
  border-radius: 8px;
  background: var(--charcoal);
  box-shadow: 0 10px 28px rgba(17, 17, 17, 0.1);
  cursor: pointer;
  text-align: left;
}

.category-showcase button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 20%, rgba(0, 0, 0, 0.72));
}

.category-showcase img {
  width: 100%;
  height: 100%;
  min-height: 170px;
  object-fit: cover;
  transition: transform 220ms ease;
}

.category-showcase button:hover img,
.category-showcase button:focus-visible img {
  transform: scale(1.04);
}

.category-showcase button:focus-visible {
  outline: 4px solid var(--orange);
  outline-offset: 3px;
}

.category-showcase button.active {
  box-shadow: 0 0 0 4px var(--red), 0 16px 34px rgba(17, 17, 17, 0.16);
}

.category-showcase span {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  z-index: 1;
  color: var(--white);
  font-weight: 900;
}

.controls-band {
  display: flex;
  align-items: end;
  gap: 14px;
  padding: 18px clamp(18px, 5vw, 70px);
  background: var(--deep);
  color: var(--white);
  border-block: 4px solid var(--red);
}

.control-group {
  display: grid;
  gap: 7px;
  min-width: 160px;
}

.control-group.grow {
  flex: 1;
}

.control-group label {
  color: #fff3df;
  font-size: 0.82rem;
  font-weight: 700;
}

.control-group small {
  min-height: 16px;
  color: #ffe8d1;
  font-size: 0.75rem;
}

.control-group select,
.control-group input {
  min-height: 42px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid #819189;
  border-radius: 8px;
}

.control-group select {
  padding: 0 12px;
}

.section-shell,
.workflow-grid,
.admin-panel {
  padding: clamp(48px, 7vw, 92px) clamp(18px, 5vw, 70px);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 0.7fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 24px;
}

#catalog {
  background: var(--panel);
}

.section-heading p:last-child,
.workflow-grid > div > p,
.admin-panel > div > p {
  color: #4e514f;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.tab {
  min-height: 40px;
  padding: 0 14px;
  color: var(--ink);
  background: transparent;
  background: var(--white);
  border: 2px solid var(--charcoal);
  border-radius: 6px;
  font-weight: 750;
}

.tab.active,
.tab:hover {
  color: var(--white);
  background: var(--red);
  border-color: var(--red);
}

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

.product-card {
  display: grid;
  grid-template-rows: 210px auto;
  overflow: hidden;
  background: var(--white);
  border: 1px solid rgba(17, 17, 17, 0.16);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(17, 17, 17, 0.08);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 42px rgba(17, 17, 17, 0.13);
}

.product-card img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  background: #f3e4d2;
}

.product-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #47524d;
  font-size: 0.82rem;
  font-weight: 800;
}

.product-card h3 {
  margin: 0;
  min-height: 52px;
  font-size: 1.08rem;
  line-height: 1.35;
}

.product-card p {
  min-height: 48px;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.sku-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  background: #fff6e7;
  border: 1px solid #efd9c0;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.sku-line strong {
  color: var(--charcoal);
  font-size: 0.86rem;
}

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

.price-row strong {
  font-size: 1.2rem;
  color: var(--red);
}

.price-row button {
  min-height: 38px;
  padding: 0 12px;
  color: var(--white);
  background: var(--charcoal);
  border: 1px solid var(--charcoal);
  border-radius: 6px;
  font-weight: 800;
}

.workflow-grid,
.admin-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 0.9fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: start;
  background:
    linear-gradient(180deg, rgba(47, 125, 50, 0.08), rgba(255, 255, 255, 0)),
    #fffdf8;
}

.fitment-form {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: var(--white);
  border: 1px solid rgba(17, 17, 17, 0.18);
  border-radius: 8px;
  box-shadow: 0 10px 32px rgba(23, 33, 29, 0.08);
}

.fitment-form label {
  display: grid;
  gap: 7px;
  color: #3d4b45;
  font-weight: 750;
}

.fitment-form input,
.fitment-form select {
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.shipping-matrix article,
.admin-board > div {
  padding: 18px;
  background: var(--white);
  border: 1px solid rgba(17, 17, 17, 0.16);
  border-radius: 8px;
}

.shipping-matrix span,
.admin-board small {
  display: block;
  color: var(--red);
  font-weight: 800;
}

.shipping-matrix strong,
.admin-board strong {
  display: block;
  margin: 8px 0;
  font-size: 1.7rem;
}

.shipping-matrix p {
  margin-bottom: 0;
  color: var(--muted);
}

.admin-panel {
  background:
    linear-gradient(135deg, rgba(217, 8, 8, 0.38), rgba(255, 122, 0, 0.16) 42%, transparent),
    var(--deep);
  color: var(--white);
}

.admin-panel p,
.admin-panel .eyebrow {
  color: #ffe8d1;
}

.admin-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-board > div {
  background: #ffffff;
  border-color: var(--orange);
  color: var(--charcoal);
}

.admin-board small {
  color: var(--red);
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  width: min(420px, 100vw);
  height: 100dvh;
  padding: 18px;
  background: var(--white);
  border-left: 6px solid var(--red);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.18);
  transform: translateX(105%);
  transition: transform 180ms ease;
}

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

.drawer-header,
.drawer-total,
.cart-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.drawer-header {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.cart-items {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding: 16px 0;
}

.cart-line {
  padding: 12px;
  background: #fff7ea;
  border-radius: 8px;
}

.cart-line span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.drawer-total {
  padding: 16px 0;
  border-top: 1px solid var(--line);
  font-size: 1.1rem;
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  background: rgba(0, 0, 0, 0);
  transition: background 180ms ease;
}

.scrim.open {
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.32);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(18px, 5vw, 70px);
  color: #fff5e8;
  background: #111815;
  border-top: 5px solid var(--orange);
}

.site-footer p {
  max-width: 760px;
  margin: 0;
}

.site-footer a {
  color: var(--amber);
  font-weight: 800;
}

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

@media (max-width: 1080px) {
  .storefront,
  .section-heading,
  .workflow-grid,
  .admin-panel {
    grid-template-columns: 1fr;
  }

  .storefront {
    min-height: auto;
  }

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

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

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

@media (max-width: 760px) {
  .site-header {
    align-items: start;
    flex-wrap: wrap;
  }

  .main-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .storefront {
    padding-top: 30px;
  }

  h1 {
    font-size: 3.35rem;
  }

  .part-search,
  .controls-band,
  .shipping-matrix,
  .admin-board,
  .category-showcase {
    grid-template-columns: 1fr;
  }

  .controls-band {
    display: grid;
    align-items: stretch;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    display: grid;
  }
}

@media (max-width: 390px) {
  .brand {
    min-width: 0;
  }

  .brand strong {
    max-width: 118px;
  }

  h1 {
    font-size: 3rem;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
