:root {
  color-scheme: light;
  --ink: #17231d;
  --paper: #fbfaf7;
  --line: #d5d9d3;
  --accent: #20583c;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header,
main {
  max-width: 1320px;
  margin: auto;
  padding: 0 clamp(16px, 5vw, 70px);
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
  border-bottom: 1px solid var(--line);
  gap: 10px;
}
#brand {
  color: inherit;
  text-decoration: none;
  font:
    600 clamp(18px, 3vw, 27px) Georgia,
    serif;
  overflow-wrap: anywhere;
}
button,
input {
  font: inherit;
}
button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  padding: 9px 14px;
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: default;
}
button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid #477f55;
  outline-offset: 3px;
}
input {
  width: 100%;
  min-width: 0;
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 10px;
  border-radius: 6px;
}
.catalog-head,
.cart-title,
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.catalog-head {
  margin: 45px 0 24px;
}
h1,
h2 {
  font:
    500 clamp(36px, 6vw, 68px)/1.05 Georgia,
    serif;
  margin: 0;
}
h2 {
  font-size: 32px;
}
#search {
  display: flex;
  gap: 5px;
}
#products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr));
  gap: 26px 18px;
}
.product {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 10px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}
.product img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: contain;
  background: white;
  border-radius: 8px;
}
.product h3 {
  margin: 0;
  font:
    500 22px/1.2 Georgia,
    serif;
  overflow-wrap: anywhere;
}
.card-foot {
  margin-top: auto;
}
#confirm,
.add {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
#more {
  margin: 24px 0;
}
#status:empty,
#receipt:empty {
  display: none;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  width: min(470px, calc(100% - 24px));
  max-height: 90dvh;
  padding: 24px;
  color: var(--ink);
  background: var(--paper);
}
dialog::backdrop {
  background: #15251d77;
}
#items {
  list-style: none;
  padding: 0;
}
#items li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}
#items li span {
  flex: 1;
  overflow-wrap: anywhere;
}
#summary {
  font-size: 18px;
  font-weight: 600;
  margin: 12px 0;
}
#checkout {
  display: grid;
  gap: 12px;
}
#checkout label {
  display: grid;
  gap: 5px;
  font-size: 14px;
}
small {
  color: #4f6257;
}
[hidden] {
  display: none !important;
}
@media (max-width: 550px) {
  header {
    min-height: 64px;
  }
  .catalog-head {
    margin: 28px 0 20px;
    align-items: flex-start;
    flex-direction: column;
  }
  #search {
    width: 100%;
  }
  #products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 10px;
  }
  .product h3 {
    font-size: 18px;
  }
  .card-foot {
    align-items: flex-start;
    flex-direction: column;
  }
}
