@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/source-sans-3-ext.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/source-sans-3.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  color-scheme: light;
  --paper: #faf9f6;
  --plain: #fffefa;
  --ink: #2c2722;
  --secondary: #554d45;
  --muted: #6e655c;
  --line: #e0dad2;
  --soft: #eee9e0;
  --accent: #5b3829;
  --danger: #903347;
  --radius: 8px;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-variant-numeric: tabular-nums;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; font-size: 16px; line-height: 1.45; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 4px; }
button, input, textarea, select { font: inherit; }
button, .primary, .secondary {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--plain);
  color: var(--ink);
  cursor: pointer;
  font-weight: 600;
}
button:hover:not(:disabled), .secondary:hover { background: var(--soft); }
button:disabled { opacity: .58; cursor: not-allowed; }
.primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  border-color: var(--accent);
  color: var(--plain);
  text-decoration: none;
}
.primary:hover, button.primary:hover:not(:disabled) { background: #492e23; }
select, input:not([type=checkbox]), textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--plain);
  color: var(--ink);
}
input[type=checkbox] { width: 16px; height: 16px; flex: 0 0 16px; accent-color: var(--accent); }
textarea { min-height: 76px; resize: vertical; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-weight: 500; line-height: 1.12; }
h2 { font-size: clamp(24px, 3vw, 34px); }
h3 { font-weight: 600; }
.wrap { width: min(1320px, calc(100% - 64px)); margin-inline: auto; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip:focus { position: fixed; z-index: 20; top: 16px; left: 16px; background: var(--plain); padding: 12px; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.icon { display: block; width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }

.masthead { background: var(--plain); border-bottom: 1px solid var(--line); }
.header-shell {
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(152px, 1fr) minmax(220px, 560px) minmax(max-content, 1fr);
  align-items: center;
  gap: 32px;
}
.brand { display: inline-flex; width: fit-content; align-items: center; }
.brand img { width: 156px; height: auto; display: block; }
.search {
  display: grid;
  grid-template-columns: 1fr 44px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.search:focus-within { border-color: var(--muted); }
.search input { border: 0; background: transparent; min-height: 42px; }
.search button { min-height: 42px; display: grid; place-items: center; border: 0; background: transparent; padding: 0; }
.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 4px; }
.header-actions button { display: flex; align-items: center; gap: 8px; color: var(--secondary); border-color: transparent; background: transparent; padding-inline: 8px; }
#cart-count { min-width: 16px; color: var(--accent); }
.nav-shell { border-top: 1px solid var(--line); }
.nav-row { display: flex; justify-content: space-between; align-items: stretch; gap: 16px; }
.category-nav { min-height: 48px; display: flex; flex-wrap: wrap; gap: 24px; }
.category-nav button {
  min-height: 48px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--secondary);
  padding: 8px 0;
  font-weight: 500;
  white-space: nowrap;
}
.category-nav button:hover:not(:disabled) { color: var(--accent); background: transparent; }
.category-nav button[aria-pressed=true] { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }
.visit-link { display: flex; align-items: center; color: var(--muted); font-size: 14px; white-space: nowrap; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  min-height: clamp(300px, 31vw, 416px);
  margin-top: 20px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--soft);
}
.hero-copy { align-self: center; min-width: 0; padding: clamp(24px, 3.2vw, 48px); }
.hero:not(.hero-campaign) { grid-template-columns: 1fr; min-height: 0; }
.hero:not(.hero-campaign) .hero-copy { padding-block: 28px; }
.hero h1 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(34px, 4vw, 56px);
  font-weight: 400;
  letter-spacing: -.03em;
  overflow-wrap: anywhere;
}
.hero-campaign h1 { font-size: clamp(32px, 3.2vw, 46px); }
.hero:not(.hero-campaign) h1 { font-size: clamp(28px, 4vw, 46px); }
#hero-description { color: var(--secondary); margin-top: 12px; max-width: 34ch; overflow-wrap: anywhere; }
.hero-link { margin-top: 24px; text-align: start; }
.hero-link span { overflow-wrap: anywhere; }
.hero-photo { display: block; position: relative; min-width: 0; min-height: 100%; background: var(--soft); }
.hero-photo img { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.banner-controls { display: flex; align-items: center; gap: 8px; margin-top: 16px; color: var(--secondary); font-size: 14px; }
.banner-controls button { display: grid; place-items: center; min-width: 44px; padding: 0; background: transparent; }
#banner-count { min-width: 44px; text-align: center; }

.catalog { padding-block: 40px 48px; scroll-margin-top: 16px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-head p:not(:empty) { margin-top: 4px; }
.catalog-tools { display: flex; align-items: center; gap: 8px; }
.catalog-tools button { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.catalog-tools select { width: auto; }
.catalog-tools [aria-pressed=true], .admin-list [aria-pressed=true] { border-color: var(--accent); color: var(--accent); background: var(--soft); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 16px; }
.product-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--plain); }
.card-media { position: relative; }
.image-button { display: block; width: 100%; border: 0; border-radius: 0; padding: 0; aspect-ratio: 4 / 3; overflow: hidden; background: var(--soft); }
.image-button img, .detail-image { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-favorite { display: grid; place-items: center; position: absolute; top: 8px; right: 8px; min-width: 44px; padding: 0; color: var(--accent); }
.card-favorite[aria-pressed=true] .icon, #favorites[aria-pressed=true] .icon { fill: currentColor; }
.card-body { display: flex; flex-direction: column; flex: 1; align-items: start; gap: 4px; padding: 12px; }
.card-body h3 { font-size: 18px; line-height: 1.28; overflow-wrap: anywhere; }
.card-body h3 button { min-height: auto; border: 0; padding: 0; text-align: left; background: transparent; }
.card-body h3 button:hover { text-decoration: underline; background: transparent; }
.card-price { font-size: 18px; font-weight: 600; margin-block: auto 4px; }
.card-add { width: 100%; margin-top: 4px; }
.empty { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--secondary); background: var(--plain); }

.visit {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  border-top: 1px solid var(--line);
  padding-block: 32px 48px;
}
.visit h2 { margin-bottom: 8px; }
.visit p, .visit address { color: var(--secondary); }
.visit address { font-style: normal; margin-bottom: 8px; }
.visit a, .footer-inner > a:last-child { color: var(--accent); }
footer { margin-top: auto; background: var(--soft); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; min-height: 76px; gap: 16px; }
.footer-inner .brand img { width: 120px; }

dialog {
  width: min(852px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
}
dialog::backdrop { background: #29231e80; }
.side { width: min(100%, 584px); height: 100%; max-height: 100%; padding: 20px; margin: 0 0 0 auto; border-radius: 0; overflow: auto; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 16px; }
.close { padding: 0 12px; font-size: 24px; min-width: 44px; line-height: 1; }
#product-dialog > .close { position: absolute; top: 8px; right: 8px; }
.product-detail { display: grid; grid-template-columns: 1fr .9fr; }
.detail-media { min-width: 0; background: var(--soft); }
.detail-main { aspect-ratio: 4 / 3; }
.detail-copy { padding: 56px 20px 20px; }
.detail-copy h2 { margin: 4px 0 12px; overflow-wrap: anywhere; }
.detail-copy .description { margin-block: 8px; white-space: pre-wrap; }
.detail-copy .price { font-size: 24px; font-weight: 600; }
.detail-copy .primary { margin: 12px 4px 4px 0; }
.thumbs { display: flex; gap: 8px; padding: 8px; overflow: auto; }
.thumbs button { padding: 0; flex: 0 0 64px; height: 56px; overflow: hidden; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
fieldset { margin: 16px 0 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
legend { font-weight: 600; padding-inline: 4px; }
label { display: block; font-size: 15px; font-weight: 600; }
label input, label textarea, label select { display: block; margin-top: 4px; font-weight: 400; }
label small { font-weight: 400; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.wide { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { margin: 0; }
.full { width: 100%; }
.cart-line { border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; align-items: center; }
.cart-line img { width: 72px; height: 60px; border-radius: 4px; object-fit: cover; }
.cart-line h3 { font-size: 16px; overflow-wrap: anywhere; }
.quantity { display: flex; align-items: center; gap: 4px; }
.quantity button { padding: 4px 8px; }
.quote-list { margin: 16px 0 0; }
.quote-list div { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; }
.quote-list dd { margin: 0; }
.quote-list .total { font-size: 18px; border-top: 1px solid var(--line); font-weight: 600; margin-top: 4px; padding-top: 4px; }
.status { color: var(--danger); margin: 12px 0; }
.status:empty { margin: 0; }
.toast { position: fixed; bottom: 16px; right: 16px; left: auto; max-width: calc(100% - 32px); background: var(--ink); color: white; padding: 12px 16px; border-radius: var(--radius); z-index: 15; }
#checkout fieldset > p, #payment-unavailable, #send-code p { margin-block: 12px; }
#send-code button, #verify-code button { margin-top: 12px; }
.order-link { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
.orders-table { overflow: auto; }
.simple-shell { width: min(660px, calc(100% - 32px)); margin: 48px auto; }
.simple-shell .brand { margin-bottom: 24px; }
.simple-panel { background: var(--plain); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.simple-panel h1 { font-size: 40px; margin-bottom: 12px; }
.simple-panel p { margin-bottom: 8px; }
.simple-panel form { display: grid; gap: 12px; }
.simple-panel .links { display: flex; flex-wrap: wrap; gap: 8px; }

.admin-shell { padding-block: 32px; }
.admin-heading { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-bottom: 20px; }
.admin-heading h1 { font-size: clamp(28px, 4vw, 44px); }
.admin-layout, .campaign-editor { display: grid; grid-template-columns: minmax(180px, .75fr) minmax(0, 1.25fr); gap: 20px; }
.admin-section { padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--plain); margin-bottom: 16px; }
.admin-section h2 { font-size: 26px; margin-bottom: 16px; }
.admin-section h3 { margin: 12px 0; }
.admin-section form > .primary, .admin-section fieldset > .primary { margin-top: 16px; }
.admin-list { display: grid; gap: 8px; margin-top: 8px; }
.admin-list button { text-align: left; overflow-wrap: anywhere; }
#campaign-fields { margin: 0; }
.campaign-image-field { display: grid; align-content: start; gap: 8px; min-width: 0; }
.campaign-image-field img { width: 100%; max-height: 160px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; }
.campaign-image-field button { justify-self: start; }
#campaign-status:not([data-error]) { color: var(--secondary); }
.photo-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.photo-row figure { margin: 0; width: 88px; }
.photo-row img { width: 88px; height: 64px; object-fit: cover; }
.photo-row button { font-size: 13px; width: 100%; padding: 4px; }
.admin-order { padding: 12px 0; border-bottom: 1px solid var(--line); }
.admin-order p { margin: 4px 0; }

@media (max-width: 960px) {
  .wrap { width: calc(100% - 40px); }
  .header-shell { gap: 16px; grid-template-columns: 132px minmax(0, 1fr) max-content; }
  .header-shell .brand img { width: 132px; }
  .category-nav { gap: 16px; }
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr); }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .visit-link { display: none; }
  .nav-row { display: block; }
  .category-nav { justify-content: space-between; gap: 8px; }
  .campaign-editor { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 640px) {
  .wrap { width: calc(100% - 24px); }
  .header-shell {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 8px;
    padding-block: 8px;
  }
  .header-shell .brand img { width: 124px; }
  .header-actions button { padding-inline: 8px; }
  .header-actions button span:not(#cart-count) { display: none; }
  .search { grid-row: 2; grid-column: 1 / -1; }
  .search input { font-size: 16px; }
  .category-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 8px; padding: 0; }
  .category-nav button { font-size: 14px; padding-inline: 4px; min-height: 40px; }
  .hero { grid-template-columns: 1fr; margin-top: 12px; min-height: 0; }
  .hero-copy { padding: 20px; }
  .hero:not(.hero-campaign) .hero-copy { padding-block: 20px; }
  .hero h1 { font-size: clamp(28px, 7.9vw, 38px); }
  .hero-campaign h1 { font-size: clamp(28px, 7vw, 36px); }
  #hero-description { margin-top: 8px; }
  .hero-link { margin-top: 12px; }
  .hero-photo { aspect-ratio: 720 / 414; }
  .catalog { padding-block: 28px 32px; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 8px; margin-bottom: 12px; }
  .catalog-tools { width: 100%; }
  .catalog-tools button, .catalog-tools select { font-size: 14px; padding-inline: 8px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 8px; }
  .card-body { padding: 8px; }
  .card-body h3, .card-price { font-size: 16px; }
  .card-favorite { top: 4px; right: 4px; }
  .card-add { padding-inline: 4px; font-size: 14px; }
  .visit { grid-template-columns: 1fr; gap: 12px; padding-block: 24px 32px; }
  .footer-inner { min-height: 64px; font-size: 14px; }
  .side { padding: 12px; }
  .form-grid { gap: 8px; }
  .cart-line { grid-template-columns: 52px minmax(0, 1fr) auto; gap: 8px; }
  .cart-line img { width: 52px; height: 48px; }
  .product-detail, .admin-layout { grid-template-columns: 1fr; }
  .detail-copy { padding: 16px; }
  .admin-section { padding: 12px; }
  .campaign-image-field { grid-column: 1 / -1; }
}
