/* Kiuki storefront — one stylesheet, written once rather than appended to.
   Rule: never use the `padding` shorthand on an element that also carries
   .wrap — .wrap is a class and beats element selectors, silently zeroing the
   other axis. Use padding-block / padding-inline. */

:root {
  --ground: #fff;
  --surface: #f6f7f6;
  --raised: #fff;
  --ink: #14171a;
  --ink-2: #5b6360;
  --ink-3: #8b938f;
  --line: #e4e7e5;
  --line-2: #eff1f0;
  --accent: #0f5c46;
  --accent-soft: #e6f0ec;
  --accent-ink: #0b4736;
  --on-accent: #fff;
  --stock: #2f8f6b;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 23, 26, .04), 0 10px 30px -14px rgba(20, 23, 26, .16);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0d100f;
    --surface: #141816;
    --raised: #171b19;
    --ink: #e9ecea;
    --ink-2: #9aa39f;
    --ink-3: #6d7672;
    --line: #252b28;
    --line-2: #1d2220;
    --accent: #4ec49b;
    --accent-soft: #12271f;
    --accent-ink: #7ad9b6;
    --on-accent: #08120e;
    --stock: #4ec49b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -14px rgba(0, 0, 0, .7);
  }
}

:root[data-theme="dark"] {
  --ground: #0d100f;
  --surface: #141816;
  --raised: #171b19;
  --ink: #e9ecea;
  --ink-2: #9aa39f;
  --ink-3: #6d7672;
  --line: #252b28;
  --line-2: #1d2220;
  --accent: #4ec49b;
  --accent-soft: #12271f;
  --accent-ink: #7ad9b6;
  --on-accent: #08120e;
  --stock: #4ec49b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -14px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 1240px; margin-inline: auto; padding-inline: 28px; }

@media (max-width: 720px) {
  .wrap { padding-inline: 18px; }
}

/* header */

header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--ground);
  border-bottom: 1px solid var(--line);
}

.bar { display: flex; align-items: center; gap: 26px; padding-block: 18px; }
.mark { display: flex; align-items: center; flex: none; color: var(--ink); }
.mark svg { height: 20px; width: auto; display: block; fill: currentColor; }
.mark:hover { color: var(--accent); }
.searchwrap { flex: 1; position: relative; max-width: 620px; margin: 0; }

.searchwrap svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}

.searchwrap input {
  width: 100%;
  padding-block: 13px;
  padding-inline: 46px 16px;
  font: inherit;
  font-size: 15.5px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
}

.searchwrap input:focus {
  background: var(--raised);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.hdr-right { display: flex; gap: 8px; flex: none; }

.btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-block: 10px;
  padding-inline: 14px;
  border: 1px solid var(--line);
  background: var(--raised);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
}

.btn:hover { border-color: var(--ink-3); }

.count {
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 600;
  padding-inline: 6px;
}

@media (max-width: 660px) {
  .bar { flex-wrap: wrap; gap: 14px; }
  .searchwrap { order: 3; flex-basis: 100%; max-width: none; }
}

/* departments */

.depts { border-bottom: 1px solid var(--line); }

.deptrow {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-block: 12px 14px;
  scrollbar-width: none;
}

.deptrow::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  padding-block: 8px;
  padding-inline: 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--ink-2);
  font-size: 13.5px;
  white-space: nowrap;
}

.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip em { font-style: normal; opacity: .5; margin-left: 6px; font-variant-numeric: tabular-nums; }

/* page frame */

main.wrap { padding-block: 40px 96px; }

.bc {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12.5px;
  color: var(--ink-3);
  margin-block-end: 22px;
  flex-wrap: wrap;
}

.bc a:hover { color: var(--accent); text-decoration: underline; }
.bc .sep { opacity: .4; }

.h1 {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.08;
  letter-spacing: -.032em;
  font-weight: 650;
  margin-block: 0 10px;
  text-wrap: balance;
}

.lede { font-size: 16.5px; color: var(--ink-2); max-width: 54ch; margin-block: 0 38px; }

.h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-block: 60px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.count-line { color: var(--ink-2); font-size: 13.5px; margin-block: 0 22px; }
.subnav { display: flex; gap: 8px; flex-wrap: wrap; margin-block: 26px 30px; }
.subnav .chip { padding-block: 9px; padding-inline: 16px; font-size: 14px; border-radius: 10px; }

/* department tiles */

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 12px; }

.tile {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  min-height: 100px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--raised);
  font-size: 16px;
  font-weight: 560;
  letter-spacing: -.012em;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}

.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent); }
.tile em { font-style: normal; font-size: 13px; color: var(--ink-3); font-weight: 400; order: -1; }

/* product cards */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 18px; }

.card {
  display: flex;
  flex-direction: column;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}

.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.chit { display: flex; flex-direction: column; flex: 1; min-height: 0; }

/* Supplier imagery varies wildly in shape (CLF ships 378x1000 portraits), so
   cap the image rather than stretching the tile to match it. */
.thumb {
  aspect-ratio: 1;
  flex: none;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line-2);
  overflow: hidden;
}

.thumb img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  transition: transform .3s cubic-bezier(.2, .7, .2, 1);
}

.card:hover .thumb img { transform: scale(1.04); }

:root[data-theme="dark"] .thumb img,
:root[data-theme="dark"] .gallery img,
:root[data-theme="dark"] .bthumb img { mix-blend-mode: normal; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .thumb img,
  :root:not([data-theme="light"]) .gallery img,
  :root:not([data-theme="light"]) .bthumb img { mix-blend-mode: normal; }
}

.noimg {
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(45deg, var(--line-2) 0 8px, transparent 8px 16px);
}

.cbody { padding: 13px 14px 8px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.brand { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }

.pname {
  font-size: 14.5px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card .foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 0 14px 14px;
}

.price { font-size: 17px; font-weight: 640; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.was { margin-left: 8px; font-size: 13px; font-weight: 400; color: var(--ink-3); text-decoration: line-through; }
.was.big { font-size: 17px; margin-left: 11px; }

.save {
  margin-left: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 3px 9px;
  vertical-align: middle;
}

.stock { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--stock); flex: none; }

.add {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  flex: none;
  transition: background .14s, border-color .14s, color .14s;
}

.add:hover, .add.done { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.add.done { font-size: 14px; }

/* pagination */

.pager {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  margin-block-start: 40px;
  font-size: 14px;
  color: var(--ink-2);
}

.pager a { padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised); }
.pager a:hover { border-color: var(--accent); color: var(--accent); }

/* product page */

.pdp { display: grid; grid-template-columns: 1.05fr .95fr; gap: 60px; align-items: start; }

@media (max-width: 860px) {
  .pdp { grid-template-columns: 1fr; gap: 28px; }
}

.gallery {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 44px;
  overflow: hidden;
}

.gallery img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }

.pdp h1 {
  margin-block: 6px 10px;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.2;
  letter-spacing: -.028em;
  font-weight: 640;
  text-wrap: balance;
}

.rating { display: flex; gap: 8px; font-size: 13.5px; color: var(--ink-2); margin-block-end: 18px; }
.stars.none { color: var(--ink-3); letter-spacing: .08em; }
.bigprice { font-size: 34px; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.perunit { font-size: 13px; color: var(--ink-3); margin-top: 4px; }

.buy {
  width: 100%;
  margin-block-start: 20px;
  padding: 15px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .16s;
}

.buy:hover { filter: brightness(1.08); }
.deliv { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); margin-top: 16px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }

.pill {
  font-size: 11.5px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
}

.sect { margin-block-start: 40px; padding-block-start: 28px; border-top: 1px solid var(--line); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; }

@media (max-width: 860px) {
  .cols { grid-template-columns: 1fr; gap: 26px; }
}

.col h3 {
  margin-block: 0 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-3);
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
td { padding-block: 8px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); }
td:last-child { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 500; }
tr:last-child td { border-bottom: 0; }

.reviews-empty {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 36px 24px;
  text-align: center;
  background: var(--surface);
}

.reviews-empty b { display: block; font-size: 16px; margin-bottom: 6px; }
.reviews-empty p { margin: 0; font-size: 14px; color: var(--ink-2); max-width: 46ch; margin-inline: auto; }

/* basket */

.bgroup {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 4px 20px 14px;
  margin-block-end: 14px;
  background: var(--raised);
}

.bgroup h3 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-block: 18px 4px;
}

.bline {
  display: grid;
  grid-template-columns: 64px 1fr auto auto auto;
  gap: 16px;
  align-items: center;
  padding-block: 14px;
  border-top: 1px solid var(--line-2);
}

.bline:first-of-type { border-top: 0; }

.bthumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background: var(--surface);
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 6px;
}

.bthumb img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.bmeta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bmeta a { font-size: 14.5px; line-height: 1.35; }
.bmeta a:hover { color: var(--accent); }
.bmeta span { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.bqty { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bprice { font-size: 15.5px; font-weight: 620; font-variant-numeric: tabular-nums; min-width: 78px; text-align: right; }

.brm {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: none;
  color: var(--ink-3);
  cursor: pointer;
  font-size: 13px;
}

.brm:hover { border-color: var(--ink-3); color: var(--ink); }

.btotal {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  font-size: 15px;
  color: var(--ink-2);
}

.btotal b { font-size: 24px; font-weight: 650; color: var(--ink); letter-spacing: -.025em; font-variant-numeric: tabular-nums; }

@media (max-width: 620px) {
  .bline { grid-template-columns: 52px 1fr auto; row-gap: 8px; }
  .bthumb { width: 52px; height: 52px; }
  .bprice { grid-column: 2 / 4; text-align: left; }
  .brm { grid-row: 1; grid-column: 3; }
}

/* footer */

footer {
  border-top: 1px solid var(--line);
  margin-block-start: 48px;
  padding-block: 32px;
  color: var(--ink-3);
  font-size: 13.5px;
}

footer p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
