:root {
  color-scheme: dark;
  --bg: #0b0b0b;
  --panel: #151515;
  --line: #2b2b2b;
  --muted: #a2a2a2;
  --ink: #f8f8f5;
  --accent: #ff6a24;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  color: inherit;
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  border: 0;
  background: none;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.shell {
  max-width: 900px;
  margin: auto;
  padding: 0 24px;
}
header {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 12px;
  padding-top: max(
    env(safe-area-inset-top),
    var(--tg-content-safe-area-inset-top, 0px)
  );
}
.brand {
  font-size: 21px;
  font-weight: 850;
  letter-spacing: -0.8px;
}
.brand > span:first-child {
  color: var(--accent);
  padding: 0 5px;
}
.location {
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--muted);
  white-space: nowrap;
}
.location i {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  margin-left: 6px;
  border-radius: 50%;
}
main {
  padding-bottom: 125px;
  min-height: 80vh;
}
.hero {
  padding: 32px 0 22px;
}
.eyebrow,
.section-label {
  font-size: 12px;
  letter-spacing: 1.7px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.hero h1 {
  font-size: clamp(38px, 8.5vw, 66px);
  line-height: 1.02;
  letter-spacing: -2px;
  margin: 17px 0;
  font-weight: 850;
}
.hero h1 span {
  color: var(--accent);
}
.tagline {
  color: #bbb;
  margin-bottom: 0;
}
.search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--panel);
  border: 1px solid #393939;
  border-radius: 10px;
  min-height: 58px;
  margin: 4px 0 28px;
}
.search svg {
  color: var(--accent);
  flex-shrink: 0;
}
.search input {
  width: 100%;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  color: var(--ink);
  padding: 16px 0;
}
.search:focus-within {
  border-color: var(--accent);
}
.search button {
  padding: 8px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 26px 0 14px;
}
.section-head h2 {
  font-size: 13px;
  letter-spacing: 1.5px;
  margin: 0;
  font-weight: 600;
}
.text-action {
  color: var(--muted);
  font-size: 14px;
  padding: 8px 0;
}
.categories {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.category {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: left;
  padding: 18px;
  min-height: 142px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: space-between;
  gap: 10px;
}
.category > svg {
  color: #dedede;
}
.category strong {
  font-size: 16px;
  display: block;
  font-weight: 600;
}
.category small {
  font-size: 12px;
  color: var(--muted);
}
.category .arrow {
  grid-column: 2;
  grid-row: 2;
  align-self: end;
  color: var(--accent);
}
.category:hover,
.product-row:hover {
  background: #1b1b1b;
}
.product-row {
  width: 100%;
  text-align: left;
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.part-icon {
  width: 52px;
  height: 64px;
  display: grid;
  place-items: center;
  background: #171717;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #b8b8b8;
}
.product-row strong {
  font-size: 16px;
  font-weight: 600;
  display: block;
}
.product-row .variant {
  font-size: 13px;
  color: var(--muted);
  display: block;
  margin: 3px 0 7px;
}
.price {
  font-size: 18px;
  font-weight: 650;
  white-space: nowrap;
  align-self: start;
}
.status {
  font-size: 12px;
  letter-spacing: 0.3px;
  color: var(--muted);
}
.status.in_stock {
  color: #e9e9e6;
}
.status.in_stock:before {
  content: "●";
  font-size: 8px;
  color: var(--accent);
  margin-right: 6px;
}
nav {
  position: fixed;
  z-index: 5;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 900px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 10px 12px
    max(
      12px,
      env(safe-area-inset-bottom),
      var(--tg-content-safe-area-inset-bottom, 0px)
    );
  background: #0b0b0bf5;
  border-top: 1px solid var(--line);
}
nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 50px;
  justify-content: center;
  color: #929292;
  font-size: 12px;
}
nav a.active {
  color: var(--accent);
}
svg {
  width: 23px;
  height: 23px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.page-title {
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -1px;
  margin: 32px 0 24px;
}
.filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}
.filters label {
  font-size: 12px;
  color: var(--muted);
}
select {
  width: 100%;
  margin-top: 5px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 8px;
  color: var(--ink);
  font-size: 14px;
}
.notice {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--muted);
  margin: 22px 0;
}
.notice button {
  color: var(--accent);
  padding: 12px 0;
  display: block;
}
.back {
  margin-top: 22px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--muted);
}
.product-image {
  height: 245px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(140deg, #181818, #101010);
  margin: 20px 0 30px;
  gap: 20px;
}
.product-image svg {
  width: 62px;
  height: 62px;
  stroke-width: 0.8;
}
.product-image span {
  font-size: 12px;
  letter-spacing: 2px;
  color: #848484;
}
.product-title {
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -1px;
  margin: 12px 0;
}
.product-variant {
  font-size: 20px;
  color: #bbb;
}
.large-price {
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -1.5px;
  margin: 22px 0 3px;
}
.primary,
.secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  border-radius: 8px;
  font-weight: 650;
  margin-top: 12px;
  padding: 12px 18px;
}
.primary {
  background: var(--accent);
  color: #111;
}
.secondary {
  border: 1px solid #404040;
  background: var(--panel);
}
dl {
  margin: 26px 0;
}
dl div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
dt {
  color: var(--muted);
}
dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}
.helper {
  color: var(--muted);
  font-size: 13px;
  margin: 16px 0;
}
.cart-item {
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}
.cart-item h2 {
  font-size: 17px;
  margin: 0;
}
.cart-item p {
  font-size: 14px;
  color: var(--muted);
  margin: 6px 0 14px;
}
.quantity {
  display: flex;
  align-items: center;
  gap: 16px;
}
.quantity button {
  width: 42px;
  height: 42px;
  border: 1px solid #393939;
  border-radius: 6px;
}
.quantity .remove {
  margin-left: auto;
  width: auto;
  border: 0;
  color: var(--muted);
  font-size: 13px;
}
.total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 28px 0 20px;
  gap: 16px;
}
.total strong {
  font-size: 32px;
}
textarea {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--ink);
  resize: vertical;
  min-height: 90px;
  margin-top: 8px;
}
.quote {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  font-size: 14px;
  color: #d0d0d0;
  background: var(--panel);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.badge {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 1px;
}
#toast {
  position: fixed;
  z-index: 10;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: #f3f3ef;
  color: #111;
  border-radius: 8px;
  padding: 12px 20px;
  max-width: 90vw;
  display: none;
}
#toast.show {
  display: block;
}
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
}
.toolbar .secondary {
  width: auto;
}
button.favorite {
  margin-left: auto;
  min-width: 44px;
  min-height: 44px;
}
.favorite.selected {
  color: var(--accent);
}
@media (min-width: 700px) {
  .shell {
    padding: 0 40px;
  }
  .hero {
    padding-top: 40px;
  }
  .hero h1 br:nth-of-type(2) {
    display: none;
  }
  .categories {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .product-image {
    height: 300px;
  }
  .product-row {
    grid-template-columns: 64px 1fr auto;
  }
  .category {
    padding: 16px;
  }
  .hero h1 {
    font-size: 64px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button,
  a {
    transition:
      background 0.15s,
      color 0.15s;
  }
}
@media (max-width: 360px) {
  .shell {
    padding: 0 16px;
  }
  .location {
    font-size: 10px;
  }
  .brand {
    font-size: 19px;
  }
  .product-row {
    grid-template-columns: 40px 1fr;
    gap: 10px;
  }
  .product-row .price {
    grid-column: 2;
  }
  .part-icon {
    width: 40px;
  }
}


/* KIVI corporate visual layer */
.brand {
  display: flex;
  align-items: center;
}
.brand img {
  display: block;
  width: 128px;
  max-width: 34vw;
  height: 30px;
  object-fit: contain;
  object-position: left center;
}

.hero {
  padding-bottom: 18px;
}

.brand-gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 88%;
  gap: 10px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline mandatory;
  scrollbar-width: none;
  margin-top: 26px;
  padding-bottom: 5px;
}
.brand-gallery::-webkit-scrollbar {
  display: none;
}
.brand-gallery img {
  width: 100%;
  height: clamp(122px, 25vw, 210px);
  object-fit: cover;
  display: block;
  border-radius: 12px;
  border: 1px solid var(--line);
  scroll-snap-align: start;
  background: #151515;
}

.category {
  position: relative;
  overflow: hidden;
  min-height: 158px;
}
.category-visual {
  min-height: 60px;
  display: flex;
  align-items: flex-start;
}
.category-art {
  width: 58px;
  height: 58px;
  object-fit: contain;
  object-position: left center;
  filter: grayscale(1) brightness(1.65);
  opacity: .92;
}
.category-copy {
  position: relative;
  z-index: 2;
}
.category .arrow {
  position: relative;
  z-index: 2;
}
.category:hover .category-art,
.category:focus-visible .category-art {
  filter: none;
  opacity: 1;
}

@media (min-width: 700px) {
  .brand-gallery {
    grid-auto-columns: 72%;
  }
  .brand-gallery img {
    height: 190px;
  }
  .category {
    min-height: 170px;
  }
  .category-art {
    width: 64px;
    height: 64px;
  }
}
