@import url("tokens.css");

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--step-0) / 1.6 var(--font-body);
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; height: auto; }
a { color: var(--brand-strong); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--clay-700); }

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 var(--s-3); font-weight: 700; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }

p { margin: 0 0 var(--s-4); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-1);
}

.wrap { width: min(100% - 2 * var(--s-4), var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--s-4); top: var(--s-4); background: var(--chalk-000); padding: var(--s-3) var(--s-4); z-index: 99; border-radius: var(--r-1); }

/* ---------- header ---------- */
.topbar {
  background: var(--moss-900);
  color: var(--cream-100);
  font-size: var(--step--1);
  text-align: center;
  padding: var(--s-2) var(--s-4);
}

.site-head {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}
.site-head__row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) 0;
}
.brand { display: flex; align-items: center; gap: var(--s-2); text-decoration: none; color: var(--moss-900); font-family: var(--font-display); font-size: var(--step-2); font-weight: 700; letter-spacing: -0.01em; }
.brand__mark { width: 34px; height: 34px; flex: none; }
.brand small { display: block; font: 400 var(--step--1) / 1.2 var(--font-body); color: var(--text-mute); letter-spacing: 0; }

.head-tools { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }

.icon-btn {
  min-width: var(--tap);
  min-height: var(--tap);
  display: inline-grid;
  place-items: center;
  gap: 2px;
  background: var(--cream-200);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  color: var(--moss-900);
  font: inherit;
  font-size: var(--step--1);
  cursor: pointer;
  padding: 0 var(--s-3);
}
.icon-btn:hover { background: var(--sage-100); }

.nav { border-top: 1px solid var(--line); background: var(--surface); }
.nav ul { display: flex; gap: var(--s-1); overflow-x: auto; list-style: none; margin: 0; padding: var(--s-2) 0; scrollbar-width: none; }
.nav ul::-webkit-scrollbar { display: none; }
.nav a { display: flex; align-items: center; min-height: var(--tap); white-space: nowrap; padding: var(--s-2) var(--s-3); border-radius: var(--r-pill); font-size: var(--step--1); text-decoration: none; color: var(--text-soft); }
.nav a:hover, .nav a[aria-current="page"] { background: var(--sage-100); color: var(--moss-900); }

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--sage-100), var(--cream-200) 60%);
  border-bottom: 1px solid var(--line);
  padding: var(--s-7) 0;
}
.hero__grid { display: grid; gap: var(--s-5); }
.hero h1 { font-size: clamp(1.9rem, 6vw, var(--step-6)); max-width: 20ch; }
.hero p { font-size: var(--step-1); color: var(--text-soft); max-width: 46ch; }
.hero__art { border-radius: var(--r-3); overflow: hidden; box-shadow: var(--shadow-3); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: var(--tap);
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: var(--brand);
  color: var(--chalk-000);
  font: 600 var(--step-0) / 1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.15s var(--ease);
}
.btn:hover { background: var(--brand-strong); color: var(--chalk-000); transform: translateY(-1px); }
.btn--ghost { background: transparent; border-color: var(--moss-700); color: var(--moss-900); }
.btn--ghost:hover { background: var(--sage-100); color: var(--moss-900); }
.btn--clay { background: var(--clay-700); }
.btn--clay:hover { background: #7c3a23; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---------- tiles + trust ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-3); padding: var(--s-6) 0; }
.tile { position: relative; border-radius: var(--r-2); overflow: hidden; background: var(--moss-700); min-height: 120px; display: flex; align-items: flex-end; text-decoration: none; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.72; transition: opacity 0.2s var(--ease); }
.tile:hover img { opacity: 0.9; }
.tile span { position: relative; padding: var(--s-3); color: var(--chalk-000); font-weight: 600; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5); }

.trust { border-block: 1px solid var(--line); background: var(--bg-alt); }
.trust ul { display: grid; gap: var(--s-3); list-style: none; margin: 0; padding: var(--s-5) 0; }
.trust li { display: flex; gap: var(--s-3); align-items: flex-start; font-size: var(--step--1); color: var(--text-soft); }
.trust b { display: block; color: var(--text); font-size: var(--step-0); }

/* ---------- product grid + card ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4); margin: var(--s-7) 0 var(--s-4); flex-wrap: wrap; }
.section-head h2 { margin: 0; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-4); list-style: none; margin: 0; padding: 0 0 var(--s-7); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-1); height: 100%; }
.card__link { display: block; aspect-ratio: 1 / 1; background: var(--bg-alt); overflow: hidden; }
.card__link img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s var(--ease); }
.card:hover .card__link img { transform: scale(1.03); }
.card__body { padding: var(--s-3); display: flex; flex-direction: column; gap: var(--s-2); flex: 1; }
.card__type { font-size: var(--step--1); color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.06em; }
.card__title { font: 600 var(--step-0) / 1.35 var(--font-body); margin: 0; }
.card__title a { text-decoration: none; color: var(--text); }
.card__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.price { font-weight: 700; font-size: var(--step-1); }
.price--was { font-weight: 400; font-size: var(--step--1); color: var(--text-mute); text-decoration: line-through; margin-left: var(--s-2); }

/* ---------- product detail ---------- */
.pdp { display: grid; gap: var(--s-5); padding: var(--s-6) 0; }
.gallery { display: grid; gap: var(--s-2); }
.gallery__main { border-radius: var(--r-2); overflow: hidden; background: var(--bg-alt); }
.gallery__thumbs { display: flex; gap: var(--s-2); overflow-x: auto; list-style: none; padding: 0; margin: 0; }
.gallery__thumbs button { padding: 0; border: 1px solid var(--line); border-radius: var(--r-1); overflow: hidden; background: none; cursor: pointer; width: 76px; height: 76px; flex: none; }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumbs button[aria-current="true"] { border-color: var(--moss-700); border-width: 2px; }

.buybox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); padding: var(--s-4); box-shadow: var(--shadow-1); }
.buybox .price { font-size: var(--step-3); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-pill); overflow: hidden; }
.qty button { width: calc(var(--tap) + 4px); height: var(--tap); border: 0; background: var(--surface); font-size: var(--step-1); cursor: pointer; }
.qty input { width: 3.2rem; height: var(--tap); border: 0; text-align: center; font: inherit; background: var(--surface); -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- forms ---------- */
.field { display: grid; gap: var(--s-1); margin-bottom: var(--s-3); }
.field label { font-weight: 600; font-size: var(--step--1); }
.field .hint { font-size: var(--step--1); color: var(--text-mute); }
.field input, .field select, .field textarea {
  min-height: var(--tap);
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  background: var(--surface);
  font: inherit;
  color: var(--text);
  width: 100%;
}
.field textarea { min-height: 8rem; resize: vertical; }
.field[data-invalid="true"] input, .field[data-invalid="true"] select { border-color: var(--err); border-width: 2px; }
.field .err { color: var(--err); font-size: var(--step--1); font-weight: 600; }
.field .err:empty { display: none; }
fieldset { border: 1px solid var(--line); border-radius: var(--r-2); padding: var(--s-4); margin: 0 0 var(--s-4); background: var(--surface); }
legend { font-family: var(--font-display); font-size: var(--step-1); font-weight: 700; padding-inline: var(--s-2); }
.row2 { display: grid; gap: var(--s-3); grid-template-columns: 1fr 1fr; }
.row3 { display: grid; gap: var(--s-3); grid-template-columns: 2fr 1fr 1fr; }

/* ---------- panels / tables ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); padding: var(--s-4); }
.line-item { display: grid; grid-template-columns: 64px 1fr auto; gap: var(--s-3); align-items: center; padding: var(--s-3) 0; border-bottom: 1px solid var(--line); }
.line-item img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--r-1); }
.line-item:last-of-type { border-bottom: 0; }
.totals { display: grid; gap: var(--s-2); margin-top: var(--s-3); }
.totals div { display: flex; justify-content: space-between; font-size: var(--step--1); color: var(--text-soft); }
.totals .grand { font-size: var(--step-1); font-weight: 700; color: var(--text); border-top: 1px solid var(--line); padding-top: var(--s-2); }
.compare { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.compare th, .compare td { text-align: left; padding: var(--s-2); border-bottom: 1px solid var(--line); }

.note { border-left: 4px solid var(--clay-500); background: var(--accent-soft); padding: var(--s-3) var(--s-4); border-radius: 0 var(--r-1) var(--r-1) 0; font-size: var(--step--1); }
.ok-badge { display: inline-block; background: var(--sage-100); color: var(--ok); border-radius: var(--r-pill); padding: 0 var(--s-2); font-size: var(--step--1); font-weight: 700; }
.bad-badge { display: inline-block; background: #f8dcd8; color: var(--err); border-radius: var(--r-pill); padding: 0 var(--s-2); font-size: var(--step--1); font-weight: 700; }

.prose { max-width: 68ch; }
.prose h2 { margin-top: var(--s-6); }
.prose ul { padding-left: var(--s-5); }
.todo { background: #fff3cd; border-bottom: 2px dashed var(--warn); padding: 0 2px; font-weight: 600; }

/* ---------- footer ---------- */
.site-foot { background: var(--moss-900); color: var(--cream-200); margin-top: var(--s-8); padding: var(--s-7) 0 var(--s-5); font-size: var(--step--1); }
.site-foot a { color: var(--sage-100); }
.site-foot__grid { display: grid; gap: var(--s-5); }
.site-foot h2 { font-size: var(--step-0); color: var(--chalk-000); font-family: var(--font-body); text-transform: uppercase; letter-spacing: 0.08em; }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-1); }
.site-foot li a { display: inline-flex; align-items: center; min-height: var(--tap); }
.site-foot address { font-style: normal; line-height: 1.8; }
.legal { border-top: 1px solid rgba(255, 255, 255, 0.18); margin-top: var(--s-5); padding-top: var(--s-4); display: flex; flex-wrap: wrap; gap: var(--s-3); justify-content: space-between; color: var(--sage-300); }

/* ---------- responsive ---------- */
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .trust ul { grid-template-columns: repeat(3, 1fr); }
  .hero__grid { grid-template-columns: 1.05fr 1fr; align-items: center; }
}
@media (min-width: 960px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  .pdp { grid-template-columns: 1.15fr 0.85fr; align-items: start; }
  .site-foot__grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
  .cart-layout { display: grid; grid-template-columns: 1.5fr 0.9fr; gap: var(--s-5); align-items: start; }
}


/* ---------- footer suite (F1) ---------- */
.foot-top { display: grid; gap: var(--s-5); }
.foot-promise { font-family: var(--font-display); font-size: var(--step-1); color: var(--chalk-000); margin: var(--s-2) 0 var(--s-3); }
.foot-news { max-width: 24rem; }
.foot-news label { display: block; font-weight: 600; color: var(--chalk-000); font-size: var(--step--1); margin-bottom: var(--s-1); }
.foot-news__row { display: flex; gap: var(--s-2); }
.foot-news input { flex: 1; min-width: 0; border: 1px solid var(--sage-300); background: rgba(255,255,255,.07); color: var(--chalk-000); border-radius: var(--r-1); padding: var(--s-2) var(--s-3); min-height: var(--tap); }
.foot-news input::placeholder { color: var(--sage-300); }
.site-foot .hint { color: var(--sage-300); }
.site-foot__grid { grid-template-columns: repeat(2, 1fr); }
.foot-addr { font-style: normal; line-height: 1.8; color: var(--sage-300); margin-top: var(--s-3); }
.foot-pay { display: flex; gap: var(--s-1); flex-wrap: wrap; align-items: center; }
.foot-pay b { display: inline-flex; align-items: center; justify-content: center; min-width: 3.1rem; padding: .22rem .45rem; border: 1px solid rgba(255,255,255,.34); border-radius: var(--r-1); font-size: .58rem; letter-spacing: .06em; color: var(--cream-100); }
@media (min-width: 640px) { .site-foot__grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 960px) { .foot-top { grid-template-columns: 21rem 1fr; align-items: start; gap: var(--s-6); } }

/* footer newsletter button: ghost variant needs light on dark */
.foot-news .btn--ghost { color: var(--chalk-000); border-color: var(--sage-300); padding-inline: var(--s-4); }
.foot-news .btn--ghost:hover { background: var(--sage-100); color: var(--moss-900); }
