:root {
  color-scheme: light;
  --paper: #fbf8f0;
  --surface: #fffdf8;
  --ink: #2d261f;
  --wine: #572633;
  --clay: #a74532;
  --muted: #675950;
  --edge: #dcd2c4;
  --hero: #eee4d3;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Avenir Next", "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 1.5rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); }
a { color: inherit; text-underline-offset: .24em; }
button, input { font: inherit; }
button { cursor: pointer; color: inherit; }
img { display: block; max-width: 100%; }
button:focus-visible, input:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--clay);
  outline-offset: 3px;
}
[hidden] { display: none !important; }
.shell { width: min(100% - 2.5rem, 1296px); margin-inline: auto; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.skip { position: absolute; top: .8rem; left: .8rem; z-index: 3; background: white; padding: .75rem; transform: translateY(-200%); }
.skip:focus { transform: none; }

.market-note {
  background: var(--wine);
  color: white;
  padding: .48rem 1rem;
  font-size: .76rem;
  font-weight: 650;
  text-align: center;
  letter-spacing: .06em;
}
.mast { border-bottom: 1px solid var(--edge); }
.mast-inner {
  min-height: 88px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(140px, 1fr);
  gap: 1rem;
  align-items: center;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  width: fit-content;
  color: var(--wine);
  text-decoration: none;
}
.brand img { flex: none; aspect-ratio: 1; object-fit: contain; }
.brand strong { display: block; font-family: var(--serif); font-size: 1.9rem; font-weight: 600; line-height: 1; letter-spacing: -.055em; }
.brand small { display: block; margin-top: .22rem; font-size: .63rem; font-weight: 750; letter-spacing: .15em; }
.mast nav { display: flex; justify-content: center; gap: clamp(.9rem, 3vw, 2.8rem); white-space: nowrap; }
.mast nav a, .footer > a:last-child { font-size: .87rem; font-weight: 700; text-decoration: none; }
.mast nav a:hover, .footer > a:last-child:hover { text-decoration: underline; }
.list-toggle {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 42px;
  padding: .32rem .55rem .32rem .8rem;
  border: 1px solid var(--edge);
  background: transparent;
  border-radius: 2rem;
  font-size: .83rem;
  font-weight: 720;
  white-space: nowrap;
}
.count {
  display: inline-grid;
  place-items: center;
  min-width: 1.45rem;
  min-height: 1.45rem;
  border-radius: 50%;
  background: var(--wine);
  color: white;
  font-size: .72rem;
}

.hero {
  display: grid;
  grid-template-columns: .91fr 1.09fr;
  min-height: clamp(390px, 40vw, 560px);
  margin-top: 1.25rem;
  background: var(--hero);
}
.hero-copy {
  align-self: center;
  padding: clamp(1.5rem, 5vw, 5.3rem);
}
.hero h1, .catalog h2, .purchase h2, .bag-head h2 {
  margin: 0;
  color: var(--wine);
  font: 500 clamp(2.35rem, 5vw, 4.5rem)/1 var(--serif);
  letter-spacing: -.052em;
}
.hero h1 { font-size: clamp(3rem, 6vw, 6rem); line-height: .93; }
.hero h1 em { color: #853b38; white-space: nowrap; }
.hero-copy p { max-width: 31ch; margin: 1.28rem 0 1.6rem; color: var(--muted); font-size: 1.04rem; line-height: 1.6; }
.hero-image { width: 100%; height: 100%; min-height: 0; max-height: 560px; object-fit: cover; object-position: 52% 54%; }
.button, .shop-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  width: fit-content;
  padding: .69rem .93rem;
  background: var(--wine);
  color: white;
  font-size: .83rem;
  font-weight: 700;
  text-decoration: none;
}
.button { gap: 1rem; padding: .81rem 1rem; }
.button:hover, .shop-link:hover { background: #713747; }

.catalog { padding-block: clamp(2.4rem, 5vw, 4.65rem); }
.catalog-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: .7rem;
}
#catalog-count { color: var(--muted); font-size: .8rem; }
.catalog-tools { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-block: 1.3rem; }
.filters { display: flex; flex-wrap: wrap; gap: .42rem; }
.filters button, .search input {
  min-height: 40px;
  padding: .49rem .82rem;
  border: 1px solid var(--edge);
  border-radius: 2rem;
  background: var(--surface);
  font-size: .82rem;
}
.filters button { font-weight: 650; }
.filters button:hover { border-color: var(--wine); }
.filters button[aria-pressed="true"] { background: var(--wine); border-color: var(--wine); color: white; }
.search { flex: 0 1 260px; }
.search input { width: 100%; color: var(--ink); }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.product-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--edge);
  background: var(--surface);
}
.product-illustration { position: relative; background: #eee8de; }
.product-illustration img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.save {
  position: absolute;
  top: .7rem;
  right: .7rem;
  min-height: 36px;
  padding: .32rem .64rem;
  border: 1px solid transparent;
  border-radius: 2rem;
  background: var(--surface);
  color: var(--wine);
  font-size: .76rem;
  font-weight: 700;
}
.save:hover, .save[aria-pressed="true"] { border-color: var(--wine); }
.save[aria-pressed="true"] { background: var(--wine); color: white; }
.product-details { display: flex; flex: 1; flex-direction: column; padding: 1.06rem; }
.product-details .category { margin: 0 0 .4rem; color: var(--clay); font-size: .69rem; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.product-title { margin: 0; color: var(--wine); font: 500 clamp(1.18rem, 2.1vw, 1.7rem)/1.15 var(--serif); }
.product-details p:not(.category) { margin: .57rem 0 .9rem; color: var(--muted); font-size: .87rem; line-height: 1.5; }
.product-details p.price { margin-top: auto; color: var(--ink); font-size: 1.02rem; font-weight: 740; }
.shop-link { margin-top: auto; }
.shop-link span[aria-hidden="true"] {
  position: relative;
  display: inline-block;
  width: .55rem;
  height: .55rem;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  font-size: 0;
}
.shop-link span[aria-hidden="true"]::before {
  position: absolute;
  top: 100%;
  left: 0;
  width: .74rem;
  height: 1px;
  background: currentColor;
  transform: rotate(-45deg);
  transform-origin: left;
  content: "";
}
.catalog-note { color: var(--muted); font-size: .8rem; line-height: 1.55; margin-top: 1rem; }

.purchase { background: #f0e7db; border-block: 1px solid var(--edge); }
.purchase-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; padding-block: 2.25rem; }
.purchase h2 { font-size: clamp(2rem, 4vw, 3.35rem); }
.purchase p { margin: 0 0 .7rem; color: var(--muted); line-height: 1.6; }
.purchase summary { color: var(--wine); cursor: pointer; font-size: .88rem; font-weight: 700; }
.purchase details p { margin-top: .6rem; font-size: .88rem; }
.footer { min-height: 115px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1.15rem; padding-block: 1.5rem; }
.footer .brand strong { font-size: 1.35rem; }
.footer p { margin: 0; color: var(--muted); font-size: .84rem; }

html.bag-open { overflow: hidden; }
#bag-dialog { width: min(486px, calc(100% - 2rem)); max-height: 85dvh; padding: 1.3rem; border: 1px solid var(--edge); color: var(--ink); background: var(--paper); }
#bag-dialog::backdrop { background: #352128a3; }
.bag-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.bag-head h2 { font-size: 2rem; }
.close { border: 1px solid var(--edge); background: var(--surface); min-width: 41px; min-height: 41px; font-size: 1.45rem; }
.bag-summary, .bag-note, #bag-empty { font-size: .86rem; color: var(--muted); }
#bag-items { list-style: none; padding: 0; }
.bag-item { display: flex; align-items: center; gap: .7rem; padding-block: .65rem; border-block-end: 1px solid var(--edge); }
.bag-item-image { flex: 0 0 65px; width: 65px; height: 49px; object-fit: cover; }
.bag-item-info { display: grid; gap: .2rem; min-width: 0; flex: 1; }
.bag-item-vendor, .bag-item-shop, .bag-item-remove { font-size: .8rem; }
.bag-item-title { font-size: .9rem; }
.bag-item-shop { color: var(--wine); }
.bag-item-remove { padding: .4rem; border: 1px solid var(--edge); background: var(--surface); }

@media (max-width: 800px) {
  .mast-inner { grid-template-columns: 1fr 1fr; padding-block: .7rem; gap: .65rem; }
  .mast nav { grid-row: 2; grid-column: 1 / -1; justify-content: flex-start; }
  .list-toggle { grid-column: 2; grid-row: 1; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .shell { width: calc(100% - 1.5rem); }
  .brand strong { font-size: 1.5rem; }
  .mast .brand img { width: 43px; height: 43px; }
  .mast nav a { font-size: .76rem; }
  .hero { grid-template-columns: 1fr; margin-top: .75rem; }
  .hero-copy { padding: 1.75rem 1.25rem; }
  .hero-image { max-height: 300px; aspect-ratio: 5 / 3; }
  .catalog-tools { align-items: stretch; flex-direction: column; gap: .65rem; }
  .search { flex: auto; }
  .product-grid { gap: .65rem; }
  .product-details { padding: .72rem; }
  .shop-link { flex-wrap: wrap; padding-inline: .62rem; font-size: .75rem; }
  .purchase-inner { grid-template-columns: 1fr; }
}
@media (max-width: 355px) {
  .product-grid { grid-template-columns: 1fr; }
}
