@font-face {
  font-family: Bricolage Grotesque;
  src: url("assets/fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 600 800;
  font-display: swap;
}

@font-face {
  font-family: DM Sans;
  src: url("assets/fonts/dm-sans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fffdf9;
  --ink: #231e1a;
  --muted: #695c51;
  --line: #ded5ca;
  --soft: #f5eee4;
  --product-background: #ece8df;
  --accent: #c92136;
  --accent-dark: #a91528;
  --accent-wash: #fff0ef;
  --display: "Bricolage Grotesque", sans-serif;
  --body: "DM Sans", sans-serif;
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  scroll-padding-top: 88px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
::selection { color: white; background: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
html { scroll-behavior: smooth; }
body { margin: 0; font-size: 1rem; line-height: 1.5; }
button, input, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; text-underline-offset: .24em; }
button:disabled { cursor: wait; opacity: .65; }
button:not(:disabled) { cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
fieldset { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; }

.visually-hidden, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link { position: fixed; top: 10px; left: 10px; z-index: 3; padding: .6rem 1rem; background: white; }
.page-width { width: min(100% - 2 * clamp(1rem, 4.17vw, 4.5rem), 1264px); margin-inline: auto; }

.site-header {
  position: sticky;
  z-index: 2;
  top: 0;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.header-row { min-height: 70px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; }
.brand {
  position: relative;
  display: block;
  justify-self: start;
  width: 104px;
  height: 52px;
  border-radius: 7px;
  background: #df3043;
  overflow: hidden;
}
.brand img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.header-row nav { display: flex; align-items: center; gap: clamp(1.25rem, 3vw, 2.75rem); }
.header-row nav a { display: flex; align-items: center; min-height: 44px; font-size: .92rem; font-weight: 600; text-decoration: none; color: var(--muted); }
.header-row nav .nav-current { color: var(--ink); }
.header-row nav a:hover, .project-link:hover { color: var(--accent-dark); }
.project-link { display: inline-flex; min-height: 44px; align-items: center; justify-self: end; gap: .5rem; font-size: .93rem; font-weight: 700; text-decoration: none; }
.product-path { display: flex; align-items: center; gap: .55rem; color: var(--muted); font-size: .82rem; padding-block: 1.2rem; }
.product-path span { font-weight: 600; }
.product-path svg { width: .75rem; height: .75rem; }

.product {
  display: grid;
  grid-template-areas: "gallery heading" "gallery options" "project project";
  grid-template-columns: minmax(0, min(52%, max(24rem, 100svh - 11rem))) minmax(0, 1fr);
  grid-template-rows: max-content 1fr auto;
  column-gap: clamp(2rem, 5vw, 4.5rem);
  row-gap: 1.25rem;
  align-items: start;
  padding-bottom: clamp(3rem, 6vw, 6rem);
}
.gallery-column { grid-area: gallery; align-self: stretch; min-width: 0; }
.main-media { position: relative; }
.media-frame { position: relative; isolation: isolate; overflow: hidden; aspect-ratio: 1 / 1; border-radius: 14px; background: var(--soft); }
.media-frame > img { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene-image { object-fit: cover; }
.store-image { object-fit: contain; padding: 4.5%; }
.studio-filter { position: absolute; pointer-events: none; }
.fabric-preview-image { filter: url(#fabric-preview-filter); }
.store-image.studio-preview { padding: 0; }
.mobile-preview { display: none; }
.media-swatch { position: absolute; left: 1rem; bottom: 1rem; display: flex; align-items: center; gap: .55rem; padding: .4rem .7rem .4rem .4rem; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font-size: .81rem; font-weight: 700; }
.media-swatch img { border-radius: 4px; object-fit: cover; }
.main-media figcaption { color: var(--muted); font-size: .78rem; margin-top: .5rem; }
.gallery-views { display: flex; flex-wrap: wrap; align-items: stretch; gap: .6rem; margin-top: .6rem; }
.view { display: flex; align-items: center; gap: .6rem; padding: .28rem .75rem .28rem .28rem; border-radius: 9px; background: transparent; border: 1px solid var(--line); font-size: .79rem; font-weight: 650; }
.view[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-wash); }
.view:hover { border-color: var(--accent); }
.view img { width: 40px; height: 40px; border-radius: 5px; object-fit: cover; background: var(--soft); }
.view[data-view="store"] img { object-fit: contain; }

.product-heading { grid-area: heading; min-width: 0; }
.product-options { grid-area: options; min-width: 0; }
h1, h2 { font-family: var(--display); font-weight: 800; letter-spacing: -.025em; }
h1 { max-width: 19ch; font-size: clamp(2.35rem, 3.55vw, 3.5rem); line-height: 1.02; text-wrap: balance; }
.product-intro { max-width: 51ch; margin-top: .75rem; color: var(--muted); }
.price-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: .15rem .85rem; margin-top: .75rem; }
.price-line strong { font-family: var(--display); color: var(--accent-dark); font-size: 1.35rem; font-weight: 800; }
.price-line span { color: var(--muted); font-size: .84rem; }

.config-tabs { display: flex; border-bottom: 1px solid var(--line); }
.config-tabs button {
  flex: 1 1 auto;
  min-height: 46px;
  margin-bottom: -1px;
  padding: .55rem .3rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 650;
}
.config-tabs button:hover { color: var(--ink); background: var(--soft); }
.config-tabs button[aria-selected="true"] { border-bottom-color: var(--accent-dark); color: var(--accent-dark); font-weight: 700; }
.config-tabs button:focus-visible { outline-offset: -4px; }
.config-panel { padding-block: 1.15rem .3rem; }
.config-panel legend, .input-field > label { font-size: .89rem; font-weight: 700; }
.config-panel legend { margin-bottom: .5rem; }
.field-group { margin-top: 1rem; }

.model-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.model-option { display: flex; align-items: flex-start; gap: .6rem; padding: .7rem .75rem; border-radius: 9px; border: 1px solid var(--line); cursor: pointer; }
.model-option:has(:checked) { background: var(--accent-wash); border-color: var(--accent); }
.model-option:hover { border-color: var(--accent); }
.model-option > span { display: grid; gap: .14rem; line-height: 1.25; }
.model-option strong { font-size: .96rem; }
.model-option small { color: var(--muted); font-size: .77rem; }
.model-option input, .check-line input { width: 16px; height: 16px; flex: 0 0 16px; margin: .12rem 0 0; accent-color: var(--accent); }
.check-line { display: flex; min-height: 44px; align-items: center; gap: .6rem; font-size: .88rem; cursor: pointer; }
.check-line input { margin-top: 0; }
.model-help { min-height: 42px; margin-top: .15rem; }
.measure-help { align-items: flex-start; padding-block: .55rem .8rem; margin-bottom: .6rem; }
.measure-help input { margin-top: .2rem; }
.measure-help span { max-width: 29rem; }
fieldset:disabled { opacity: .56; }
fieldset:disabled label, fieldset:disabled input { cursor: default; }

.choices { display: flex; flex-wrap: wrap; gap: .5rem; }
.choice, .swatch-option { position: relative; display: inline-flex; cursor: pointer; }
.choice input, .swatch-option input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: inherit; }
.choice span { min-height: 44px; display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .8rem; border-radius: 7px; border: 1px solid var(--line); font-size: .83rem; font-weight: 650; }
.choice input:checked + span { background: var(--accent-wash); border-color: var(--accent); color: var(--accent-dark); }
.choice:hover span { border-color: var(--accent); }
.choice input:focus-visible + span, .swatch-option input:focus-visible + img { outline: 2px solid var(--accent); outline-offset: 3px; }
.paint { width: .9rem; height: .9rem; border: 1px solid var(--line); border-radius: 50%; }
.paint-white { background: white; }
.paint-black { background: #191b1e; }

.text-button { display: inline-flex; align-items: center; min-height: 44px; background: none; border: 0; padding: 0; color: var(--accent-dark); font-size: .88rem; font-weight: 700; text-decoration: underline; }

.legend-value { margin-left: .25rem; font-weight: 400; color: var(--muted); }
.swatches { display: flex; flex-wrap: wrap; gap: .55rem; padding-block: .15rem; }
.swatch-option img { width: 44px; height: 44px; border-radius: 7px; object-fit: cover; border: 1px solid #51433a33; }
.swatch-option input:checked + img { outline: 2px solid var(--accent); outline-offset: 2px; }
.swatch-option:hover img { border-color: var(--accent-dark); }
.logo-upload { margin-top: .6rem; }
.accessories { display: flex; flex-wrap: wrap; column-gap: 1.1rem; }

.input-field { display: grid; gap: .4rem; min-width: 0; }
.input-field > label span { color: var(--muted); font-size: .78rem; font-weight: 500; }
.input-field input, .input-field textarea { min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); padding: .65rem .75rem; caret-color: var(--accent); }
.input-field input { min-height: 44px; }
.input-field textarea { resize: vertical; }
.input-field input::placeholder, .input-field textarea::placeholder { color: var(--muted); opacity: 1; }
.input-field input[aria-invalid="true"] { border-color: var(--accent); }
.input-field input[type="file"] { font-size: .87rem; }
.input-field input::file-selector-button { margin-right: .7rem; font: inherit; }
.unit-input { position: relative; max-width: 14rem; }
.unit-input input { font-variant-numeric: tabular-nums; padding-right: 3rem; }
.unit-input span { position: absolute; right: .8rem; top: 50%; transform: translateY(-50%); font-size: .85rem; color: var(--muted); pointer-events: none; }
.hint, .error { font-size: .8rem; }
.hint { color: var(--muted); }
.projection-hint { margin: -.2rem 0 .65rem; }
.error { color: var(--accent-dark); font-weight: 650; }
.choices + .error { margin-top: .5rem; }

.button { display: inline-flex; min-height: 51px; width: 100%; align-items: center; justify-content: center; gap: .7rem; padding: .6rem 1rem; border: 0; border-radius: 8px; font-weight: 700; text-align: center; text-decoration: none; }
.primary { color: white; background: var(--accent); }
.primary:hover:not(:disabled) { background: var(--accent-dark); }
.project-cta { margin-top: 1.15rem; }
.project { grid-area: project; margin-top: clamp(1.75rem, 4vw, 3.5rem); padding-top: clamp(1.75rem, 4vw, 3rem); border-top: 1px solid var(--line); }
h2 { font-size: clamp(2rem, 3.25vw, 3rem); line-height: 1.05; }
.project-intro { margin-top: .65rem; max-width: 64ch; color: var(--muted); font-size: .94rem; }
.project-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(1.5rem, 5vw, 4.5rem); margin-top: 1.65rem; }
.project-layout h3, .contact-fields > legend { margin-bottom: .6rem; font: 750 1.22rem/1.25 var(--display); }
.configuration-summary { padding: .3rem 1rem; background: var(--soft); border-radius: 10px; }
.summary-row { display: grid; grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr); gap: 1rem; align-items: baseline; padding: .58rem 0; font-size: .85rem; }
.summary-row:not(:last-child) { border-bottom: 1px solid var(--line); }
.summary-row dt { color: var(--muted); }
.summary-row dd { text-align: right; font-weight: 650; overflow-wrap: anywhere; }
.contact-fields { margin-bottom: 1.15rem; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .95rem .75rem; }
.contact-notes { grid-column: 1 / -1; }
.download-status { margin-top: .65rem; font-size: .85rem; }
.download-status:empty { display: none; }

.site-footer { border-top: 1px solid var(--line); background: var(--soft); }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding-block: 1.35rem; }
.footer-row strong { font-family: var(--display); font-size: 1.2rem; font-weight: 800; }
.footer-row a { display: inline-flex; min-height: 44px; align-items: center; gap: .45rem; font-size: .85rem; }

@media (min-width: 821px) and (min-height: 640px) {
  .gallery { position: sticky; top: 88px; }
}

@media (max-width: 820px) {
  .product { grid-template-areas: "heading" "gallery" "options" "project"; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; row-gap: 1.4rem; }
  h1 { font-size: clamp(2.2rem, 6.7vw, 3.35rem); text-wrap: wrap; }
  .product-intro { margin-top: .55rem; }
  .mobile-preview { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); align-items: center; gap: .85rem; margin-block: .2rem .5rem; }
  .mobile-preview img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; background: var(--soft); border-radius: 8px; }
  .mobile-preview figcaption { color: var(--muted); font-size: .8rem; }
  .project-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 620px) {
  :root { scroll-padding-top: 80px; }
  .header-row { grid-template-columns: 1fr 1fr; min-height: 64px; }
  .header-row nav { display: none; }
  .brand { width: 92px; height: 46px; }
  .product-path { display: none; }
  .product { padding-top: 1.15rem; }
  .price-line { margin-top: .55rem; }
  .product-intro { font-size: .94rem; }
  .view img { width: 36px; height: 36px; }
  .config-tabs button { font-size: .82rem; }
}

@media (max-width: 440px) {
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
}

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