:root {
  --banner: #d95f7f;
  --raspberry: #c44064;
  --raspberry-deep: #b22d53;
  --btn: #c42a58;
  --btn-hover: #a71f48;
  --wine: #5c101c;
  --text: #3a2a2c;
  --muted: #6a5558;
  --cream: #fdf4ec;
  --paper: #fffaf6;
  --blush: #f8d5de;
  --dash: #c86a80;
  --line: #edd3d8;
  --green: #1f7a43;
  --yellow: #f6d55c;
  --font-script: "Allura", "Great Vibes", cursive;
  --font-sans: "Nunito", "Segoe UI", sans-serif;
  --nav-h: calc(4.6rem + env(safe-area-inset-bottom));
  --shadow: 0 10px 28px rgba(92, 16, 28, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(1200px 400px at 50% -10%, #f8d5de 0%, transparent 55%),
    var(--cream);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--raspberry); }
.skip {
  position: absolute; left: 0.8rem; top: -4rem;
  background: var(--wine); color: #fff; padding: 0.5rem 0.8rem; border-radius: 8px; z-index: 20;
}
.skip:focus { top: 0.5rem; }

.promo {
  margin: 0;
  background: var(--banner);
  color: #fff;
  text-align: center;
  font-weight: 800;
  font-size: 0.92rem;
  padding: 0.45rem 0.8rem;
}
.top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.7rem 1rem 0.35rem;
}
.top img { width: min(280px, 78vw); height: auto; }
.site-back {
  color: var(--wine);
  font-weight: 800;
  font-size: 0.88rem;
  text-decoration: none;
}
.wrap {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 0.4rem 1rem var(--nav-h);
}
.script {
  font-family: var(--font-script);
  font-weight: 400;
  color: var(--wine);
  line-height: 0.95;
  font-size: clamp(2.3rem, 8vw, 3.1rem);
  margin: 0 0 0.35rem;
}
h2.script { font-size: clamp(2rem, 7vw, 2.6rem); }
.kicker {
  margin: 0 0 0.25rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--raspberry);
}
.lead { margin: 0 0 1rem; font-size: 1.05rem; }
.muted { color: var(--muted); display: block; font-weight: 650; font-size: 0.92rem; }
.fine { color: var(--muted); font-size: 0.88rem; margin: 0.4rem 0 0; }
.loading { font-weight: 800; color: var(--wine); }

.example-banner, .install {
  background: var(--yellow);
  color: #6b1530;
  border-radius: 16px;
  padding: 0.75rem 0.9rem;
  font-weight: 800;
  margin: 0 0 0.9rem;
}
.install { background: #fff; border: 1.5px dashed var(--dash); color: var(--text); font-weight: 700; }
.install button { margin-top: 0.55rem; }

.home-actions, .stack { display: grid; gap: 0.75rem; }
.home-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 250, 246, 0.94);
  border: 1.5px dashed var(--dash);
  border-radius: 22px;
  padding: 1rem 1rem 0.95rem;
  box-shadow: var(--shadow);
}
.home-card strong { display: block; color: var(--raspberry); font-size: 1.2rem; }
.home-card span { color: var(--text); }

.card {
  background: var(--paper);
  border: 1.5px dashed var(--dash);
  border-radius: 22px;
  padding: 1rem;
  margin: 0 0 0.85rem;
  box-shadow: 0 6px 18px rgba(92, 16, 28, 0.06);
}
.card h2, .card h3 { margin: 0 0 0.35rem; color: var(--raspberry); font-size: 1.15rem; }

.btn, button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  min-height: 3.1rem;
  border: 0;
  border-radius: 999px;
  background: var(--btn);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  padding: 0.7rem 1.1rem;
  box-shadow: 0 4px 0 var(--raspberry-deep);
  cursor: pointer;
}
.btn:hover { background: var(--btn-hover); }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 3px solid var(--wine);
  outline-offset: 2px;
}
.btn.secondary { background: #fff; color: var(--wine); box-shadow: inset 0 0 0 2px var(--raspberry); }
.btn.ghost { background: transparent; color: var(--wine); box-shadow: none; }
.btn.danger { background: var(--wine); box-shadow: 0 4px 0 #3a0a12; }
.btn[disabled] { opacity: 0.65; cursor: wait; }
.btn-row { display: grid; gap: 0.6rem; margin-top: 0.8rem; }

.field { margin: 0 0 0.8rem; }
.field label, .group-label {
  display: block;
  font-weight: 800;
  color: var(--wine);
  margin-bottom: 0.3rem;
}
.req { color: var(--raspberry); font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; }
input[type="text"], input[type="tel"], input[type="email"], input[type="password"],
input[type="date"], input[type="number"], input[type="search"], select, textarea {
  width: 100%;
  min-height: 3rem;
  border: 1.5px solid #e7c9cf;
  background: #fff;
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  font-weight: 700;
}
textarea { min-height: 7rem; resize: vertical; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.7rem; }
.split > * { min-width: 0; }
input, select, textarea { max-width: 100%; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

.choice-grid { display: grid; gap: 0.55rem; }
.choice {
  position: relative;
  display: grid;
  gap: 0.1rem;
  padding: 0.75rem 0.8rem;
  border-radius: 16px;
  border: 1.5px solid #e7c9cf;
  background: #fff;
  cursor: pointer;
}
.choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
}
.choice.is-on { border-color: var(--raspberry); background: #fff1f4; box-shadow: inset 0 0 0 1px var(--raspberry); }
.choice-label { font-weight: 800; color: var(--wine); }
.choice small { color: var(--muted); font-weight: 700; }
.choice b { color: var(--raspberry); }

.check-row {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0.55rem;
  align-items: start;
  padding: 0.7rem 0;
  border-top: 1px dashed var(--line);
  font-weight: 750;
}
.check-row input { width: 1.3rem; height: 1.3rem; margin-top: 0.15rem; accent-color: var(--raspberry); }
.check-row small { display: block; color: var(--muted); font-weight: 700; }

.estimate {
  background: #fff;
  border-radius: 18px;
  padding: 0.9rem;
  border: 1.5px solid var(--blush);
}
.est-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
  padding: 0.45rem 0;
  border-bottom: 1px dashed var(--line);
}
.est-line b { color: var(--wine); white-space: nowrap; }
.est-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--wine);
  margin: 0.7rem 0 0;
}
.error, .form-status.is-error {
  background: #fff1f2;
  color: #8d1d32;
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  font-weight: 800;
}
.ok, .form-status.is-ok { color: var(--green); font-weight: 800; }
.request-number {
  font-size: 2rem;
  letter-spacing: 0.04em;
  color: var(--raspberry);
  font-weight: 800;
  margin: 0.2rem 0 0.8rem;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; padding-bottom: 0.35rem; margin-bottom: 0.7rem; }
.chip {
  flex: none;
  border: 1.5px solid #e7c9cf;
  background: #fff;
  color: var(--wine);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font-weight: 800;
  cursor: pointer;
}
.chip.is-on { background: var(--raspberry); color: #fff; border-color: var(--raspberry); }

.fabric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.fabric-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #f0ddd6;
  box-shadow: 0 4px 14px rgba(92, 16, 28, 0.08);
  min-height: 100%;
}
.fabric-card img, .swatch-fallback {
  aspect-ratio: 1;
  width: 100%;
  object-fit: cover;
  background: var(--blush);
}
.swatch-fallback {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 0.5rem;
  color: var(--wine);
  font-weight: 800;
}
.fabric-card div { padding: 0.55rem 0.65rem 0.7rem; }
.fabric-card strong { display: block; font-size: 0.95rem; line-height: 1.25; overflow-wrap: anywhere; }
.choice-label { overflow-wrap: anywhere; }
.fabric-card .price { color: var(--wine); font-weight: 800; }
.badge {
  display: inline-block;
  margin-top: 0.25rem;
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 800;
}
.badge.in { background: #e5f6ea; color: var(--green); }
.badge.out { background: #f3e6e8; color: var(--muted); }
.badge.ex { background: var(--yellow); color: #6b1530; }
.fabric-hero img, .fabric-hero .swatch-fallback {
  width: 100%;
  border-radius: 22px;
  aspect-ratio: 1;
  object-fit: cover;
  max-height: 420px;
}
.back { font-weight: 800; text-decoration: none; display: inline-block; margin-bottom: 0.6rem; }

.bottom-nav.with-cart { grid-template-columns: repeat(5, 1fr); }
.bottom-nav.with-cart a { font-size: 0.68rem; }
.qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0.6rem 0 0.8rem;
  background: #fff;
  border: 1.5px solid #e7c9cf;
  border-radius: 16px;
  padding: 0.35rem;
}
.qty button {
  width: 3rem;
  min-height: 3rem;
  border: 0;
  border-radius: 12px;
  background: var(--raspberry);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 800;
}
.qty span { font-weight: 800; color: var(--wine); }
.status.paid { background: #fff4d6; color: #6b1530; }
.status.ready { background: #e5f6ea; color: var(--green); }
.status.picked_up, .status.cancelled, .status.new { background: #f6f0f1; color: #6a5558; }

.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 0.25rem 0.2rem env(safe-area-inset-bottom);
  z-index: 10;
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  min-height: 3.2rem;
  justify-content: center;
}
.bottom-nav a.is-on { color: var(--raspberry); }
.bottom-nav svg { width: 1.45rem; height: 1.45rem; fill: none; stroke: currentColor; stroke-width: 1.8; }

.tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.8rem; }
.tabs a { flex: 1 1 4.5rem; }
.tabs a {
  text-align: center;
  text-decoration: none;
  font-weight: 800;
  color: var(--wine);
  background: #fff;
  border-radius: 12px;
  padding: 0.55rem 0.2rem;
  border: 1.5px solid #e7c9cf;
}
.tabs a.is-on { background: var(--raspberry); color: #fff; border-color: var(--raspberry); }
.owner-bar { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; }
.owner-bar button { width: auto; min-height: 2.6rem; padding-inline: 0.9rem; }

.req-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border-radius: 18px;
  padding: 0.85rem 0.9rem;
  margin-bottom: 0.65rem;
  border: 1px solid #f0ddd6;
}
.req-card header { display: flex; justify-content: space-between; gap: 0.5rem; align-items: center; }
.status {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}
.status.requested { background: #ffe0e8; color: var(--raspberry-deep); }
.status.confirmed { background: #e5f6ea; color: var(--green); }
.status.completed { background: #eee; color: #555; }
.status.cancelled { background: #f6f0f1; color: #8a7578; }
.notes { white-space: pre-wrap; overflow-wrap: anywhere; }

.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  background: #fff;
  border-radius: 16px;
  padding: 0.8rem 0.9rem;
  border: 1.5px solid #e7c9cf;
  font-weight: 800;
  margin: 0.4rem 0 0.8rem;
}
.switch input { width: 1.4rem; height: 1.4rem; accent-color: var(--raspberry); }
.photo-actions { display: grid; gap: 0.5rem; margin-bottom: 0.8rem; }
.photo-actions img { width: 100%; border-radius: 18px; aspect-ratio: 1; object-fit: cover; }

.price-row { margin-bottom: 0.85rem; }
.price-row small { display: block; color: var(--muted); margin: 0.15rem 0 0.3rem; }

@media (min-width: 720px) {
  .home-actions { grid-template-columns: 1fr; }
  .btn-row.two { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) {
  .fabric-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
