/* Base storefront theme.
   White paper, ink text, system body type. The one loud thing is the price:
   a yellow bazaar price tag set in a heavy condensed face. Client themes
   override the variables in :root, this file, or whole templates. */

@font-face {
  font-family: "Sofia Sans Condensed";
  font-weight: 1 1000;
  font-display: swap;
  src: url("fonts/sofia-sans-condensed-cyrillic-wght-normal.c21ea4af827c.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Sofia Sans Condensed";
  font-weight: 1 1000;
  font-display: swap;
  src: url("fonts/sofia-sans-condensed-latin-ext-wght-normal.84dad0cb63fc.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2113;
}

@font-face {
  font-family: "Sofia Sans Condensed";
  font-weight: 1 1000;
  font-display: swap;
  src: url("fonts/sofia-sans-condensed-latin-wght-normal.5ec7e03436cf.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}

:root {
  --paper: #fff;
  --ink: #16181d;
  --muted: #6a6f7a;
  --line: #e6e7eb;
  --wash: #f2f2ef; /* behind photos while they load */
  --accent: #b3123b; /* buttons and links; store setting */
  --tag: #ffd43b; /* the price tag; store setting */
  --tag-ink: #16181d;
  --display: "Sofia Sans Condensed", "Arial Narrow", sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --gutter: 12px;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--body);
  -webkit-text-size-adjust: 100%;
}

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

a {
  color: inherit;
}

h1,
h2,
p,
ul {
  margin: 0;
}

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

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

main.wrap {
  padding-top: 16px;
  padding-bottom: 56px;
}

/* --- header ---------------------------------------------------------------- */
.top {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px var(--gutter) 8px;
}

.brand {
  margin-right: auto;
  font: 900 1.75rem/1 var(--display);
  letter-spacing: 0.01em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand img {
  height: 40px;
  width: auto;
}

.langs {
  display: flex;
  gap: 2px;
  font: 700 1rem/1 var(--display);
  letter-spacing: 0.04em;
}

.langs a {
  padding: 8px 6px;
  color: var(--muted);
  text-decoration: none;
}

.langs a[aria-current] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--ink);
}

.search {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--gutter) 10px;
}

.search input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
}

.search input:focus {
  border-color: var(--ink);
  outline: 0;
}

/* categories: one swipeable row, no menu button and no script */
.chips {
  display: flex;
  gap: 8px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--gutter) 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.chips a {
  flex: none;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9375rem;
  text-decoration: none;
  white-space: nowrap;
}

.chips a[aria-current] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.chips--inline {
  flex-wrap: wrap;
  margin: 0 0 20px;
  padding: 0;
  overflow: visible;
}

/* --- type -------------------------------------------------------------------- */
.heading {
  margin-bottom: 16px;
  font: 900 2rem/1 var(--display);
  letter-spacing: 0.005em;
  text-transform: uppercase;
}

.trail {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.875rem;
}

.trail a {
  text-decoration: none;
}

.trail a + a::before {
  content: "/";
  margin: 0 8px;
  color: var(--line);
}

.empty {
  padding: 48px 0;
  color: var(--muted);
  text-align: center;
}

.text {
  max-width: 68ch;
}

.text p {
  margin-bottom: 1em;
}

/* --- the price tag ------------------------------------------------------------ */
.tag {
  display: inline-block;
  padding: 3px 10px 3px 20px;
  /* a pointed left edge with a string hole, like a tag on a bazaar stall */
  background:
    radial-gradient(circle at 10px 50%, var(--paper) 2.5px, transparent 3.5px),
    var(--tag);
  clip-path: polygon(9px 0, 100% 0, 100% 100%, 9px 100%, 0 50%);
  color: var(--tag-ink);
  font: 900 1.25rem/1.25 var(--display);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tag small {
  font-size: 0.62em;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.tag--big {
  padding: 5px 14px 5px 26px;
  background:
    radial-gradient(circle at 13px 50%, var(--paper) 3.5px, transparent 4.5px),
    var(--tag);
  clip-path: polygon(12px 0, 100% 0, 100% 100%, 12px 100%, 0 50%);
  font-size: 2rem;
}

/* --- product grid --------------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px var(--gutter);
}

.card {
  display: block;
  text-decoration: none;
}

.card__photo {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  background: var(--wash);
}

.card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card .tag {
  position: absolute;
  left: -4px; /* the tag hangs over the photo's edge */
  bottom: 10px;
}

.card__name {
  display: -webkit-box;
  margin-top: 8px;
  overflow: hidden;
  font-size: 0.9375rem;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card__note {
  display: block;
  color: var(--muted);
  font-size: 0.8125rem;
}

.card--out img {
  filter: grayscale(1);
  opacity: 0.55;
}

.card--out .tag {
  background: var(--line);
}

.sort {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  overflow-x: auto;
  color: var(--muted);
  font-size: 0.875rem;
  white-space: nowrap;
}

.sort a {
  padding: 6px 0;
  text-decoration: none;
}

.sort a[aria-current] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--ink);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 36px;
  font: 700 1.125rem var(--display);
}

/* --- buttons --------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 24px;
  border: 0;
  border-radius: 0;
  background: var(--accent);
  color: #fff;
  font: 800 1.125rem/1 var(--display);
  letter-spacing: 0.05em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.btn--ghost {
  background: none;
  box-shadow: inset 0 0 0 2px var(--ink);
  color: var(--ink);
}

/* --- sections: rubrics a theme drops in with {% section %} ---------------------- */
.section + .section,
.hero + .section {
  margin-top: 40px;
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.section__more {
  color: var(--muted);
  font-size: 0.875rem;
  white-space: nowrap;
}

/* card badges: discount, bestseller, new */
.badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge--sale {
  background: var(--accent);
}

/* banners */
.banners {
  display: grid;
  gap: var(--gutter);
}

.banner {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 14px;
  background: var(--wash);
  color: inherit;
  text-decoration: none;
}

.banner img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
}

.banner__text {
  position: absolute;
  inset: auto 0 0 0;
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  background: linear-gradient(transparent, rgb(0 0 0 / 55%));
  color: #fff;
}

.banner__text strong {
  font: 700 1.25rem/1.2 var(--display);
}

.banner--plain .banner__text {
  position: static;
  background: none;
  color: var(--ink);
  padding: 22px;
}

/* category tiles */
.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gutter);
}

.tile {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: 14px;
  background: var(--wash);
  color: inherit;
  text-decoration: none;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile span {
  position: absolute;
  inset: auto 0 0 0;
  padding: 12px 14px;
  background: linear-gradient(transparent, rgb(0 0 0 / 55%));
  color: #fff;
  font-weight: 700;
}

.tile--plain span {
  position: static;
  display: grid;
  height: 100%;
  place-items: center;
  background: none;
  color: var(--ink);
  text-align: center;
}

@media (min-width: 700px) {
  .banners {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }

  .tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* --- home hero -------------------------------------------------------------------- */
.hero {
  position: relative;
  margin: 0 calc(-1 * var(--gutter)) 44px;
}

.hero img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.hero__text {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: -18px;
}

.hero h1 {
  font: 900 2.25rem/1.2 var(--display);
  text-transform: uppercase;
}

/* the title sits on strips of price-tag yellow, one per line */
.hero h1 span {
  padding: 2px 10px;
  background: var(--tag);
  color: var(--tag-ink);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.hero p {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  background: var(--paper);
}

.hero--plain {
  margin: 12px 0 36px;
}

.hero--plain .hero__text {
  position: static;
}

.hero--plain p {
  padding: 0;
  color: var(--muted);
}

/* --- product page ------------------------------------------------------------------- */
.gallery {
  display: flex;
  gap: 4px;
  margin: 0 calc(-1 * var(--gutter)) 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

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

/* the next photo peeks in from the right: a swipe hint that needs no script */
.gallery > * {
  flex: none;
  width: 88%;
  aspect-ratio: 4 / 5;
  background: var(--wash);
  object-fit: cover;
  scroll-snap-align: center;
}

.gallery--single > * {
  width: 100%;
}

.product h1 {
  font: 800 1.75rem/1.1 var(--display);
}

.product__price {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 20px;
}

.product__price s {
  color: var(--muted);
}

.product__out {
  margin-bottom: 16px;
  color: var(--muted);
}

.variants {
  margin-bottom: 20px;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.variants li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.variants .is-out {
  color: var(--muted);
}

.product__actions {
  display: grid;
  gap: 10px;
  margin-bottom: 28px;
}

.product__text {
  max-width: 62ch;
}

.product__text p {
  margin-bottom: 1em;
}

/* --- footer -------------------------------------------------------------------------- */
.foot {
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
}

.foot .brand {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 1.25rem;
}

.foot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-top: 10px;
  padding: 0;
  list-style: none;
}

/* --- wider screens --------------------------------------------------------------------- */
@media (min-width: 700px) {
  :root {
    --gutter: 24px;
  }

  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px 20px;
  }

  .top {
    padding-top: 20px;
  }

  .search {
    max-width: 420px;
    margin-left: max(0px, calc((100% - 1180px) / 2));
  }

  .heading {
    font-size: 2.75rem;
  }

  .hero img {
    aspect-ratio: 21 / 9;
  }

  .hero h1 {
    font-size: 3.5rem;
  }

  .product__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .product {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
  }

  /* no carousel on desktop: all photos in two columns, the text stays in view */
  .gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    overflow: visible;
  }

  .gallery > * {
    width: 100%;
  }

  .gallery--single {
    grid-template-columns: 1fr;
  }

  .product__info {
    position: sticky;
    top: 20px;
  }

  .product h1 {
    font-size: 2.25rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .gallery {
    scroll-behavior: smooth;
  }
}

/* --- cart and checkout -------------------------------------------------------- */
.cart-link {
  padding: 8px 0 8px 12px;
  font: 700 1rem/1 var(--display);
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.cart-link b {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--tag);
  color: var(--tag-ink);
}

.buy {
  margin-bottom: 16px;
}

.variants {
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}

.variants legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.875rem;
}

.variant {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 8px 8px 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  cursor: pointer;
}

.variant input {
  position: absolute;
  opacity: 0;
}

.variant:has(input:checked) {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.variant:has(input:focus-visible) {
  outline: 2px solid var(--accent);
}

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

.variant.is-out {
  color: var(--muted);
  text-decoration: line-through;
  cursor: default;
}

.buy .btn {
  width: 100%;
}

.lines {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.line {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.line__photo {
  display: block;
  aspect-ratio: 4 / 5;
  background: var(--wash);
}

.line__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.line__body a {
  text-decoration: none;
}

.line__price {
  margin-top: 2px;
  font-size: 0.875rem;
  color: var(--muted);
}

.line__amount {
  font: 800 1.125rem/1.5 var(--display);
  font-variant-numeric: tabular-nums;
}

.qty {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 8px;
}

.qty button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font: 700 1.125rem var(--display);
  cursor: pointer;
}

.qty output {
  min-width: 32px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.qty__remove {
  width: auto !important;
  margin-left: 10px;
  padding: 0 10px;
  border: 0 !important;
  color: var(--muted) !important;
  font: 0.875rem var(--body) !important;
}

.summary {
  display: grid;
  gap: 12px;
  max-width: 420px;
}

.summary__total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: 700 1.125rem var(--display);
  text-transform: uppercase;
}

.checkout {
  display: grid;
  gap: 32px;
}

.checkout__form {
  display: grid;
  gap: 16px;
  max-width: 480px;
}

.field label,
.field legend {
  display: block;
  margin-bottom: 6px;
  font-size: 0.875rem;
  color: var(--muted);
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--ink);
  outline: 0;
}

.has-error input,
.has-error textarea {
  border-color: var(--accent);
}

.field fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.field .choice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 1rem;
  cursor: pointer;
}

.choice input {
  width: auto;
  accent-color: var(--accent);
}

.choice small {
  margin-left: auto;
  color: var(--muted);
}

.error {
  margin-top: 6px;
  color: var(--accent);
  font-size: 0.875rem;
}

.heading--small {
  font-size: 1.25rem;
}

.mini {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.mini li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
}

.mini__total {
  font: 800 1.125rem var(--display);
  text-transform: uppercase;
}

.done {
  max-width: 480px;
}

.done__lead {
  margin-bottom: 20px;
  font-size: 1.125rem;
}

@media (min-width: 900px) {
  .checkout {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
  }
}

/* --- reviews: stars on cards, the summary on the product page, the section, the form --- */
.stars { color: #e5a50a; letter-spacing: 1px; white-space: nowrap; }
.stars i { font-style: normal; opacity: 0.25; }
.stars i.on { opacity: 1; }
.card__rating { display: block; margin-top: 2px; color: #e5a50a; font-size: 0.8125rem; }
.card__rating span { color: var(--muted, #76716a); }
.product__rating { margin: 0 0 12px; font-weight: 600; }
.product__rating a { margin-left: 4px; font-weight: 400; }
.reviews { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.review { padding: 14px 16px; border-radius: var(--radius, 12px); background: rgb(0 0 0 / 3%); }
.review p { margin: 0 0 6px; }
.review__meta { font-size: 0.875rem; }
.review__reply { padding: 8px 12px; border-left: 3px solid var(--accent, #0e7a53); font-size: 0.9375rem; }
.review-page { max-width: 640px; }
.review-form { display: grid; gap: 18px; margin: 18px 0; }
.review-item { padding: 14px 16px; border: 1px solid rgb(0 0 0 / 10%); border-radius: var(--radius, 12px); }
.review-item legend { display: flex; gap: 10px; align-items: center; padding: 0 6px; font-weight: 600; }
.review-item legend img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }
.review-item textarea { width: 100%; margin-top: 10px; }
.rating { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.rating input { position: absolute; opacity: 0; width: 0; height: 0; }
.rating label { cursor: pointer; font-size: 1.75rem; color: rgb(0 0 0 / 18%); transition: color 0.1s; }
.rating input:checked ~ label, .rating label:hover, .rating label:hover ~ label { color: #e5a50a; }
.rating input:focus-visible + label { outline: 2px solid var(--accent, #0e7a53); border-radius: 4px; }
.notice { padding: 10px 14px; border-radius: 10px; background: rgb(14 122 83 / 10%); }
