:root {
  --paper: #f5efdf;
  --cream: #fffaf0;
  --ink: #34271f;
  --muted: #796959;
  --brown: #79441f;
  --brown-dark: #542c16;
  --navy: #234e63;
  --line: #ded1bc;
  --gold: #d5a264;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body.market {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

.market a { color: inherit; }
.market button, .market input, .market select { font: inherit; }
.market button { cursor: pointer; }
.market button:disabled { opacity: .55; cursor: wait; }
.market img { max-width: 100%; }
.market :focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
}
.skip-link:focus {
  top: 12px;
  background: white;
  padding: 12px;
}

.site-header {
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1240px;
  margin: auto;
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.brand {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-name {
  display: block;
  font: bold 27px Georgia, serif;
  letter-spacing: -.7px;
}
.brand-subtitle {
  display: block;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
}
.brand-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
}
.site-nav a {
  text-decoration: none;
  font-size: 14px;
  font-weight: bold;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--brown);
}
.nav-cart {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 13px;
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: radial-gradient(
    ellipse at 65% 35%,
    #78502b 0,
    #382417 48%,
    #201a15 100%
  );
  color: white;
  text-align: center;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    0deg,
    #160f0ab8,
    #160f0a15 65%
  );
}
.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
.hero-content {
  max-width: 900px;
  margin: auto;
  padding: 92px 24px 86px;
}
.hero-kicker {
  margin: 0 0 14px;
  color: #efd5ad;
  letter-spacing: 5px;
  font-size: 12px;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0;
  font: normal clamp(40px, 6vw, 74px)/1.08 Georgia, serif;
  letter-spacing: -1.5px;
  text-shadow: 0 2px 18px #0008;
}
.hero-subtitle {
  font: 24px Georgia, serif;
  margin: 20px 0 28px;
  color: #fbefdb;
}
.hero-description {
  max-width: 610px;
  margin: 18px auto 0;
  color: #f1e5d4;
}
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--brown);
  color: white;
  text-decoration: none;
  font-weight: bold;
  font-size: 14px;
  box-shadow: 0 3px 8px #39251415;
}
.market a.button { color: white; }
.button:hover { background: var(--brown-dark); }
.button--navy { background: var(--navy); }
.button--navy:hover { background: #173849; }
.hero-actions .button {
  min-width: 240px;
  border-color: #ffffff70;
}
.button--outline {
  background: transparent;
  color: var(--brown);
  border-color: var(--line);
  box-shadow: none;
}
.market a.button--outline { color: var(--brown); }
.button--outline:hover { background: #eee3d0; }

.hero--shop .hero-content { padding: 58px 24px 76px; }
.hero--shop h1 { font-size: clamp(38px, 5vw, 58px); }
.hero--shop .hero-subtitle {
  font: 16px Arial, sans-serif;
  max-width: 650px;
  margin: 18px auto 0;
}

.benefits {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1140px;
  margin: auto;
  padding: 36px 24px;
  text-align: center;
}
.benefit-icon {
  display: block;
  margin-bottom: 6px;
  font-size: 27px;
  color: var(--brown);
}
.benefits h2 {
  margin: 0;
  font: bold 17px Georgia, serif;
}
.benefits p {
  margin: 5px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.section {
  max-width: 1200px;
  margin: auto;
  padding: 48px 30px;
}
.section-heading {
  text-align: center;
  margin-bottom: 30px;
}
.section-heading h2 {
  margin: 0 0 12px;
  font: normal clamp(28px, 4vw, 40px) Georgia, serif;
}
.section-heading p {
  max-width: 680px;
  margin: auto;
  color: var(--muted);
}
.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.choice-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 30px;
}
.choice-card h3 {
  margin: 0 0 10px;
  font: 27px Georgia, serif;
}
.choice-card p {
  color: var(--muted);
  margin: 0 0 22px;
}

.shop-shell {
  max-width: 1240px;
  margin: -24px auto 0;
  padding: 0 30px 60px;
  position: relative;
}
.shop-tools {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: 0 6px 20px #3824170c;
}
.category-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.category-tab {
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 10px 18px;
  background: transparent;
  color: var(--ink);
  font-weight: bold;
}
.category-tab:hover { background: #eee3d0; }
.category-tab[aria-pressed="true"] {
  background: var(--brown);
  color: white;
}
.shop-note {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 16px 0 0;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}
.product-card {
  min-width: 0;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 20px #38241708;
}
.product-media {
  position: relative;
  background: #e9decd;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.product-photo-button {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
}
.product-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.photo-placeholder {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  padding: 20px;
}
.favorite-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #ffffffa0;
  border-radius: 50%;
  background: #fffbf0e8;
  color: var(--brown);
  font-size: 25px;
}
.favorite-button[aria-pressed="true"] {
  background: var(--brown);
  color: white;
}
.light-toggle {
  display: block;
  margin: 12px auto 0;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #f1e6d4;
  color: var(--brown);
  font-size: 12px;
}
.product-body { padding: 18px 20px 20px; }
.product-name {
  font: bold 22px/1.25 Georgia, serif;
  margin: 0 0 8px;
}
.product-name button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  text-align: left;
}
.product-price {
  font-size: 21px;
  font-weight: bold;
  margin: 0;
}
.stock-note {
  margin: 5px 0 15px;
  font-size: 12px;
  color: var(--muted);
}
.product-body .button { width: 100%; }
.product-feedback {
  font-size: 13px;
  color: var(--brown);
  margin: 10px 0 0;
  overflow-wrap: anywhere;
}
.shop-status {
  text-align: center;
  color: var(--muted);
  padding: 24px;
}
.empty-state {
  grid-column: 1 / -1;
  padding: 50px 24px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
}
.empty-state h2 { font: 28px Georgia, serif; }

.product-dialog {
  width: min(940px, 94vw);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--cream);
  color: var(--ink);
  padding: 24px;
}
.product-dialog::backdrop { background: #201a15b8; }
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.dialog-head h2 {
  font: 30px Georgia, serif;
  margin: 0;
}
.dialog-close {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 6px;
  width: 40px;
  height: 40px;
  font-size: 22px;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
}
.detail-photo {
  width: 100%;
  height: 360px;
  object-fit: contain;
  background: #e9decd;
  border-radius: 8px;
}
.detail-description {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--muted);
}
.detail-thumbnails {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.detail-thumbnails button {
  padding: 3px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 5px;
}
.detail-thumbnails button[aria-pressed="true"] {
  border: 2px solid var(--brown);
  padding: 2px;
}
.detail-thumbnails img {
  width: 64px;
  height: 56px;
  object-fit: contain;
  display: block;
}
.detail-quantity {
  display: block;
  margin: 20px 0;
}
.detail-quantity input {
  width: 80px;
  margin-left: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.about-section {
  background: #eee3d0;
  border-top: 1px solid var(--line);
}
.about-section .section {
  max-width: 850px;
  text-align: center;
}
.about-section h2 { font: 32px Georgia, serif; }
.about-section p { color: var(--muted); }
.site-footer {
  padding: 28px 24px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.site-footer p { margin: 5px 0; }

.market .litho-cart {
  background: var(--cream);
  color: var(--ink);
  border-color: var(--line);
}
.market .cart-row { border-color: var(--line); }
.market .cart-row img { background: #e9decd; }
.market .cart-row input {
  background: white;
  color: var(--ink);
  border-color: var(--line);
}
.market .cart-notice { color: var(--muted); }
.market .litho-cart button {
  background: #e9decd;
  color: var(--ink);
}
.market .litho-cart .cart-checkout {
  background: var(--brown);
  color: white;
}

@media (max-width: 960px) {
  .header-inner {
    flex-direction: column;
    gap: 14px;
    padding: 16px 20px;
  }
  .site-nav {
    justify-content: center;
    gap: 18px;
  }
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .brand-name { font-size: 24px; }
  .site-nav { gap: 12px; }
  .site-nav a { font-size: 12px; }
  .nav-cart { font-size: 11px; }
  .hero-content { padding: 64px 20px; }
  .hero-subtitle { font-size: 21px; }
  .hero-actions { gap: 12px; }
  .hero-actions .button {
    width: 100%;
    max-width: 320px;
  }
  .benefits {
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    padding: 30px 20px;
  }
  .section { padding: 36px 20px; }
  .choice-grid, .product-grid, .detail-grid {
    grid-template-columns: 1fr;
  }
  .shop-shell { padding: 0 18px 40px; }
  .shop-tools { padding: 12px; }
  .category-tabs { gap: 5px; }
  .category-tab {
    font-size: 12px;
    padding: 9px 12px;
  }
  .product-dialog { padding: 18px; }
  .detail-photo { height: 280px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Sold-out designs remain browsable. */
.stock-badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 6px;
  font-weight: 700;
}
.stock-badge--out { color: #793e29; background: #f9e6d9; }
.product-add:disabled, #detailAdd:disabled { cursor: not-allowed; opacity: .65; }
.detail-quantity[hidden] { display: none !important; }

.restock-request { margin:20px 0;padding:18px;background:#f7eedc;border:1px solid #dfd0b7;border-radius:10px; }
.restock-request[hidden] { display:none !important; }
.restock-request h3 { margin-top:0; }
.restock-request label { display:block;margin-bottom:6px; }
.restock-request input { box-sizing:border-box;width:100%;min-height:44px;font-size:16px;padding:10px;border:1px solid #9d8871;border-radius:6px; }
.restock-request button { margin-top:10px;min-height:44px;width:100%; }
.restock-request small { display:block;line-height:1.5; }
