:root {
  --bg: #f7f4ee;
  --paper: #ffffff;
  --paper-soft: #fbf8f2;
  --ink: #171411;
  --muted: #746d64;
  --line: #e7ded1;
  --oak: #8a5b2f;
  --black: #211d18;
  --danger: #b8322b;
  --shadow: 0 26px 70px rgba(32, 25, 18, 0.12);
  --radius: 22px;
  --sticky-space: 108px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding-bottom: calc(var(--sticky-space) + env(safe-area-inset-bottom));
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.checkout-page {
  padding-bottom: 0;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
p {
  margin-top: 0;
}

.announcement {
  min-height: 34px;
  padding: 8px 18px;
  display: grid;
  place-items: center;
  background: var(--black);
  color: #f0e6d8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.35;
  text-align: center;
  text-transform: uppercase;
}

.site-header {
  min-height: 82px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(23, 20, 17, 0.08);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
}

.brand img {
  width: 86px;
  height: 68px;
  object-fit: contain;
}

.product-page {
  width: min(1240px, calc(100% - 24px));
  margin: 20px auto 52px;
}

.product-shell {
  display: grid;
  gap: 18px;
}

.product-gallery {
  display: grid;
  gap: 12px;
}

.product-main-image,
.product-thumbs img {
  width: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  background: #e9dfd1;
}

.product-main-image {
  min-height: 390px;
  max-height: 620px;
  aspect-ratio: 4 / 5;
  box-shadow: var(--shadow);
}

.product-thumbs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.product-thumbs img {
  height: 116px;
}

.product-panel {
  padding: 26px 18px 24px;
  background: var(--paper);
  border: 1px solid rgba(23, 20, 17, 0.08);
  border-radius: var(--radius);
  box-shadow: 0 18px 58px rgba(32, 25, 18, 0.08);
}

.product-kicker,
.summary-head span,
.product-dimensions {
  color: var(--oak);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1 {
  max-width: 680px;
  margin-bottom: 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 10vw, 68px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.product-price {
  margin-bottom: 18px;
  font-size: clamp(28px, 8vw, 42px);
  font-weight: 850;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.trust-lines {
  margin-bottom: 24px;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.product-dimensions {
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.shelf-list {
  display: grid;
  gap: 14px;
}

.shelf-card {
  position: relative;
  padding: 18px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.shelf-card-head {
  min-height: 32px;
  margin-bottom: 16px;
  padding-right: 42px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.shelf-card h2,
.summary-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.shelf-card-head strong {
  font-size: 21px;
  line-height: 1;
}

.remove-shelf {
  width: 34px;
  height: 34px;
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #b8322b;
  color: #fff;
  font-size: 22px;
  line-height: 1;
}

.remove-shelf[hidden] {
  display: none;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.width-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d8cbb9;
  border-radius: 16px;
}

.width-field:focus-within {
  border-color: var(--oak);
  box-shadow: 0 0 0 4px rgba(138, 91, 47, 0.12);
}

.shelf-input {
  width: 100%;
  min-height: 58px;
  padding: 0 16px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 22px;
  font-weight: 850;
}

.width-field span {
  padding: 0 16px 0 8px;
  color: var(--muted);
  font-weight: 850;
}

.shelf-input[aria-invalid="true"] {
  color: var(--danger);
}

.input-help,
.input-error,
.checkout-status,
.order-summary p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.input-error,
.checkout-status {
  color: var(--danger);
}

.checkout-status.is-loading {
  color: var(--muted);
}

.add-shelf {
  width: 100%;
  min-height: 56px;
  margin-top: 14px;
  border: 1px dashed #b99061;
  border-radius: 18px;
  background: #fffaf3;
  color: var(--oak);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.order-summary {
  margin-top: 22px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.summary-head,
.summary-row,
.summary-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.summary-head {
  margin-bottom: 14px;
}

.summary-items {
  display: grid;
  gap: 11px;
}

.summary-row {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
}

.summary-row strong {
  color: var(--ink);
}

.summary-discount {
  margin-top: 12px;
  color: var(--oak);
}

.summary-total {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.summary-total span {
  color: var(--muted);
  font-weight: 850;
}

.summary-total strong {
  font-size: 30px;
  letter-spacing: -0.04em;
  line-height: 1;
}

.button {
  min-height: 58px;
  padding: 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.button-dark {
  background: var(--black);
}

.button:hover,
.button:focus-visible {
  background: #3a332c;
}

.button:active {
  transform: translateY(1px);
}

.button:disabled,
.button[aria-busy="true"] {
  cursor: wait;
  opacity: 0.7;
}

#basketButton {
  width: 100%;
  margin-top: 18px;
}

.contact-strip {
  margin-top: 18px;
  padding: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 18px;
  background: #fff;
  border: 1px solid rgba(23, 20, 17, 0.08);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.contact-strip span {
  width: 100%;
  color: var(--ink);
  font-weight: 850;
}

.contact-strip a {
  color: var(--oak);
  font-weight: 850;
}

.sticky-buy {
  min-height: 84px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid rgba(23, 20, 17, 0.1);
  box-shadow: 0 -18px 46px rgba(32, 25, 18, 0.16);
  backdrop-filter: blur(18px);
}

.sticky-buy span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sticky-buy strong {
  display: block;
  font-size: 27px;
  letter-spacing: -0.04em;
  line-height: 1;
}

.sticky-buy .button {
  min-width: 138px;
  min-height: 54px;
  padding: 0 20px;
}

.checkout-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.checkout-message-page {
  width: min(920px, calc(100% - 24px));
  margin: 36px auto 64px;
  flex: 1;
  display: grid;
  place-items: center;
}

.checkout-message-card {
  width: 100%;
  padding: clamp(30px, 6vw, 64px);
  background: var(--paper);
  border: 1px solid rgba(23, 20, 17, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin-bottom: 14px;
  color: var(--oak);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.checkout-message-card p:not(.eyebrow) {
  max-width: 660px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.confirmation-details {
  margin: 28px 0;
  padding: 20px;
  display: grid;
  gap: 14px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.confirmation-details span {
  display: block;
  color: var(--oak);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.confirmation-details strong {
  display: block;
  margin-top: 6px;
  font-size: 17px;
  line-height: 1.35;
}

.site-footer {
  padding: 34px 24px;
  display: grid;
  gap: 18px;
  justify-items: center;
  background: var(--black);
  color: #f7efe4;
  text-align: center;
}

.footer-brand img {
  width: 86px;
  height: 68px;
  object-fit: contain;
  filter: brightness(1.08);
}

.site-footer p {
  max-width: 440px;
  margin: 0;
  color: #d8cabb;
  line-height: 1.55;
}

@media (min-width: 760px) {
  :root {
    --sticky-space: 112px;
  }

  .product-page {
    width: min(1320px, calc(100% - 48px));
    margin-top: 36px;
  }

  .product-shell {
    grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
    align-items: start;
    gap: clamp(28px, 5vw, 72px);
  }

  .product-gallery {
    position: sticky;
    top: 112px;
  }

  .product-main-image {
    aspect-ratio: 1 / 1.1;
  }

  .product-panel {
    padding: clamp(30px, 4vw, 48px);
  }

  .trust-lines {
    grid-template-columns: 1fr;
  }

  .contact-strip {
    margin-top: 26px;
    justify-content: flex-start;
    text-align: left;
  }

  .contact-strip span {
    width: auto;
    margin-right: auto;
  }

  .sticky-buy {
    width: min(760px, calc(100% - 48px));
    min-height: 88px;
    right: 24px;
    bottom: 24px;
    left: auto;
    padding: 14px;
    border: 1px solid rgba(23, 20, 17, 0.1);
    border-radius: 999px;
  }

  .sticky-buy .button {
    min-width: 170px;
  }

  .confirmation-details {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 430px) {
  .product-main-image {
    min-height: 340px;
  }

  .product-panel {
    padding-inline: 16px;
  }

  .shelf-card {
    padding: 16px;
  }

  .summary-row {
    font-size: 14px;
  }

  .sticky-buy .button {
    min-width: 124px;
    padding: 0 18px;
  }
}
