/* HT Window Fashions — storefront design system.
   Mobile-first, theme-aware, no external dependencies (no CDN fonts/JS). */

:root {
  --bg: #FBFAF8;
  --surface: #FFFFFF;
  --surface-2: #F4F1EC;
  --border: #E4DED4;
  --text: #23201C;
  --text-dim: #6B6459;
  --accent: #8A6A45;          /* warm wood/linen tone */
  --accent-ink: #FFFFFF;
  --accent-soft: #F0E7DA;
  --ok: #3F7D58;
  --warn: #A8632B;
  --shadow: 0 1px 2px rgba(35,32,28,.06), 0 8px 24px rgba(35,32,28,.06);
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16140F;
    --surface: #201D17;
    --surface-2: #2A251E;
    --border: #3A342A;
    --text: #F2EEE7;
    --text-dim: #A79E90;
    --accent: #C9A227;
    --accent-ink: #1B1810;
    --accent-soft: #2E2717;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }

/* ---------- header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.hdr-in { display: flex; align-items: center; gap: 16px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.02em; text-decoration: none; font-size: 1.02rem; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  background: linear-gradient(160deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000));
  position: relative; overflow: hidden;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 4px 0;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.85) 0 1.5px, transparent 1.5px 4px);
}
.nav { display: none; gap: 18px; margin-left: 8px; }
.nav a { text-decoration: none; color: var(--text-dim); font-size: .9rem; font-weight: 500; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a.on { color: var(--text); border-bottom-color: var(--accent); }
.hdr-sp { flex: 1; }
@media (min-width: 860px) { .nav { display: flex; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer;
  text-decoration: none; transition: transform .06s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-sm { padding: 7px 13px; font-size: .84rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.cart-btn { position: relative; }
.cart-count {
  position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  font-size: .7rem; font-weight: 700; display: grid; place-items: center;
}

/* ---------- hero ---------- */
.hero { padding: 46px 0 30px; }
.hero h1 { font-size: clamp(1.9rem, 5.2vw, 3rem); line-height: 1.1; letter-spacing: -.03em; margin: 0 0 12px; }
.hero p { color: var(--text-dim); font-size: 1.03rem; max-width: 56ch; margin: 0 0 20px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.badge {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  font-size: .82rem; color: var(--text-dim); font-weight: 500;
}

/* ---------- toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 8px 0 22px; }
.field {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
}
.field input, .field select {
  border: 0; background: transparent; color: var(--text); font: inherit; font-size: .9rem; outline: none;
}
.field input { width: 190px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); font-size: .85rem; font-weight: 500; cursor: pointer; color: var(--text-dim);
}
.chip.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); color: var(--text); }

/* ---------- product grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; text-decoration: none;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.card-img { aspect-ratio: 4/3; position: relative; overflow: hidden; background: var(--surface-2); }
.card-body { padding: 14px 15px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-name { font-weight: 650; letter-spacing: -.01em; }
.card-tag { color: var(--text-dim); font-size: .855rem; flex: 1; }
.card-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 4px; }
.price { font-weight: 700; }
.price small { font-weight: 500; color: var(--text-dim); font-size: .76rem; }
.lead { font-size: .78rem; color: var(--text-dim); }

/* Generated blind illustration (no external images needed) */
.blindart { position: absolute; inset: 0; }

/* ---------- sections ---------- */
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin: 34px 0 14px; }
.sec-h h2 { font-size: 1.22rem; letter-spacing: -.02em; margin: 0; }
.sec-h p { margin: 0; color: var(--text-dim); font-size: .875rem; }

/* ---------- configurator ---------- */
.pdp { display: grid; gap: 26px; padding: 26px 0 60px; }
@media (min-width: 940px) { .pdp { grid-template-columns: 1.05fr .95fr; align-items: start; } }
.preview {
  position: sticky; top: 82px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow);
}
.preview-stage { aspect-ratio: 1/1; position: relative; }
.preview-cap { padding: 10px 14px; border-top: 1px solid var(--border); font-size: .8rem; color: var(--text-dim); display: flex; justify-content: space-between; gap: 10px; }

.panel { display: flex; flex-direction: column; gap: 22px; }
.panel h1 { font-size: clamp(1.5rem, 3.6vw, 2.05rem); letter-spacing: -.03em; margin: 0 0 6px; }
.panel .sub { color: var(--text-dim); margin: 0; }

.block { border-top: 1px solid var(--border); padding-top: 18px; }
.block > label, .block-title { display: block; font-weight: 650; font-size: .95rem; margin-bottom: 4px; }
.hint { color: var(--text-dim); font-size: .83rem; margin: 0 0 12px; }

.sizes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.size-in { display: flex; flex-direction: column; gap: 6px; }
.size-in span { font-size: .82rem; color: var(--text-dim); font-weight: 500; }
.size-in input {
  padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: 1rem; width: 100%;
}
.size-in input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; }
.size-in.bad input { border-color: var(--warn); }
.err { color: var(--warn); font-size: .8rem; min-height: 1.1em; }

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 9px; max-height: 268px; overflow: auto; padding: 3px; }
.sw { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); padding: 6px; cursor: pointer; text-align: left; font: inherit; }
.sw:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.sw.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 28%, transparent); }
.sw-c { height: 40px; border-radius: 6px; border: 1px solid rgba(0,0,0,.08); background: var(--surface-2); }
.sw-n { font-size: .7rem; color: var(--text-dim); margin-top: 5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { padding: 9px 15px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font: inherit; font-size: .875rem; cursor: pointer; color: var(--text); }
.opt.on { background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }

.pricebox { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: 16px 17px; }
.pricerow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pricerow .big { font-size: 1.85rem; font-weight: 750; letter-spacing: -.02em; }
.breakdown { margin: 12px 0 0; padding: 12px 0 0; border-top: 1px dashed var(--border); display: grid; gap: 5px; }
.bd { display: flex; justify-content: space-between; gap: 12px; font-size: .845rem; color: var(--text-dim); }
.prov { font-size: .73rem; color: var(--text-dim); margin-top: 10px; }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(20,17,13,.45); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(410px, 92vw); z-index: 51;
  background: var(--bg); border-left: 1px solid var(--border);
  transform: translateX(100%); transition: transform .24s cubic-bezier(.3,.8,.4,1);
  display: flex; flex-direction: column;
}
.drawer.on { transform: none; }
.drawer-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.drawer-h h3 { margin: 0; font-size: 1.02rem; }
.drawer-b { flex: 1; overflow: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; }
.drawer-f { border-top: 1px solid var(--border); padding: 15px 18px; display: grid; gap: 11px; }
.x { background: none; border: 0; color: var(--text-dim); font-size: 1.45rem; line-height: 1; cursor: pointer; padding: 2px 6px; }

.line { display: flex; gap: 12px; align-items: flex-start; }
.line-sw { width: 42px; height: 42px; border-radius: 8px; border: 1px solid var(--border); flex: none; background: var(--surface-2); }
.line-b { flex: 1; min-width: 0; }
.line-n { font-weight: 600; font-size: .9rem; }
.line-d { font-size: .78rem; color: var(--text-dim); }
.line-p { font-weight: 650; font-size: .9rem; white-space: nowrap; }

.empty { text-align: center; color: var(--text-dim); padding: 34px 10px; font-size: .9rem; }
.tot { display: flex; justify-content: space-between; font-weight: 700; font-size: 1.06rem; }

.skel { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: sh 1.3s infinite; border-radius: var(--radius); }
@keyframes sh { to { background-position: -200% 0; } }

.foot { border-top: 1px solid var(--border); margin-top: 44px; padding: 26px 0 40px; color: var(--text-dim); font-size: .85rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
