:root {
  --bg: #f3f4f7;
  --card-bg: #ffffff;
  --ink: #1c2333;
  --muted: #6b7280;
  --accent: #2b6cb0;
  --accent-2: #16a34a;
  --border: #e2e4ea;
  --radius: 14px;
  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;
}

/* Model / Marka grid (ikisi de aynı kart stilini paylaşır) */
.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;
}

/* Arka yüz / firma bilgisi adımındaki yan yana satırlar */
.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:first-of-type {
  margin-top: 0;
}
.detail-row .field {
  flex: 1 1 180px;
  min-width: 140px;
}

.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;
}
.field input[type="color"] {
  padding: 4px;
  height: 42px;
  cursor: pointer;
}

/* Çakmak rengi: serbest renk seçici yerine 7 sabit ana renkten oluşan kartela */
.color-swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.color-swatch {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 2px solid var(--border);
  padding: 0;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.color-swatch:hover {
  transform: scale(1.06);
}
.color-swatch.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(43,108,176,0.18);
}

/* 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: 24px;
  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: 140px;
  height: 230px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* ---------- Çakmak önizlemesi: gerçek ürün fotoğrafından kesilmiş silüet ----------
   İki katman üst üste: (1) seçilen modelin gerçek dış hattı (shape PNG), CSS mask ile
   müşterinin seçtiği renge boyanır; (2) aynı modelin orijinal kapak/çakmak mekanizması
   kesimi (cap PNG, varsa) bunun üzerine değişmeden bindirilir - böylece gövde rengi
   değişirken kapak/mekanizma her zaman gerçek haliyle (siyah/krom) kalır. */
.lighter-preview {
  position: relative;
  margin-top: 14px;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,0.28));
}
.lighter-color-fill {
  position: absolute;
  inset: 0;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.lighter-cap-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.lighter-label {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 6%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  max-height: 84%;
}
.lighter-label img {
  max-width: 88%;
  max-height: 90%;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.25));
}
/* Firma ismi ve iletişim no, gerçek basılı çakmaklarda olduğu gibi gövde boyunca
   DİKEY yazılır (bkz. assets/promosyon-cakmak.png referansı) - dar gövdeye yatay
   yazıdan çok daha rahat sığar. İkisi de dikey, yan yana iki ayrı sütun halinde. */
.lighter-name-vertical,
.lighter-phone-vertical {
  /* transform:rotate() GERÇEK YER KAPLAMAZ (layout kutusu eskisi gibi yatay kalır) -
     bu yüzden altındaki telefon numarasının üzerine biniyordu. writing-mode ise
     tarayıcının asıl yer ayırdığı (dikey) bir kutu oluşturur, üst üste binme olmaz. */
  writing-mode: vertical-rl;
  text-orientation: sideways;
  transform: rotate(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 100%;
}
.lighter-label .tc-name {
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}
.lighter-label .tc-phone {
  font-size: 0.62rem;
  font-weight: 600;
  white-space: nowrap;
}
.txt-navy .tc-name, .txt-navy .tc-phone { color: #0f1f4d; text-shadow: 0 1px 3px rgba(255,255,255,0.65); }
.txt-white .tc-name, .txt-white .tc-phone { color: #ffffff; text-shadow: 0 1px 3px rgba(0,0,0,0.55); }

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

.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-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;
}
