:root {
  --bg: #0f0d0c;
  --panel: #171311;
  --text: #eadfcd;
  --accent: #c79a3b;
  --accent-2: #6e4a2b;
  --danger: #d46d67;
  --line: #3e2e22;
  --product-image-scale: 1.44;
}

* {
  box-sizing: border-box;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #211912 0%, var(--bg) 58%);
  color: var(--text);
}

main {
  display: grid;
  grid-template-columns: 340px minmax(560px, 1fr) 320px;
  min-height: 100vh;
  height: 100vh;
}

.panel {
  padding: 0 1rem 1rem;
  border-right: 1px solid var(--line);
  background: var(--panel);
  overflow-y: auto;
}

.location-panel {
  border-right: 0;
  border-left: 1px solid var(--line);
}

.panel-brand-logo {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  max-width: 100%;
  margin: 0 0 0.8rem;
  padding: 0.45rem 0.55rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.38);
}

.panel-brand-logo img {
  max-width: 100%;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.panel section {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem;
  margin-bottom: 0.8rem;
  background: #110f0d;
}

h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: #f3d99c;
}

label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
}

input,
textarea,
select,
button {
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.55rem 0.6rem;
  border-radius: 8px;
  border: 1px solid #5b3f2a;
  font-size: 0.95rem;
  background: #1f1814;
  color: #f7ead3;
}

textarea {
  resize: vertical;
  min-height: 110px;
}

.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

button {
  cursor: pointer;
  background: linear-gradient(160deg, #3c2a1e, #2a1d15);
}

button.active,
button:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(199, 154, 59, 0.28);
}

button:disabled {
  opacity: 0.7;
  cursor: progress;
}

button.danger {
  background: #3f1d1c;
  color: #f5c7c1;
  border-color: #7f3d39;
}

button.secondary {
  margin-top: 0.5rem;
}

.palette-label {
  display: inline-block;
  margin: 0.2rem 0 0.45rem;
  font-size: 0.88rem;
  color: #d8c6a5;
}

.color-palette {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.color-swatch {
  width: 100%;
  aspect-ratio: 1;
  margin: 0;
  padding: 0;
  background: var(--swatch-color) !important;
  border: 2px solid #624833;
  border-radius: 8px;
}

.color-swatch.active {
  border-color: #f7e5c5;
  box-shadow: 0 0 0 2px rgba(247, 229, 197, 0.35);
}

.location-sketches {
  display: grid;
  gap: 0.8rem;
}

.shirt-card {
  border: 1px solid #4b3728;
  border-radius: 10px;
  padding: 0.65rem;
  background: #16110e;
}

.shirt-card h3 {
  margin: 0 0 0.45rem;
  font-size: 0.88rem;
  color: #e3c992;
}

.shirt-sketch {
  position: relative;
  border: 1px dashed #65492f;
  border-radius: 10px;
  padding: 0.55rem;
  min-height: 230px;
  background: radial-gradient(circle at top, #271d16, #140f0c 70%);
}

.location-garment-image {
  width: 100%;
  height: 210px;
  object-fit: contain;
  object-position: center;
  display: block;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.3));
}

.sketch-point {
  position: absolute;
  width: 72px;
  transform: translate(-50%, -50%);
  padding: 0.2rem 0.28rem;
  margin: 0;
  border-radius: 6px;
  border: 1px solid #8f6b3e;
  background: linear-gradient(160deg, #47311f, #332316);
  font-size: 0.54rem;
  line-height: 1.15;
  text-align: center;
  color: #f4dfbb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

.sketch-point.x-marker {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: left 0.2s ease, top 0.2s ease;
}

.sketch-point.wide {
  width: 94px;
}
.muted {
  margin: 0 0 0.7rem;
  color: #d2b791;
  font-size: 0.86rem;
  line-height: 1.35;
}

.status {
  margin: 0.7rem 0 0;
  min-height: 1.3rem;
  font-size: 0.85rem;
}

.status[data-type='success'] {
  color: #9be0af;
}

.status[data-type='error'] {
  color: #f3a7a1;
}

.status[data-type='info'] {
  color: #e7d39a;
}

.design-status {
  width: min(100%, 552px);
  margin: 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid #5d422c;
  border-radius: 10px;
  background: rgba(17, 13, 10, 0.94);
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  z-index: 2000;
  padding: 1rem;
}

.modal.hidden {
  display: none;
}

.modal-content {
  width: min(680px, 100%);
  max-height: min(90vh, 820px);
  overflow-y: auto;
  border: 1px solid #5d422c;
  border-radius: 16px;
  background: linear-gradient(180deg, #1a130f, #120d0a);
  padding: 1rem 1rem 0.9rem;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.modal-close-btn {
  width: 38px;
  height: 38px;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  border: 1px solid #7c5a35;
  background: rgba(39, 28, 20, 0.95);
  color: #f4dfbb;
  font-size: 1.25rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.modal-preview-grid figure {
  margin: 0;
  border: 1px solid #4b3728;
  border-radius: 10px;
  padding: 0.45rem;
  background: #1b1410;
}

.modal-preview-grid figcaption {
  font-size: 0.84rem;
  color: #f0d49d;
  margin-bottom: 0.4rem;
}

.modal-preview-grid img {
  width: 100%;
  border-radius: 8px;
  min-height: 140px;
  object-fit: contain;
  background: #0f0d0c;
}

.modal-price {
  border: 1px solid #654a32;
  border-radius: 12px;
  padding: 0.75rem;
  margin-bottom: 0.85rem;
  font-size: 0.92rem;
  background: rgba(30, 22, 17, 0.75);
}

#modalContactForm {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
}

#modalContactForm label {
  margin-bottom: 0.35rem;
}

#modalContactForm input,
#modalContactForm textarea {
  border-color: #745433;
  background: #221913;
}

.hp-wrap {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.price-calculator {
  display: grid;
  gap: 0.45rem;
}

.price-result {
  margin-top: 0.4rem;
  border: 1px solid #4b3728;
  border-radius: 10px;
  background: #1a1411;
  padding: 0.7rem;
  line-height: 1.35;
  font-size: 0.9rem;
}

.price-total {
  font-size: 1.2rem;
  font-weight: 700;
  color: #f3d99c;
  margin-bottom: 0.35rem;
}

.price-breakdown {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.2rem;
}

.designer-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-direction: column;
  gap: 0.75rem;
}

.brand-logo {
  width: min(100%, 560px);
  display: flex;
  justify-content: flex-start;
  padding-left: 0.25rem;
}

.brand-logo img {
  width: 195px;
  height: auto;
  display: block;
}

.product-preview {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: 100%;
  border: 1px solid #4e3a2a;
  border-radius: 18px;
  background: linear-gradient(180deg, #241b16, #16100d);
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.quick-contact-btn {
  position: absolute;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 6;
  width: 62px;
  height: 62px;
  border-radius: 999px;
  border: 1px solid #b8864b;
  background: radial-gradient(circle at 30% 25%, #845731, #3b281b 76%);
  color: #f4dfbb;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  animation: contactPulse 2.2s ease-in-out infinite;
}

.quick-contact-btn__icon {
  font-size: 2rem;
  transform: translateY(-1px);
}

.quick-contact-btn.hidden {
  display: none;
}

.quick-contact-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

@keyframes contactPulse {
  0%,
  100% {
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(199, 154, 59, 0.35);
  }
  50% {
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.4), 0 0 0 10px rgba(199, 154, 59, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .quick-contact-btn {
    animation: none;
  }
}


.close-designer-btn {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  z-index: 5;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #8f6b3e;
  background: linear-gradient(160deg, #47311f, #332316);
  color: #f4dfbb;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

.close-designer-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(199, 154, 59, 0.28);
}

.product-photo {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
  pointer-events: none;
}

.product-photo img {
  width: min(100%, 552px);
  height: min(100%, 672px);
  object-fit: contain;
  object-position: center;
  transform: scale(var(--product-image-scale));
  transition: filter 0.2s ease;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.26));
}

#designerCanvas,
.canvas-container,
.canvas-container .upper-canvas {
  position: relative;
  z-index: 2;
}

#printArea {
  position: absolute;
  width: 236px;
  height: 214px;
  border: 2px dashed rgba(199, 154, 59, 0.5);
  border-radius: 12px;
  z-index: 1;
  pointer-events: none;
}

@media (max-width: 1280px) {
  main {
    grid-template-columns: 320px 1fr;
  }

  .location-panel {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .location-sketches {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 1024px) {
  main {
    grid-template-columns: 1fr;
  }

  .panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .designer-stage {
    justify-content: center;
    padding: 1rem;
  }

  .product-preview {
    width: min(96vw, 560px);
    height: 720px;
    min-height: 0;
  }

  .designer-stage {
    position: static;
    height: auto;
  }

  .location-sketches {
    grid-template-columns: 1fr;
  }
}
