:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #151719;
  --muted: #5d6670;
  --line: #d9dee3;
  --brand: #ffd21f;
  --brand-dark: #f2be00;
  --accent: #c9143d;
  --nav: #1c2025;
  --green: #11835f;
  --green-dark: #0b6248;
  --amber: #b67800;
  --red: #b93a32;
  --shadow: 0 24px 70px rgba(18, 22, 27, 0.13);
}

* {
  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, #ffffff 0, #f5f6f8 360px, #eef1f4 100%);
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: 220px;
  background: linear-gradient(#ffffff, rgba(255, 255, 255, 0));
  pointer-events: none;
  z-index: -1;
}

button,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 220px 214px minmax(280px, 1fr) auto;
  align-items: center;
  gap: 0;
  width: min(1220px, calc(100% - 24px));
  margin: 8px auto 0;
  padding: 0;
  background: var(--nav);
  border: 1px solid #0f1113;
  border-top: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(18, 22, 27, 0.16);
}

.brand {
  display: grid;
  align-self: stretch;
  min-width: 0;
  place-items: center start;
  padding: 7px 16px;
  background: var(--accent);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 6px;
  background: var(--brand);
  color: #111;
  font-weight: 900;
}

.brand-logo {
  display: grid;
  width: 166px;
  height: 34px;
  place-items: center;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.brand-logo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 32px;
  object-fit: contain;
}

.brand span:last-child {
  display: grid;
}

.brand strong {
  font-size: 1rem;
}

.brand small,
.status-strip small,
.eyebrow,
.section-head span,
.form-message {
  color: var(--muted);
}

.brand small {
  color: rgba(255, 255, 255, 0.78);
}

.vehicle-select {
  align-self: stretch;
  min-height: 50px;
  border: 0;
  border-left: 1px solid #0f1113;
  border-right: 1px solid #0f1113;
  border-radius: 0;
  background: var(--brand);
  color: #111;
  padding: 0 12px;
  font-size: 0.8rem;
  font-weight: 800;
  text-align: left;
}

.header-search {
  display: grid;
  grid-template-columns: 1fr 54px;
  align-items: center;
  align-self: stretch;
  min-height: 50px;
  background: #fff;
}

.header-search input {
  min-height: 50px;
  border: 0;
  border-radius: 0;
  background: #fff;
  padding: 0 14px;
  font-size: 0.88rem;
}

.header-search button {
  min-height: 50px;
  border-radius: 0;
  background: var(--brand);
  color: #111;
  padding: 0 10px;
  font-size: 0.82rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0;
  align-self: stretch;
  padding: 0;
  border-radius: 0;
  background: var(--nav);
}

.header-actions a {
  display: grid;
  place-items: center;
  align-self: stretch;
  min-height: 50px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  color: #fff;
  text-decoration: none;
  padding: 0 16px;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.header-actions a:hover {
  background: rgba(255, 255, 255, 0.1);
}

.header-actions .header-register {
  background: var(--brand);
  color: #111;
}

main {
  width: min(1220px, calc(100% - 24px));
  margin: 0 auto;
  padding-bottom: 64px;
}

.landing-hero {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  gap: clamp(20px, 4vw, 34px);
  min-height: clamp(430px, 58vh, 570px);
  margin-top: 22px;
  padding: clamp(30px, 6vw, 68px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.98) 0 53%, rgba(255, 210, 31, 0.76) 53% 72%, rgba(28, 32, 37, 0.54) 72%),
    url("https://images.unsplash.com/photo-1493238792000-8113da705763?auto=format&fit=crop&w=1800&q=82") center right / cover;
  box-shadow: var(--shadow);
}

.hero-content {
  display: grid;
  justify-items: center;
  max-width: 720px;
  text-align: center;
}

.hero-content .eyebrow,
.company-section .eyebrow,
.search-page-head .eyebrow {
  color: var(--accent);
}

.hero-content h1 {
  max-width: 720px;
  font-size: clamp(1.95rem, 4.2vw, 3.6rem);
  line-height: 1.02;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.hero-content p {
  max-width: 640px;
  color: var(--muted);
  font-size: clamp(0.96rem, 1.6vw, 1.08rem);
  line-height: 1.62;
}

.hero-panel {
  width: min(760px, 100%);
  display: grid;
  gap: 10px;
  padding: clamp(12px, 2.4vw, 18px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 52px rgba(18, 22, 27, 0.2);
}

.hero-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  width: 100%;
  padding: 0;
  border: 2px solid var(--nav);
  border-radius: 9px;
  background: #fff;
  box-shadow: none;
}

.hero-search input {
  min-height: 58px;
  border: 0;
  background: #fff;
  font-size: clamp(0.98rem, 1.8vw, 1.14rem);
}

.hero-search button {
  min-width: 150px;
  min-height: 58px;
  border-radius: 0 6px 6px 0;
  color: #111;
}

.hero-categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.hero-categories span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8f9fa;
  color: #30363b;
  font-size: 0.86rem;
  font-weight: 800;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 18px 0 34px;
}

.info-grid article {
  display: grid;
  gap: 8px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(18, 22, 27, 0.06);
}

.info-grid article:first-child {
  border-top: 4px solid var(--brand);
}

.info-grid article:nth-child(2) {
  border-top: 4px solid var(--accent);
}

.info-grid article:nth-child(3) {
  border-top: 4px solid var(--nav);
}

.info-grid strong {
  font-size: 1.03rem;
}

.info-grid span,
.company-section p {
  color: var(--muted);
  line-height: 1.65;
}

.company-section {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  gap: clamp(20px, 5vw, 64px);
  align-items: start;
  padding: 38px 0;
  border-top: 1px solid var(--line);
}

.search-page-head {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(360px, 1fr);
  gap: clamp(22px, 5vw, 54px);
  align-items: end;
  margin-top: 18px;
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(100deg, #fff 0 58%, rgba(255, 210, 31, 0.8) 58% 76%, rgba(31, 35, 39, 0.08) 76%),
    #fff;
  box-shadow: 0 16px 42px rgba(18, 22, 27, 0.08);
}

.search-page-head h1 {
  max-width: 660px;
  font-size: clamp(2rem, 4.2vw, 3.6rem);
}

.search-panel-wide {
  box-shadow: 0 14px 36px rgba(10, 20, 32, 0.1);
}

.search-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 0.8fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  min-height: clamp(430px, 62vh, 620px);
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.91) 46%, rgba(255, 255, 255, 0.16)),
    url("https://images.unsplash.com/photo-1503376780353-7e6692767b70?auto=format&fit=crop&w=1800&q=80") center right / cover;
  box-shadow: var(--shadow);
  padding: clamp(28px, 6vw, 72px);
}

.search-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(10, 20, 32, 0.08));
  pointer-events: none;
}

.search-copy {
  position: relative;
  z-index: 1;
  max-width: 540px;
  color: var(--ink);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.search-copy .eyebrow {
  color: var(--brand);
}

.search-copy p:last-child {
  max-width: 520px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.65;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2.3rem, 5vw, 4.8rem);
  line-height: 0.98;
  max-width: 520px;
}

h2 {
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  line-height: 1.08;
  margin-bottom: 8px;
}

.search-panel {
  position: relative;
  z-index: 2;
  width: 100%;
  margin-top: 0;
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid rgba(221, 228, 234, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 48px rgba(10, 20, 32, 0.16);
  backdrop-filter: blur(16px);
}

.search-panel label,
.admin-card label,
.settings-card label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.search-panel label {
  color: #2a323a;
  font-size: clamp(1rem, 2vw, 1.16rem);
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 11px;
}

input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--ink);
  padding: 0 15px;
  outline: none;
}

.search-row input {
  min-height: 58px;
  font-size: 1.08rem;
}

input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(255, 107, 44, 0.16);
}

button {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #111;
  font-weight: 900;
  padding: 0 20px;
  cursor: pointer;
}

button:hover {
  background: var(--brand-dark);
}

.search-row button {
  min-width: 132px;
  min-height: 58px;
}

.quick-codes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.quick-codes button {
  min-height: 36px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
  font-weight: 800;
  padding: 0 11px;
}

.quick-codes button:hover {
  color: var(--ink);
  background: #f4f6f8;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  margin: 18px 0 26px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--line);
}

.status-strip div {
  display: grid;
  gap: 3px;
  padding: 15px 18px;
  background: #fff;
}

.status-strip div:first-child {
  background: var(--nav);
  color: #fff;
}

.status-strip div:first-child small {
  color: rgba(255, 255, 255, 0.68);
}

.status-strip span {
  font-size: 1.34rem;
  font-weight: 900;
}

.results-section,
.admin-shell {
  margin-top: 28px;
}

.results-section-compact {
  margin-top: 24px;
}

.admin-page {
  padding-top: 34px;
}

.admin-page .admin-shell {
  margin-top: 0;
  border-top: 0;
}

.admin-page h1 {
  max-width: 680px;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.auth-page {
  display: grid;
  place-items: start center;
  min-height: calc(100vh - 82px);
  padding-top: clamp(34px, 8vw, 86px);
}

.auth-card {
  width: min(480px, 100%);
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 44px rgba(10, 20, 32, 0.1);
}

.auth-card h1 {
  font-size: clamp(1.9rem, 4vw, 3rem);
}

.plain-form {
  display: grid;
  gap: 14px;
}

.plain-form label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.results-list {
  display: grid;
  gap: 10px;
}

.result-card {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(92px, 0.6fr));
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(18, 22, 27, 0.05);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.result-card:hover {
  border-color: #c8ced5;
  box-shadow: 0 12px 30px rgba(18, 22, 27, 0.08);
  transform: translateY(-1px);
}

.result-actions {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.cart-add,
.cart-remove {
  min-height: 36px;
  border-radius: 7px;
  padding: 0 12px;
  font-size: 0.82rem;
}

.cart-remove {
  background: #eef1f4;
  color: var(--ink);
}

.cart-page {
  padding-top: 24px;
}

.cart-shell {
  padding: clamp(18px, 4vw, 30px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(18, 22, 27, 0.07);
}

.cart-list {
  display: grid;
  gap: 10px;
}

.cart-item {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(100px, 0.5fr) 80px minmax(100px, 0.5fr) auto;
  gap: 14px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
}

.cart-item strong,
.cart-item span {
  display: block;
  overflow-wrap: anywhere;
}

.cart-item span {
  color: var(--muted);
  font-size: 0.84rem;
}

.cart-empty {
  padding: 18px;
  border: 1px dashed #c8ced5;
  border-radius: 10px;
  color: var(--muted);
  background: #fbfcfd;
}

.cart-summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 16px;
}

.cart-summary strong {
  font-size: 1.4rem;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(12, 16, 20, 0.58);
}

.auth-modal.open {
  display: grid;
}

.auth-modal-card {
  width: min(420px, 100%);
  padding: 24px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.auth-modal-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.25rem;
}

.auth-modal-card p {
  color: var(--muted);
  line-height: 1.55;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.modal-actions a,
.modal-actions button {
  display: grid;
  min-height: 42px;
  place-items: center;
  border-radius: 8px;
  padding: 0 14px;
  text-decoration: none;
  font-weight: 900;
}

.modal-actions a {
  background: var(--brand);
  color: #111;
}

.modal-actions button {
  background: #eef1f4;
  color: var(--ink);
}

.result-main {
  min-width: 0;
}

.result-main strong,
.metric strong {
  display: block;
  overflow-wrap: anywhere;
}

.result-main span,
.metric span {
  color: var(--muted);
  font-size: 0.84rem;
}

.badge {
  justify-self: start;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 900;
}

.badge.in-stock {
  background: #e2f4ee;
  color: var(--green-dark);
}

.badge.order {
  background: #fff2d8;
  color: var(--amber);
}

.badge.error {
  background: #ffe2df;
  color: var(--red);
}

.loading-list {
  display: grid;
  gap: 10px;
}

.loading-list span {
  height: 76px;
  border-radius: 8px;
  background: linear-gradient(90deg, #e4ebf0, #f8fafb, #e4ebf0);
  background-size: 220% 100%;
  animation: shimmer 1s infinite linear;
}

.admin-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(300px, 540px);
  gap: 24px;
  align-items: start;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.admin-shell > div p {
  max-width: 680px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.admin-card,
.settings-card {
  display: grid;
  gap: 14px;
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 38px rgba(10, 20, 32, 0.08);
}

.settings-card {
  grid-column: 2;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.supplier-settings {
  display: grid;
  gap: 10px;
}

.supplier-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.supplier-row small {
  color: var(--muted);
}

.supplier-row input {
  width: 22px;
  min-height: 22px;
}

.hidden {
  display: none !important;
}

@keyframes shimmer {
  to {
    background-position: -220% 0;
  }
}

@media (max-width: 860px) {
  .topbar,
  .section-head {
    align-items: stretch;
  }

  .topbar {
    grid-template-columns: 1fr;
    width: min(100% - 22px, 1220px);
    overflow: hidden;
  }

  .brand {
    min-width: 0;
  }

  .brand-logo {
    width: 150px;
  }

  .vehicle-select {
    display: none;
  }

  .header-search {
    grid-template-columns: 1fr 74px;
  }

  .header-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .header-actions a {
    min-height: 42px;
    padding: 0 10px;
  }

  main {
    width: min(100% - 22px, 1220px);
  }

  .landing-hero {
    min-height: auto;
    padding: 24px;
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0 66%, rgba(255, 210, 31, 0.46) 66%),
      url("https://images.unsplash.com/photo-1493238792000-8113da705763?auto=format&fit=crop&w=1200&q=78") center right / cover;
  }

  .search-shell {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 28px;
  }

  .hero-search,
  .info-grid,
  .company-section,
  .search-page-head {
    grid-template-columns: 1fr;
  }

  .search-copy {
    max-width: none;
  }

  .search-panel {
    margin-top: 0;
  }

  .admin-shell,
  .settings-card {
    grid-template-columns: 1fr;
    grid-column: auto;
  }

  .status-strip {
    grid-template-columns: 1fr;
  }

  .result-card {
    grid-template-columns: 1fr 1fr;
  }

  .cart-item {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 540px) {
  .brand small {
    display: none;
  }

  .header-actions a {
    flex: 1;
    text-align: center;
  }

  .hero-content h1 {
    font-size: clamp(1.65rem, 9vw, 2.55rem);
    line-height: 1.06;
  }

  .hero-panel {
    padding: 10px;
  }

  .hero-search input,
  .hero-search button {
    min-height: 52px;
  }

  .search-row,
  .hero-search,
  .field-grid,
  .result-card,
  .cart-item {
    grid-template-columns: 1fr;
  }

  .hero-search button,
  .search-row button {
    width: 100%;
  }

  .cart-summary,
  .modal-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
