:root {
  --paper: #f4ece4;
  --ink: #1c1214;
  --pink: #d4537e;
  --pink-d: #b13c64;
  --muted: #6b534e;
  --card: #fffaf6;
  --line: #e4d4c8;
  --stamp: #f7d5e0;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  background:
    radial-gradient(circle at 12% 8%, #fbe8ee 0, transparent 32%),
    var(--paper);
  color: var(--ink);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

.mast { padding: 28px 22px 8px; max-width: 1100px; margin: 0 auto; }
.mast-row { display: flex; justify-content: space-between; align-items: baseline; }
.mark {
  font-size: 28px;
  letter-spacing: 0.02em;
  font-weight: 700;
}
.dot {
  display: inline-block;
  width: 10px; height: 10px;
  background: var(--pink);
  border-radius: 50%;
  margin-left: 6px;
  transform: translateY(-6px);
}
nav { display: flex; gap: 18px; align-items: center; font-size: 15px; }
.cart-btn {
  border: 1.5px solid var(--ink);
  background: transparent;
  padding: 4px 10px;
  border-radius: 999px;
}
.cart-btn .count {
  background: var(--pink);
  color: white;
  font-size: 12px;
  padding: 1px 7px;
  border-radius: 999px;
  margin-left: 4px;
}
.tag {
  font-style: italic;
  font-size: 22px;
  margin: 18px 0 6px;
}
.lede { max-width: 38em; color: var(--muted); margin: 0 0 8px; line-height: 1.4; }
.price-line { font-size: 15px; margin: 0; }

.disclaimer {
  max-width: 1100px;
  margin: 18px auto 0;
  padding: 10px 14px;
  border-left: 3px solid var(--pink);
  background: var(--stamp);
  color: #4a2a34;
  font-size: 13px;
  line-height: 1.4;
}

main { max-width: 1100px; margin: 0 auto; padding: 22px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}
.empty { text-align: center; color: var(--muted); padding: 48px 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 3px 0 rgba(28,18,20,0.04);
}
.card .pic {
  aspect-ratio: 3 / 4;
  width: 100%;
  object-fit: contain;
  background: #efe4da;
  cursor: pointer;
}
.card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.card h3 { margin: 0; font-size: 17px; line-height: 1.2; cursor: pointer; }
.card .sku { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--muted); }
.card .row { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.badge {
  display: inline-block;
  background: var(--pink);
  color: white;
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  width: fit-content;
}
.add {
  background: var(--pink);
  color: white;
  border: 0;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
}
.add:hover { background: var(--pink-d); }
.add[disabled] { opacity: 0.5; cursor: default; }

.modal, .drawer {
  position: fixed; inset: 0;
  background: rgba(28,18,20,0.45);
  display: grid;
  place-items: center;
  z-index: 20;
  padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top));
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}
.modal[hidden], .drawer[hidden] { display: none; }
.modal-card {
  background: var(--card);
  max-width: 820px;
  width: 100%;
  max-height: 100%;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  grid-template-rows: auto 1fr;
  position: relative;
  border-radius: 6px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.back-bar {
  grid-column: 1 / -1;
  border: 0;
  background: var(--ink);
  color: white;
  text-align: left;
  padding: 12px 16px;
  font-size: 16px;
  position: sticky;
  top: 0;
  z-index: 2;
}
.modal-card img { width: 100%; height: 100%; object-fit: contain; min-height: 220px; max-height: 55vh; background: #efe4da; }
.modal-copy { padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.modal-copy h2 { margin: 0; font-size: 28px; }
.sku { font-family: ui-monospace, Menlo, monospace; color: var(--muted); font-size: 12px; }
.tagline { color: var(--muted); margin: 0; }
.money { font-size: 22px; margin: 8px 0; }
.back {
  margin-top: 8px;
  width: 100%;
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  padding: 12px;
  border-radius: 4px;
  font-size: 16px;
}
.x {
  position: absolute; top: 8px; right: 10px;
  border: 0; background: transparent; font-size: 28px; line-height: 1; color: var(--ink);
}

.drawer { justify-items: end; align-items: stretch; }
.drawer-card {
  background: var(--card);
  width: min(380px, 100%);
  height: 100%;
  padding: 18px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer-head h2 { margin: 0; }
.drawer-card ul { list-style: none; padding: 0; margin: 12px 0; flex: 1; overflow: auto; }
.drawer-card li {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.drawer-card li img { width: 56px; height: 56px; object-fit: cover; background: #efe4da; }
.rm { border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.checkout {
  width: 100%;
  background: var(--ink);
  color: white;
  border: 0;
  padding: 12px;
  border-radius: 4px;
}
.checkout[disabled] { opacity: 0.45; }
.soon { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.cart-empty { color: var(--muted); }

footer {
  max-width: 1100px;
  margin: 24px auto 40px;
  padding: 0 22px;
  color: var(--muted);
  font-size: 14px;
}
.tiny { font-size: 12px; }

.soon-banner {
  margin: 0;
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: var(--ink);
  color: #fffaf6;
  text-align: center;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.soon-banner strong { color: var(--stamp); }

@media (max-width: 700px) {
  .modal {
    padding: 0;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    place-items: stretch;
  }
  .modal-card {
    grid-template-columns: 1fr;
    max-width: none;
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
  }
  .modal-card img { min-height: 0; max-height: 42vh; }
  .modal-copy { padding: 16px 16px 28px; }
  .mark { font-size: 24px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
