:root {
  --bg: #060606;
  --panel: rgba(16, 13, 10, 0.9);
  --panel-border: rgba(222, 179, 92, 0.34);
  --text: #f8eed6;
  --muted: #d6c29a;
  --accent: #d1a24f;
  --accent-dark: #a86e1a;
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background:
    linear-gradient(rgba(8, 8, 8, 0.86), rgba(8, 8, 8, 0.9)),
    url("./assets/jpc-watermark-logo.png") center 18px / min(50vw, 560px) auto no-repeat,
    radial-gradient(circle at 18% 16%, rgba(255, 219, 145, 0.12), transparent 18%),
    radial-gradient(circle at 82% 20%, rgba(255, 214, 129, 0.08), transparent 20%),
    linear-gradient(135deg, #050505 0%, #0b0b0b 34%, #15120e 68%, #050505 100%);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero,
.layout {
  display: grid;
  gap: 24px;
}

.hero {
  grid-template-columns: 1fr auto;
  align-items: end;
  margin-bottom: 24px;
}

.hero-text {
  justify-self: center;
  text-align: center;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: #f4d07b;
  text-shadow: 0 0 18px rgba(209, 162, 79, 0.2);
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.98;
  max-width: none;
  color: #f7d78d;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.38);
}

.hero-copy {
  margin-top: 16px;
  max-width: 58ch;
  margin-left: auto;
  margin-right: auto;
  color: #e2cfaa;
  line-height: 1.6;
}

.layout {
  grid-template-columns: minmax(320px, 1.1fr) minmax(320px, 0.9fr);
}

.preview-card,
.controls-card,
.cart-drawer {
  background: var(--panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  position: relative;
}

.preview-card::before,
.controls-card::before,
.cart-drawer::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  border: 1px solid rgba(255, 222, 163, 0.08);
  pointer-events: none;
}

.preview-card::after,
.controls-card::after,
.cart-drawer::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  box-shadow: 0 0 28px rgba(209, 162, 79, 0.14);
  opacity: 0.9;
  pointer-events: none;
}

.preview-card,
.controls-card {
  padding: 24px;
}

.side-switch {
  display: inline-flex;
  gap: 10px;
  margin-bottom: 18px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 222, 163, 0.08);
  border: 1px solid rgba(222, 179, 92, 0.18);
}

.side-button {
  padding: 10px 18px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
}

.side-button.active {
  background: linear-gradient(135deg, rgba(248, 214, 144, 0.2), rgba(168, 110, 26, 0.28));
  color: #fff5dd;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

.product-stage {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  border-radius: 24px;
  background: #ffffff;
}

.stage-watermark {
  position: absolute;
  inset: 0;
  background-image:
    url("./assets/jpc-watermark-logo.png"),
    url("./assets/jpc-watermark-logo.png"),
    url("./assets/jpc-watermark-logo.png"),
    url("./assets/jpc-watermark-logo.png"),
    url("./assets/jpc-watermark-logo.png"),
    url("./assets/jpc-watermark-logo.png");
  background-position:
    22% 22%,
    50% 18%,
    77% 24%,
    24% 58%,
    51% 56%,
    78% 60%;
  background-repeat: no-repeat;
  background-size:
    88px auto,
    96px auto,
    90px auto,
    94px auto,
    102px auto,
    92px auto;
  opacity: 0.26;
  mix-blend-mode: screen;
  filter: brightness(1.22) saturate(1.18);
  pointer-events: none;
  z-index: 3;
}

.product-shadow {
  position: absolute;
  inset: auto 16% 9% 16%;
  height: 54px;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.26), transparent 65%);
  filter: blur(18px);
}

.product-body {
  --product-color: #151515;
  position: absolute;
  inset: 8% 17% 12%;
  border-radius: 26px 26px 42px 42px;
  z-index: 2;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.2), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(0, 0, 0, 0.08)),
    var(--product-color);
}

.product-body[data-type="tshirt"] {
  inset: 2% 7% 1%;
  border-radius: 0;
  background: var(--tshirt-image, url("./assets/tshirt-front-white.png")) center 3% / 96% auto no-repeat;
  clip-path: polygon(8% 4%, 35% 0%, 65% 0%, 92% 4%, 100% 34%, 88% 39%, 86% 100%, 14% 100%, 12% 39%, 0% 34%);
}

.product-body[data-type="tshirt"]::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--product-color);
  mix-blend-mode: multiply;
  opacity: var(--tshirt-overlay-opacity, 0.94);
  z-index: 1;
}

.product-body[data-type="tshirt"] .product-collar,
.product-body[data-type="tshirt"] .product-sleeve {
  display: none;
}

.product-body[data-type="hoodie"] {
  inset: 2% 6% 2%;
  border-radius: 0;
  background:
    var(--hoodie-image, url("./assets/hoodie-front-white.png"))
    var(--hoodie-position, center top)
    / var(--hoodie-size, 94% auto)
    no-repeat;
}

.product-body[data-type="hoodie"] .product-collar,
.product-body[data-type="hoodie"] .product-sleeve {
  display: none;
}

.product-body[data-type="sweater"] {
  inset: 11% 16% 10%;
}

.product-body[data-type="tote"] {
  inset: 19% 24% 10%;
  border-radius: 20px;
}

.product-collar,
.product-sleeve {
  position: absolute;
  background: inherit;
}

.product-collar {
  top: -22px;
  left: 50%;
  width: 124px;
  height: 76px;
  transform: translateX(-50%);
  border-radius: 0 0 58px 58px;
  clip-path: ellipse(50% 100% at 50% 100%);
}

.product-sleeve {
  top: 18px;
  width: 120px;
  height: 170px;
  border-radius: 26px;
}

.product-sleeve.left {
  left: -66px;
  transform: rotate(18deg);
}

.product-sleeve.right {
  right: -66px;
  transform: rotate(-18deg);
}

.product-body[data-type="tote"] .product-collar,
.product-body[data-type="tote"] .product-sleeve {
  display: none;
}

.product-body[data-type="tote"]::before,
.product-body[data-type="tote"]::after {
  content: "";
  position: absolute;
  top: -58px;
  width: 88px;
  height: 94px;
  border: 14px solid rgba(255, 255, 255, 0.28);
  border-bottom: 0;
  border-radius: 44px 44px 0 0;
}

.product-body[data-type="tote"]::before {
  left: 48px;
}

.product-body[data-type="tote"]::after {
  right: 48px;
}

.print-zone {
  position: absolute;
  inset: 18% 16% 20%;
  border: 2px dashed rgba(255, 255, 255, 0.34);
  border-radius: 18px;
  overflow: hidden;
  cursor: grab;
  z-index: 7;
}

.product-body[data-type="tshirt"] .print-zone {
  inset: 19% 26% 25%;
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 18px;
  clip-path: none;
}

.product-body[data-type="hoodie"] .print-zone {
  inset: 20% 25% 22%;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
}

.product-body[data-type="sweater"] .print-zone {
  inset: 19% 21% 22%;
}

.product-body[data-type="tote"] .print-zone {
  inset: 20% 14% 15%;
}

.print-zone.dragging {
  cursor: grabbing;
}

#design-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  transform: translate(-50%, -50%);
}

#design-image {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: center center;
  object-fit: contain;
  user-select: none;
  max-width: none;
  pointer-events: none;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 600;
  line-height: 1.5;
}

.stage-note,
.size-note,
.checkout-note {
  margin-top: 16px;
  color: var(--muted);
  line-height: 1.5;
}

.size-note {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 220, 150, 0.08);
  border: 1px solid rgba(222, 179, 92, 0.2);
  font-weight: 600;
}

.controls-card {
  display: grid;
  gap: 18px;
  align-content: start;
}

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

.control-group {
  display: grid;
  gap: 10px;
}

.control-group label,
.label-title {
  font-weight: 700;
}

.availability-note {
  min-height: 22px;
  color: #f0c86f;
  font-size: 0.92rem;
  font-weight: 700;
}

.upload-tip {
  font-size: 0.9rem;
  color: #e9c977;
  line-height: 1.5;
}

input[type="text"],
input[type="number"],
input[type="file"],
select {
  width: 100%;
  border: 1px solid rgba(222, 179, 92, 0.2);
  background: rgba(255, 248, 236, 0.92);
  border-radius: 14px;
  padding: 14px 16px;
  color: #21180d;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.swatch {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(29, 28, 26, 0.14);
  cursor: pointer;
}

.swatch.active {
  box-shadow: 0 0 0 3px rgba(183, 108, 55, 0.35);
}

.swatch.unavailable {
  position: relative;
  opacity: 0.45;
}

.swatch.unavailable::after {
  content: "";
  position: absolute;
  inset: 19px 4px auto 4px;
  height: 2px;
  background: rgba(29, 28, 26, 0.74);
  transform: rotate(-35deg);
}

.cta-row,
.cart-item-row,
.cart-total-row,
.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cta-row {
  gap: 14px;
  margin-top: 6px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
}

.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 10px 24px rgba(168, 110, 26, 0.26);
}

.secondary,
.ghost,
.cart-button {
  color: var(--text);
  background: linear-gradient(135deg, rgba(30, 23, 17, 0.94), rgba(17, 13, 10, 0.94));
  border: 1px solid rgba(222, 179, 92, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 223, 168, 0.08);
}

.cart-button span {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  margin-left: 10px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
}

.cart-drawer {
  position: fixed;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: min(420px, calc(100% - 32px));
  padding: 24px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  transform: translateX(calc(100% + 32px));
  transition: transform 0.25s ease;
  z-index: 20;
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-items {
  display: grid;
  gap: 14px;
  overflow: auto;
  align-content: start;
}

.cart-item {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(22, 17, 13, 0.96), rgba(14, 11, 9, 0.94));
  border: 1px solid rgba(222, 179, 92, 0.18);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  align-items: start;
}

.cart-item-previews {
  display: grid;
  gap: 10px;
}

.cart-side-preview {
  margin: 0;
  display: grid;
  gap: 6px;
}

.cart-side-preview figcaption {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cart-item-preview {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(222, 179, 92, 0.18);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  overflow: hidden;
}

.cart-item-design {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: none;
  object-fit: contain;
  transform-origin: center center;
  pointer-events: none;
}

.cart-item-content {
  display: grid;
  gap: 8px;
}

.cart-item-meta,
.link-button {
  color: var(--muted);
}

.link-button {
  padding: 0;
  background: transparent;
  text-align: left;
}

.full {
  width: 100%;
}

.empty-cart {
  padding: 18px;
  border-radius: 18px;
  background: rgba(22, 17, 13, 0.88);
  border: 1px solid rgba(222, 179, 92, 0.18);
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 980px) {
  .hero,
  .layout,
  .control-grid {
    grid-template-columns: 1fr;
  }

  .product-stage {
    min-height: 520px;
  }

  .cta-row {
    flex-direction: column;
  }

  .cta-row button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 1280px);
    padding-top: 20px;
  }

  .preview-card,
  .controls-card,
  .cart-drawer {
    border-radius: 22px;
  }

  .product-stage {
    min-height: 420px;
  }
}
