:root {
  --bg: #f4f8fb;
  --panel: #ffffff;
  --ink: #16324a;
  --muted: #5b7386;
  --line: #d7e4ee;
  --accent: #5ec4e3;
  --accent-strong: #2aa8d1;
  --accent-soft: #e7f6fb;
  --shadow: 0 18px 50px rgba(22, 50, 74, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 500px at 10% -10%, #dff4fb 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: Manrope, system-ui, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px 8px;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  display: block;
  height: 52px;
  width: auto;
}

.brand-tag {
  margin-left: 54px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.hint-inline,
.note,
.fineprint,
figcaption {
  color: var(--muted);
}

.price-bar {
  margin: 0;
  padding: 10px 16px;
  border-radius: 12px;
  background: linear-gradient(180deg, #6dceea, #2aa8d1);
  color: white;
  font-weight: 800;
  font-size: 15px;
  white-space: nowrap;
}

.hint-inline {
  margin: 0;
  font-size: 13px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 380px);
  gap: 18px;
  padding: 8px 22px 24px;
  align-items: start;
}

.intro {
  grid-column: 1 / -1;
  margin: 0 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.stage,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.stage {
  padding: 16px;
  min-height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
}

.panel {
  padding: 18px 18px 16px;
}

.stage .hint-inline {
  margin: 8px 4px 0;
}

.chip,
.ghost,
.upload,
.cta {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  cursor: pointer;
  transition:
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    color 0.22s ease;
}

.chip,
.ghost {
  padding: 10px 12px;
  color: var(--ink);
}

.chip.is-on,
.upload:hover,
.ghost:hover,
.chip:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.chip:hover,
.ghost:hover,
.cta:hover,
.upload:hover {
  transform: translateY(-1px);
}

.chip:active,
.ghost:active,
.cta:active,
.upload:active {
  transform: translateY(0) scale(0.985);
}

.stage-frame {
  position: relative;
  flex: 1;
  min-height: 520px;
  margin-top: 12px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 80%, rgba(94, 196, 227, 0.16), transparent 42%),
    linear-gradient(180deg, #fbfefe, #eef6fa);
  overflow: hidden;
}

.view-3d,
.view-2d {
  position: absolute;
  inset: 0;
}

.view-3d:not([hidden]),
.view-2d:not([hidden]) {
  animation: rise-in 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.view-3d.is-drop {
  outline: 2px dashed var(--accent-strong);
  outline-offset: -12px;
}

.view-3d canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.drag-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  pointer-events: none;
}

.view-2d {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8vw;
  padding: 28px 16px 40px;
}

.view-2d[hidden],
.view-3d[hidden] {
  display: none;
}

.pillow-card {
  margin: 0;
  text-align: center;
}

.pillow {
  position: relative;
  height: min(68vh, 620px);
  aspect-ratio: var(--pillow-ratio, 1 / 3);
  border-radius: 0;
  overflow: hidden;
  background: #f7f7f7;
  box-shadow:
    0 22px 40px rgba(22, 50, 74, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.55);
  cursor: grab;
  touch-action: none;
}

.pillow:active {
  cursor: grabbing;
}

.pillow-art {
  width: 100%;
  height: 100%;
  display: block;
}

.pillow-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(22, 40, 54, 0.07), transparent 10%, transparent 90%, rgba(22, 40, 54, 0.07));
  mix-blend-mode: multiply;
}

figcaption {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel section + section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.view-switch,
.row-btns,
.uploads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.grid-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.grid-btns.two {
  grid-template-columns: 1fr 1fr;
}

.note {
  margin: 8px 0 0;
  font-size: 12px;
}

.upload {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
}

.upload input {
  display: none;
}

.upload span {
  font-weight: 700;
}

.upload small {
  color: var(--muted);
  word-break: break-all;
}

.check {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
  font-size: 14px;
}

.checkout .consent {
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7fbfd;
  color: var(--ink);
  line-height: 1.45;
}

.checkout .consent input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--accent-strong);
}

.checkout .consent span {
  flex: 1;
  min-width: 0;
}

.checkout .consent + .consent {
  margin-top: 8px;
}

.checkout .consent a {
  color: var(--accent-strong);
  font-weight: 700;
}

.picked {
  display: grid;
  gap: 2px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #8fd0e6;
  border-radius: 14px;
  background: #e7f6fb;
}

.picked strong {
  font-size: 14px;
}

.picked span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

#post-office[readonly] {
  background: #f4f8fb;
  color: var(--ink);
}

.slider {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  font-size: 13px;
}

.slider input {
  width: 100%;
  accent-color: var(--accent-strong);
}

#btn-model-reset {
  width: 100%;
  margin-top: 8px;
}

.checkout label:not(.check) {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.checkout input,
.checkout select,
.checkout textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
}

.ship-methods {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.city-box {
  position: relative;
}

.order-page {
  padding: 8px 22px 24px;
}

.order-page:not([hidden]) {
  animation: rise-in 0.46s cubic-bezier(0.22, 1, 0.36, 1);
}

.order-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.order-head h2 {
  margin: 0;
}

.order-head .note {
  margin: 4px 0 0;
}

.order-layout {
  display: grid;
  gap: 18px;
  align-items: start;
}

.order-layout.has-map {
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
}

.order-layout:not(.has-map) {
  grid-template-columns: minmax(280px, 640px);
}

.map-card {
  padding: 16px;
}

.map-card h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

#pickup-map {
  height: min(68vh, 640px);
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #e7f1f6;
}

.city-list {
  position: absolute;
  z-index: 1000;
  left: 0;
  right: 0;
  margin: 4px 0 0;
  padding: 4px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  max-height: 220px;
  overflow: auto;
}

.city-list button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px;
  cursor: pointer;
  color: var(--ink);
}

.city-list button:hover {
  background: var(--accent-soft);
}

.totals {
  margin-top: 14px;
  display: grid;
  gap: 6px;
}

.totals div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.order-done {
  display: grid;
  gap: 8px;
}

.order-done p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.order-done ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.order-done li {
  margin: 4px 0;
}

a.cta {
  display: block;
  text-align: center;
  text-decoration: none;
}

.cta {
  width: 100%;
  margin-top: 18px;
  padding: 14px 16px;
  border: 0;
  background: linear-gradient(180deg, #6dceea, #2aa8d1);
  color: white;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 10px 24px rgba(42, 168, 209, 0.28);
}

.cta:not(.cta-secondary):hover {
  filter: brightness(1.04);
  box-shadow: 0 14px 28px rgba(42, 168, 209, 0.34);
}

.chip:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.cta-secondary {
  display: block;
  margin-top: 8px;
  text-align: center;
  text-decoration: none;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}

.cta-secondary:hover {
  filter: none;
  background: var(--accent-soft);
}

.fineprint {
  margin: 10px 2px 0;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 8px 12px 24px;
  }

  .topbar {
    padding: 12px;
    align-items: flex-start;
    flex-direction: column;
  }

  .stage {
    min-height: 70vh;
  }

  .order-page {
    padding: 8px 12px 24px;
  }

  .order-layout.has-map,
  .order-layout:not(.has-map) {
    grid-template-columns: 1fr;
  }

  #pickup-map {
    height: 320px;
    min-height: 280px;
  }

  .view-2d {
    gap: 24px;
  }

  .pillow {
    height: min(56vh, 480px);
  }
}

@media (max-width: 640px) {
  .view-2d {
    gap: 12px;
  }

  .pillow {
    height: min(48vh, 380px);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

.site-foot {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin: 0 22px 28px;
  padding: 18px 4px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.site-foot strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.site-foot span,
.site-foot a {
  display: block;
}

.site-foot a {
  color: var(--accent-strong);
  text-decoration: none;
}

.site-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-content: flex-start;
  justify-content: flex-end;
  max-width: 360px;
}

.cookie-bar {
  position: fixed;
  z-index: 20;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: var(--shadow);
}

.cookie-bar p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.cookie-bar a {
  color: var(--accent-strong);
  font-weight: 700;
}

.cookie-bar button {
  flex: none;
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  background: var(--accent-strong);
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.doc {
  max-width: 760px;
  margin: 0 auto;
  padding: 22px 22px 40px;
}

.doc .brand {
  margin-bottom: 22px;
}

.doc h1 {
  margin: 0 0 8px;
  font-size: 32px;
  letter-spacing: -0.04em;
}

.doc .updated {
  margin: 0 0 22px;
  color: var(--muted);
}

.doc h2 {
  margin: 26px 0 8px;
  font-size: 18px;
}

.doc p,
.doc li {
  line-height: 1.55;
}

.doc ul {
  padding-left: 18px;
}

.doc a {
  color: var(--accent-strong);
}

.doc .callout {
  margin: 18px 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f7fbfd;
  border: 1px solid var(--line);
}

.doc .site-foot {
  margin: 28px 0 0;
}

@media (max-width: 720px) {
  .brand-logo {
    height: 40px;
  }

  .brand-tag {
    margin-left: 42px;
  }

  .site-foot,
  .cookie-bar {
    flex-direction: column;
  }

  .site-foot nav {
    justify-content: flex-start;
  }
}
