:root {
  --bg: #f3f4f7;
  --card-bg: #ffffff;
  --ink: #1c2333;
  --muted: #6b7280;
  --accent: #2b6cb0;
  --accent-2: #16a34a;
  --border: #e2e4ea;
  --radius: 14px;
  --hole-bg: #ffffff;
  font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

.site-header {
  position: relative;
  text-align: center;
  padding: 28px 20px 14px;
}
.site-header h1 {
  margin: 0 0 6px;
  font-size: 1.7rem;
}
.site-header p {
  margin: 0;
  color: var(--muted);
}

.btn-back-home {
  position: absolute;
  left: 20px;
  top: 24px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
.btn-back-home:hover {
  border-color: var(--accent);
  color: var(--accent);
}
@media (max-width: 560px) {
  .btn-back-home {
    position: static;
    display: inline-block;
    margin-bottom: 10px;
  }
}

.layout {
  max-width: 760px;
  margin: 0 auto;
  padding: 10px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.step {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 20px;
}

.step h2 {
  font-size: 1.05rem;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* Brand grid */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

.brand-card {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 12px 10px 10px;
  text-align: center;
  cursor: pointer;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.brand-card:hover {
  border-color: #b9c2d6;
}
.brand-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(43,108,176,0.15);
}

.brand-card img {
  width: 100%;
  height: 64px;
  object-fit: contain;
  margin-bottom: 8px;
}

.brand-card .brand-name {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.variant-toggle {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.variant-toggle button {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #f7f8fa;
  cursor: pointer;
  color: var(--muted);
}
.variant-toggle button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.variant-toggle button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Back grid */
.back-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.back-card {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  background: #fff;
}
.back-card:hover { border-color: #b9c2d6; }
.back-card.selected {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(22,163,74,0.15);
}
.back-card .swatch {
  position: relative;
  width: 100%;
  height: 70px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.back-card .back-name {
  font-size: 0.82rem;
  font-weight: 600;
}

/* Zemin Rengi seçici artık "Sadece Yazı" kartının swatch alanının içine gömülü */
.plain-color-hidden-src {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.back-card .swatch input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
  pointer-events: auto;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
}

.threed-note {
  font-size: 0.82rem;
  color: var(--muted);
  background: #f3f4f7;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 14px;
}

/* Arka yüz adımındaki yan yana bilgi satırları (Firma/İletişim, Koku+Adet) */
.detail-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}
.detail-row .field {
  flex: 1 1 180px;
  min-width: 140px;
}

/* Form */
.form-grid {
  display: grid;
  gap: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}
.field em {
  color: #d33;
  font-style: normal;
  font-weight: 400;
}
.field input,
.field select {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 400;
}

/* Quantity stepper */
.qty-control {
  display: flex;
  align-items: center;
  gap: 10px;
}
.qty-control button {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #f7f8fa;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.qty-control button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.qty-control input {
  flex: 1;
  text-align: center;
  font-weight: 700;
  padding: 10px 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}
.qty-control input::-webkit-inner-spin-button,
.qty-control input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Price box */
.price-box {
  margin-top: 16px;
  padding: 14px 16px;
  background: #f7f9fc;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.86rem;
  padding: 3px 0;
}
.price-row strong {
  font-size: 0.95rem;
  color: var(--ink);
}
.price-note {
  margin: 6px 0 0;
  font-size: 0.7rem;
  color: var(--muted);
  text-align: right;
}

/* Preview panel */
.preview-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.preview-panel h2 {
  font-size: 1.05rem;
  margin: 0 0 16px;
}

.preview-cards {
  display: flex;
  gap: 16px;
  justify-content: center;
}
.preview-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.preview-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.card-stage {
  width: 148px;
  height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Die-cut rounded card (2D + back designs) */
.diecut-card {
  position: relative;
  width: 140px;
  height: 190px;
  margin-top: 22px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  overflow: hidden;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.diecut-card::before {
  content: '';
  position: absolute;
  top: -34px;
  left: 50%;
  width: 46px;
  height: 46px;
  transform: translateX(-50%);
  border: 3px solid #23262e;
  border-radius: 50%;
  border-bottom-color: transparent;
  border-right-color: transparent;
  rotate: 45deg;
  opacity: 0.85;
}
.diecut-card::after {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--hole-bg);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.12) inset;
  z-index: 5;
}

.diecut-card .logo-fit {
  width: 78%;
  height: 68%;
  object-fit: contain;
  margin-top: 8px;
}

/* ---------- Nameplate card: logo on top, brand-colored name bar below ---------- */
.nameplate-card {
  position: relative;
  width: 140px;
  height: 190px;
  margin-top: 22px;
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.nameplate-card::after {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--hole-bg);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.12) inset;
  z-index: 5;
}
.nameplate-logo {
  flex: 0 0 74%;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
.nameplate-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  text-align: center;
}
.nameplate-name {
  color: #fff;
  font-family: 'Archivo Black', 'Segoe UI', Arial, sans-serif;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.15;
  word-break: break-word;
  max-width: 100%;
}
.nameplate-phone {
  color: rgba(255,255,255,0.9);
  font-size: 0.52rem;
  margin-top: 2px;
  font-weight: 600;
}

/* ---------- Shell "same image" back: real sticker asset with a blank bar for text ---------- */
.shell-same-wrap {
  position: relative;
  width: 140px;
  margin-top: 22px;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,0.18));
}
.shell-same-wrap img {
  display: block;
  width: 100%;
  height: auto;
}
.shell-same-text {
  position: absolute;
  top: 73%;
  left: 5%;
  width: 90%;
  height: 23%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.shell-same-text .nameplate-name {
  font-size: 0.72rem;
}
.shell-same-text .nameplate-phone {
  font-size: 0.55rem;
}

/* Shape-masked card: follows a brand's real logo silhouette instead of a rounded rectangle */
.diecut-card.shape-mask {
  background-color: transparent;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.28));
  overflow: visible;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.diecut-card.shape-mask::before,
.diecut-card.shape-mask::after {
  content: none;
}
.diecut-card.shape-mask .logo-fit {
  width: 100%;
  height: 100%;
  margin-top: 0;
}

.diecut-card .scent-pill {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  background: rgba(255,255,255,0.85);
  padding: 2px 10px;
  border-radius: 20px;
  color: #333;
  font-weight: 600;
  white-space: nowrap;
}

/* Text overlays on back patterns — written directly on the artwork, no background chip */
.text-chip {
  position: absolute;
  max-width: 86%;
  text-align: center;
  line-height: 1.25;
}
.text-chip .tc-name {
  font-size: 0.7rem;
  font-weight: 700;
  word-break: break-word;
}
.text-chip .tc-phone {
  font-size: 0.6rem;
  margin-top: 2px;
  font-weight: 600;
}

/* Color variants */
.txt-navy .tc-name,
.txt-navy .tc-phone {
  color: #0f1f4d;
  text-shadow: 0 1px 2px rgba(255,255,255,0.55);
}
.txt-white .tc-name,
.txt-white .tc-phone {
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.55);
}

.pos-nazar {
  top: 47%;
  left: 49%;
  transform: translate(-50%, -50%);
  width: 60%;
}
.pos-bottom {
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 82%;
}
.pos-shell-bottom {
  bottom: 58px;
  left: 50%;
  transform: translateX(-50%);
  width: 54%;
}
.pos-plain {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 88%;
}
.pos-plain .tc-name {
  font-size: 1rem;
  color: var(--plain-text-color, #fff);
}
.pos-plain .tc-phone {
  font-size: 0.78rem;
  color: var(--plain-text-color, #fff);
  margin-top: 4px;
}

/* 3D real photo preview (no die-cut wrapper) */
.photo-card {
  width: 140px;
  height: auto;
  max-height: 190px;
  margin-top: 22px;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,0.18));
}

/* 3D back preview: real blank-back product photo + centered company text on top */
.photo3d-back-wrap {
  position: relative;
  width: 140px;
  margin-top: 22px;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,0.18));
}
.photo3d-back-wrap img {
  display: block;
  width: 100%;
  height: auto;
}
.photo3d-back-text {
  transform: translate(-50%, -50%);
  text-shadow: none;
  color: var(--plain-text-color, #1c2333);
}
.photo3d-back-text .tc-name,
.photo3d-back-text .tc-phone {
  color: var(--plain-text-color, #1c2333);
}

.empty-hint {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  padding: 20px 10px;
}

.scent-caption {
  text-align: center;
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--muted);
}
.scent-caption strong {
  color: var(--ink);
}

.order-box {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.validation-msg {
  font-size: 0.78rem;
  color: #c0392b;
  min-height: 1em;
  margin: 0;
  text-align: center;
}
.btn {
  font: inherit;
  font-weight: 700;
  padding: 12px 14px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 0.9rem;
}
.btn-whatsapp { background: #25d366; }
.btn-whatsapp:hover { background: #1ebd59; }
.btn-email { background: var(--accent); }
.btn-email:hover { background: #235a91; }
.btn-save { background: var(--accent-2); }
.btn-save:hover { background: #128a3e; }
.btn-save:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-gohome { background: var(--accent); }
.btn-gohome:hover { background: #235a91; }
.save-hint {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  margin: 0;
  min-height: 1em;
}
.save-hint.ok { color: #16a34a; font-weight: 600; }

.site-footer {
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-size: 0.8rem;
}
