/* KOSMETORIA - catalog demo
   Tile background must stay identical to CANVAS_BACKGROUND in tools/normalize_images.py
   (250,250,250); any drift shows up as a visible square behind every product. */

@font-face {
  font-family: 'DM Sans';
  src: url('/fonts/dm-sans-400-latin-ext.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/fonts/dm-sans-400-latin.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/fonts/dm-sans-500-latin-ext.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/fonts/dm-sans-500-latin.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/fonts/dm-sans-700-latin-ext.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/fonts/dm-sans-700-latin.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('/fonts/space-grotesk-600-latin-ext.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('/fonts/space-grotesk-600-latin.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('/fonts/space-grotesk-700-latin-ext.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('/fonts/space-grotesk-700-latin.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --ink: #16181a;
  --ink-soft: #5c625f;
  /* Contrast floor: this is used at 13px, where WCAG AA wants 4.5:1 on white.
     The lighter #8a908c it replaced measured 3.25:1. */
  --ink-faint: #6d736e;
  --line: #e4e5e1;
  --line-strong: #cdcfc9;
  --bg: #ffffff;
  --tile: #fafafa;
  --accent: #2f5d50;
  --accent-soft: #edf3f0;
  --flag: #8a5a1a;
  --flag-soft: #fbf3e6;
  --radius: 10px;
  --shell: 1240px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: 'Space Grotesk', 'DM Sans', system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
}

a {
  color: inherit;
}

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

.shell {
  width: min(100% - 40px, var(--shell));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  z-index: 20;
}

.skip-link:focus {
  left: 8px;
  top: 8px;
}

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 68px;
}

.wordmark {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.24rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  margin-right: auto;
}

.wordmark span {
  color: var(--accent);
}

.site-nav {
  display: flex;
  gap: 22px;
  font-size: 0.94rem;
  font-weight: 500;
}

.site-nav a {
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  border-bottom-color: var(--accent);
}

.demo-pill {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 5px 11px;
  white-space: nowrap;
}

/* ---------- hero ---------- */

.hero {
  padding: 62px 0 46px;
  border-bottom: 1px solid var(--line);
}

.hero h1 {
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  max-width: 19ch;
}

.hero p {
  max-width: 62ch;
  margin: 20px 0 0;
  font-size: 1.06rem;
  color: var(--ink-soft);
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
  padding: 0;
  list-style: none;
}

.stat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  min-width: 150px;
  flex: 1 1 150px;
}

.stat__value {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  display: block;
  letter-spacing: -0.01em;
}

.stat__label {
  font-size: 0.84rem;
  color: var(--ink-soft);
  display: block;
  margin-top: 2px;
}

/* ---------- sections ---------- */

.section {
  padding: 58px 0;
}

.section--tint {
  background: #f7f8f6;
  border-block: 1px solid var(--line);
}

.section__head {
  max-width: 68ch;
  margin-bottom: 30px;
}

.section__head h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.95rem);
}

.section__head p {
  color: var(--ink-soft);
  margin: 12px 0 0;
}

/* ---------- before / after strip ---------- */

.compare {
  display: grid;
  gap: 22px;
}

.compare__row h3 {
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 10px;
  font-family: 'DM Sans', sans-serif;
}

.compare__row--after h3 {
  color: var(--accent);
}

.compare__strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.compare__cell {
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: 8px;
  aspect-ratio: 1;
  overflow: hidden;
}

.compare__cell img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.compare__row--after .compare__cell {
  border-color: var(--line-strong);
}

/* ---------- toolbar ---------- */

.toolbar {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  padding: 18px 0;
}

.toolbar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group__label {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--ink-soft);
}

select {
  font: inherit;
  font-size: 0.92rem;
  padding: 7px 30px 7px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%235c625f' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center/11px;
  appearance: none;
  color: var(--ink);
  cursor: pointer;
}

select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.switch {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  margin-left: auto;
}

.switch button {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  padding: 6px 15px;
  border-radius: 999px;
  cursor: pointer;
}

.switch button[aria-pressed='true'] {
  background: var(--ink);
  color: #fff;
  font-weight: 700;
}

.result-count {
  font-size: 0.9rem;
  color: var(--ink-soft);
  width: 100%;
}

.result-count strong {
  color: var(--ink);
}

/* ---------- product grid ---------- */

.grid {
  list-style: none;
  margin: 0;
  padding: 34px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(206px, 1fr));
  gap: 26px 20px;
}

.card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card a {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card__figure {
  position: relative;
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  aspect-ratio: 1;
  overflow: hidden;
}

.card__figure img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card a:hover .card__figure {
  border-color: var(--line-strong);
}

.card__flag {
  position: absolute;
  left: 8px;
  bottom: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--flag);
  background: var(--flag-soft);
  border: 1px solid #eddcbe;
  border-radius: 6px;
  padding: 3px 7px;
  display: none;
}

.grid[data-view='surowe'] .card__flag {
  display: block;
}

.card__brand {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 13px;
}

.card__name {
  font-size: 0.99rem;
  font-weight: 500;
  margin-top: 3px;
  line-height: 1.35;
}

.card a:hover .card__name {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.card__meta {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.card__price {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
}

.card__volume {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* Sits above the price row so that the row itself stays pinned to the bottom of every
   card. Cards carrying a gap note would otherwise push their price out of line with
   their neighbours, which is the exact defect this catalog argues against. */
.card__gaps {
  font-size: 0.76rem;
  color: var(--flag);
  margin-top: 6px;
  line-height: 1.4;
}

.grid-empty {
  padding: 40px 0;
  color: var(--ink-soft);
}

/* ---------- data quality panel ---------- */

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

.quality__item {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.quality__item h3 {
  font-size: 0.95rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
}

.quality__item p {
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.bar {
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  margin-top: 12px;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--accent);
}

/* ---------- product page ---------- */

.crumbs {
  font-size: 0.86rem;
  color: var(--ink-soft);
  padding: 20px 0 0;
}

.crumbs a {
  text-decoration: none;
}

.crumbs a:hover {
  text-decoration: underline;
}

.product {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 46px;
  padding: 26px 0 60px;
  align-items: start;
}

.product__figure {
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  aspect-ratio: 1;
  overflow: hidden;
}

.product__figure img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product__brand {
  font-size: 0.79rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.product h1 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin-top: 6px;
}

.product__price {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.85rem;
  margin-top: 18px;
}

.product__stock {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-top: 4px;
}

.product__lead {
  margin-top: 18px;
  color: var(--ink-soft);
}

.variants {
  margin-top: 24px;
}

.variants__label {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.variants__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.variants__list a,
.variants__list span {
  display: block;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 0.92rem;
  text-decoration: none;
}

.variants__list span {
  border-color: var(--ink);
  font-weight: 700;
}

.buy {
  margin-top: 26px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.buy button {
  font: inherit;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 13px 26px;
  cursor: pointer;
}

.buy button:hover:not([disabled]) {
  background: #26493f;
}

.buy button[disabled] {
  background: #d9ded9;
  color: #4f544f;
  cursor: not-allowed;
}

.buy small {
  color: var(--ink-faint);
  font-size: 0.82rem;
}

/* Specification block: every row is a field, so a missing value drops its row and
   the block simply gets shorter. Nothing reflows sideways. */

.spec {
  margin-top: 34px;
  border-top: 1px solid var(--line);
}

.spec h2 {
  font-size: 1.05rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  margin: 22px 0 10px;
}

.spec dl {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(140px, auto) 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.spec dt,
.spec dd {
  background: var(--bg);
  margin: 0;
  padding: 11px 14px;
  font-size: 0.92rem;
}

.spec dt {
  font-weight: 700;
  color: var(--ink-soft);
}

.inci {
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.7;
  margin: 10px 0 0;
}

.data-note {
  margin-top: 22px;
  border: 1px solid #eddcbe;
  background: var(--flag-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 0.88rem;
}

.data-note strong {
  color: var(--flag);
}

.data-note ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.data-note--ok {
  border-color: #cfe3d8;
  background: var(--accent-soft);
}

.data-note--ok strong {
  color: var(--accent);
}

/* ---------- mechanism page ---------- */

.prose {
  max-width: 70ch;
}

.prose h2 {
  font-size: 1.5rem;
  margin-top: 44px;
}

.prose h3 {
  font-size: 1.1rem;
  font-family: 'DM Sans', sans-serif;
  margin-top: 30px;
}

.prose p,
.prose li {
  color: var(--ink-soft);
}

.prose li {
  margin-bottom: 7px;
}

.prose code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.88em;
  background: #f2f3f0;
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--ink);
}

.table-scroll {
  overflow-x: auto;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
  min-width: 520px;
}

th,
td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}

th {
  font-weight: 700;
  background: #f7f8f6;
}

tbody tr:last-child td {
  border-bottom: 0;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 34px 0 44px;
  font-size: 0.89rem;
  color: var(--ink-soft);
}

.site-footer p {
  margin: 0 0 8px;
  max-width: 74ch;
}

.site-footer a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- responsive ---------- */

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

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

@media (max-width: 620px) {
  .site-header__inner {
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 12px 0;
  }

  .wordmark {
    margin-right: 0;
    width: 100%;
  }

  .hero {
    padding: 40px 0 34px;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 22px 14px;
  }

  .switch {
    margin-left: 0;
  }

  .spec dl {
    grid-template-columns: 1fr;
  }

  .spec dt {
    padding-bottom: 0;
    background: var(--bg);
  }
}

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