:root {
  --bg: #fbf7f0;
  --surface: #ffffff;
  --ink: #2a1f1a;
  --muted: #6f6158;
  --line: #e6dccd;
  --accent: #a3241d;
  --accent-dark: #7f1a15;
  --gold: #c58a1b;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

h1, h2, .logo { font-family: Georgia, "Times New Roman", serif; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.2; margin: 0 0 .5rem; }
h2 { font-size: 1.4rem; margin: 2rem 0 1rem; }
a { color: inherit; }
img { max-width: 100%; display: block; }

.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 16px; }

.notice {
  margin: 0;
  padding: 6px 16px;
  background: #fbe9c6;
  color: #5c4208;
  font-size: .875rem;
  text-align: center;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 3px solid var(--accent);
}
.header-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding-block: 12px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-family: inherit; font-size: 1.1rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #111; text-decoration: none; }
.logo img { flex: none; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 16px; order: 3; flex-basis: 100%; }
.nav a { text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-color: var(--gold); }
.cart-link { margin-left: auto; text-decoration: none; font-weight: 600; }
.cart-count {
  display: inline-block;
  min-width: 1.5em;
  padding: 0 .4em;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: .85rem;
  text-align: center;
}

@media (min-width: 760px) {
  .nav { order: 0; flex-basis: auto; }
}

.delivery-bar { margin: 0; padding: 8px 16px; background: var(--ink); color: #fff; font-weight: 600; text-align: center; }
.delivery-note { margin: 0 0 8px; color: var(--accent-dark); font-weight: 600; }

main { padding-block: 24px 48px; outline: none; min-height: 60vh; }

.hero {
  padding: clamp(24px, 5vw, 48px);
  margin-bottom: 32px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  border-bottom: 6px solid var(--gold);
}
.hero p { margin: 0; max-width: 40em; font-size: 1.1rem; }

.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.section-head a { color: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 20px; }

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-link { display: block; text-decoration: none; flex: 1; }
.card-link:hover .card-title { color: var(--accent); }
.card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: #f1e9dc; }
.card-body { padding: 12px 12px 0; }
.card-title {
  margin: 0;
  font-size: .95rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-foot { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.price { font-size: 1.25rem; font-weight: 700; white-space: nowrap; }
.stock-out { color: var(--muted); font-size: .9rem; }

.btn {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn:disabled { background: #cfc5b8; border-color: #cfc5b8; color: #5d534a; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { color: #fff; }

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

.back { display: inline-block; margin-bottom: 16px; color: var(--muted); }

.product { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 820px) {
  .product { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
}
.gallery-main { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; padding-bottom: 4px; }
.thumb { flex: none; padding: 0; border: 2px solid var(--line); border-radius: 6px; background: none; cursor: pointer; }
.thumb[aria-current="true"] { border-color: var(--accent); }
.thumb img { width: 60px; height: 80px; object-fit: cover; border-radius: 4px; }
.buy { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 16px 0; }
.description { white-space: pre-line; color: var(--ink); overflow-wrap: anywhere; }

.cart-line {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.cart-line img { width: 72px; height: 96px; object-fit: cover; border-radius: 6px; }
.cart-line-name { margin: 0 0 8px; }
.qty { display: inline-flex; align-items: center; gap: 4px; }
.qty button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font: inherit; cursor: pointer; }
.qty button:disabled { opacity: .5; cursor: not-allowed; }
.qty span { min-width: 2em; text-align: center; }
.link-btn { border: 0; background: none; padding: 0; margin-left: 12px; color: var(--muted); text-decoration: underline; font: inherit; cursor: pointer; }
.summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; }
.total { font-size: 1.4rem; font-weight: 700; }

.form { display: grid; gap: 16px; max-width: 560px; }
.field label { display: block; margin-bottom: 4px; font-weight: 600; }
.field input, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #b9ad9e;
  border-radius: 8px;
  background: var(--surface);
  font: inherit;
}
.field-error { margin: 4px 0 0; color: var(--accent); font-size: .9rem; }
.form-error { padding: 10px 12px; border-radius: 8px; background: #fbe4e2; color: var(--accent-dark); }
.hint { color: var(--muted); font-size: .95rem; }
.intro { max-width: 46em; margin: 0 0 20px; color: var(--muted); }
.seo-text { max-width: 60em; margin: 32px 0 0; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; padding: 0; list-style: none; }
.tags li { padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .9rem; }
.checks { margin: 0; padding: 0; border: 0; }
.checks legend { margin-bottom: 4px; padding: 0; font-weight: 600; }
.checks label { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-weight: 400; }
.field .checks input { width: auto; }
.trap { position: absolute; left: -9999px; }

.site-footer { padding-block: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.site-footer p { margin: 0; }
