:root {
  --cream: #faf7f2;
  --ink: #3d3024;
  --gold: #a67c48;
  --line: #d7c5ae;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.6 Georgia, "Times New Roman", serif;
}

a { color: #80603b; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

.topbar {
  min-height: 86px;
  padding: 15px 6%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
  background: #f7f2eb;
  border-bottom: 1px solid #e6dbcc;
}

.brand {
  width: fit-content;
  text-decoration: none;
  color: var(--gold);
  text-align: center;
  line-height: 1;
}

.brand-name {
  display: block;
  font-size: clamp(22px, 2.4vw, 34px);
  letter-spacing: .13em;
}

.brand-subtitle {
  display: block;
  margin-top: 7px;
  font-size: 10px;
  letter-spacing: .48em;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 2.5vw, 38px);
}

.main-nav a {
  padding: 9px 0;
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  font-size: 11px;
  letter-spacing: .2em;
  border-bottom: 1px solid transparent;
}

.main-nav a:hover,
.main-nav a.active {
  border-bottom-color: var(--gold);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
}

.icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 40px;
  padding: 5px;
  border: 0;
  background: transparent;
  color: #5b4631;
  text-decoration: none;
  cursor: pointer;
}

.icon-button svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cart-count {
  position: absolute;
  top: 0;
  right: -3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 50%;
  background: var(--gold);
  color: white;
  font: 10px/17px Arial, sans-serif;
  text-align: center;
}

.page-banner {
  padding: 58px 20px;
  text-align: center;
  background: #eee5d9;
  border-bottom: 1px solid #e0d2bf;
}

.page-banner h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 52px);
  font-weight: normal;
  line-height: 1.2;
}

.container {
  max-width: 1180px;
  min-height: 300px;
  margin: 45px auto 65px;
  padding: 0 25px;
}

.narrow { max-width: 800px; }
.checkout-container { max-width: 900px; }
.payment-container { max-width: 750px; }

.section h2,
.container > h2 {
  margin: 0 0 30px;
  text-align: center;
  font-size: 30px;
  font-weight: normal;
}

.toolbar {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 25px;
}

.small-button {
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: transparent;
  color: #65513b;
  text-decoration: none;
  font: 12px Arial, sans-serif;
  cursor: pointer;
}

.small-button:disabled { opacity: .5; }

.products {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
}

.products > p[data-status] {
  grid-column: 1 / -1;
  text-align: center;
}

.product-card {
  min-width: 0;
  padding: 0 0 22px;
  border: 1px solid #e5dacb;
  background: #fffdf9;
  text-align: center;
}

.product-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #f1eae0;
}

.product-detail-link {
  color: var(--ink);
  text-decoration: none;
}

.product-detail-link:hover h3 { text-decoration: underline; }

.product-card h3 {
  padding: 0 18px;
  margin: 18px 0 8px;
  font-size: 23px;
  font-weight: normal;
}

.product-card > p {
  padding-inline: 20px;
  overflow-wrap: anywhere;
}

.product-price { font-weight: bold; }

.shop-button,
.btn,
.button {
  display: inline-block;
  padding: 13px 22px;
  border: 0;
  border-radius: 2px;
  background: var(--gold);
  color: #fffaf2;
  text-decoration: none;
  font: 14px/1.4 Arial, sans-serif;
  cursor: pointer;
}

.shop-button:hover,
.btn:hover,
.button:hover { background: #906739; }

.shop-button:disabled,
.button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.back-link {
  display: inline-block;
  margin-bottom: 28px;
}

.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 50px;
  align-items: start;
}

.product-info h2 {
  margin: 0 0 12px;
  font-size: clamp(30px, 3.5vw, 44px);
  font-weight: normal;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.product-info .product-price {
  margin: 0 0 23px;
  font-size: 23px;
}

.product-description {
  margin-bottom: 28px;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.stock-message {
  padding: 13px 16px;
  margin: 0 0 22px;
  border: 1px solid var(--line);
  background: #f1eae0;
  font-size: 14px;
}

.stock-neutral { color: #81766b; }
.stock-message.sold-out {
  border-color: #e7c7bf;
  background: #faeeeb;
  color: #8b4437;
}

.product-gallery { min-width: 0; }
.gallery-frame { position: relative; }

.gallery-viewport {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  border: 1px solid #e5dacb;
  background: #fffdf9;
}

.gallery-viewport::-webkit-scrollbar { display: none; }

.gallery-slide {
  flex: 0 0 100%;
  min-width: 0;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.product-photo {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  user-select: none;
}

.gallery-error { padding: 25px; text-align: center; }

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(250, 247, 242, .95);
  color: var(--ink);
  font: 32px/1 Arial, sans-serif;
  cursor: pointer;
}

.gallery-previous { left: 10px; }
.gallery-next { right: 10px; }
.gallery-arrow:disabled { opacity: .4; cursor: default; }

.gallery-dots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 8px;
}

.gallery-dot {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.gallery-dot::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d7c5ae;
}

.gallery-dot.active::before { background: var(--gold); }
.gallery-counter { margin: 0; text-align: center; font-size: 13px; color: #81766b; }

.story-photo,
.contact-photo {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  margin-bottom: 35px;
}

.story-copy { font-size: 18px; }
.contact-content { text-align: center; }

.box {
  padding: 28px;
  margin: 20px 0;
  border: 1px solid #e5dacb;
  background: #fffdf9;
}

.box h2 {
  margin-top: 0;
  font-size: 27px;
  font-weight: normal;
}

.test {
  padding: 13px 16px;
  border: 1px solid var(--line);
  background: #f1eae0;
  font-size: 14px;
}

fieldset { padding: 0; margin: 0; border: 0; }

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

label { display: block; }

input {
  width: 100%;
  padding: 12px;
  margin-top: 6px;
  border: 1px solid #cdbba3;
  border-radius: 2px;
  background: #fff;
  color: var(--ink);
}

.wide { grid-column: 1 / -1; }

.line {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0;
  border-bottom: 1px solid #e5dacb;
}

.line span:first-child { overflow-wrap: anywhere; }
.line span:last-child { white-space: nowrap; }

#message,
#status {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

#continue { margin-top: 15px; }
#check, #resume { margin: 5px 5px 5px 0; }
.note { font-size: 14px; color: #81766b; }

footer {
  padding: 25px;
  border-top: 1px solid #e6dbcc;
  background: #f1eae0;
  color: #81766b;
  text-align: center;
  font-size: 13px;
}

footer p { margin: 0; }

@media (max-width: 1050px) {
  .topbar { padding-inline: 4%; gap: 18px; }
  .main-nav { gap: 18px; }
  .main-nav a { font-size: 10px; letter-spacing: .12em; }
  .header-actions { gap: 12px; }
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .topbar {
    grid-template-columns: 1fr auto;
    gap: 14px;
    padding: 18px 20px 12px;
  }

  .brand-name { font-size: 26px; }

  .main-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: space-between;
    gap: 10px;
  }

  .main-nav a { font-size: 10px; letter-spacing: .1em; }
  .header-actions { grid-column: 2; grid-row: 1; }
  .page-banner { padding: 38px 20px; }
  .container { margin-top: 30px; padding-inline: 20px; }
  .product-layout { grid-template-columns: 1fr; gap: 28px; }
  .fields { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  .box { padding: 20px; }
}

@media (max-width: 450px) {
  .products { grid-template-columns: 1fr; }
}
