/* Atroq varsayılan font */
@font-face {
  font-family: "AtroqFont";
  src: url("../fonts/atroq.ttf") format("opentype");
}

/* THEME */
:root {
  --pink: #e3242b;
  --red: #e3242b;
  --bg: #000;
  --panel: #111;
  --panel-2: #1a1a1a;
  --text: #fff;
  --muted: #bbb;
  --card: #151515;
  --card-border: #222;
  --design-scale: 1; /* JS güncelliyor */
}

/* RESET / BASE */
* { box-sizing: border-box; }
body {
  margin: 0;
  background-color: var(--bg);
  font-family: "Overpass", sans-serif;
  color: var(--text);
  padding: 20px;
  text-align: center;
}
h1 { color: var(--pink); margin-bottom: 30px; }
.hidden { display: none !important; }
.mt-0 { margin-top: 0 !important; }
.mb-8 { margin-bottom: 8px !important; }
.mb-12 { margin-bottom: 12px !important; }
.mb-16 { margin-bottom: 16px !important; }
.mt-16 { margin-top: 16px !important; }
.block { display: block; }
.flex-1 { flex: 1; }
.fw-700 { font-weight: 700; }

/* Layout */
.container {
  position: relative;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto 24px auto;
}
#plateFrame { width: 100%; height: auto; display: block; }
#designArea { position: absolute; overflow: hidden; pointer-events: none; }

/* Text layer */
#customText {
  position: absolute; width: 100%; height: 100%;
  font-weight: 600; color: var(--red); text-align: center;
  white-space: nowrap; pointer-events: none;
  font-family: "AtroqFont","Overpass",sans-serif;
  transition: all .3s ease;
}

/* Uploaded image */
#customImage {
  position: absolute; top: 0; left: 0;
  width: auto; height: auto;
  pointer-events: auto; display: none; cursor: move;
  transform-origin: center center;
}

/* Panels */
.panel {
  max-width: 980px; margin: 0 auto;
  background: var(--panel); border: 1px solid #222;
  border-radius: 12px; padding: 18px; text-align: left;
}
.controls .option { margin-bottom: 18px; }

label { display: block; margin-bottom: 6px; font-weight: 600; color: #ccc; }

input, select {
  width: 100%; padding: 10px; font-size: 16px;
  border: none; border-radius: 8px; margin-bottom: 10px;
  background: #222; color: #fff;
}
textarea {
  width: 100%; padding: 10px; font-size: 16px;
  border: none; border-radius: 8px; margin-bottom: 10px;
  background: #222; color: #fff;
  resize: vertical; min-height: 100px;
  font-family: "Overpass", sans-serif;
}
textarea::placeholder { color: #999; opacity: 1; }

.row { display: flex; gap: 10px; align-items: center; }
.row.font-row select { flex: 4; }
.row.font-row .small-btn {
  flex: 1; padding: 8px 10px; font-size: .9rem;
  background: #555; color: #fff; border: none; border-radius: 8px; cursor: pointer;
}
.row.font-row .small-btn:hover { background: #777; }
.row.text-style-row > div { flex: 1; }

/* Buttons */
.btn {
  display: block; width: 100%;
  padding: 14px; font-size: 1rem;
  background-color: var(--pink); color: #000;
  border: none; border-radius: 10px; cursor: pointer;
  text-transform: uppercase; font-weight: 700; letter-spacing: 1px;
}
.btn:hover { background: #d1a5ae; }
.btn-secondary { background: #2a2a2a; color: #fff; }
.btn-secondary:hover { background: #3a3a3a; }

/* Metallic look */
.silver-text {
  background: linear-gradient(90deg, #e6e5e1, #e1e0dc, #f0ece6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: brightness(1.8);
}
.gold-text {
  background: linear-gradient(90deg, #b8860b, #ffd700, #ffec8b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: brightness(1.3);
}

/* Checkout */
#checkoutPanel {}
.checkout-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 900px){ .checkout-grid { grid-template-columns: 1fr 1fr; } }
.box { background: var(--panel-2); border: 1px solid #222; border-radius: 10px; padding: 14px; }
.box h3 { margin: 0 0 10px 0; color: #eee; font-weight: 700; }
.muted { color: var(--muted); font-size: .9rem; }
.price-row { display: flex; gap: 10px; align-items: end; }
.price-row > div { flex: 1; }

.summary { display: grid; gap: 8px; grid-template-columns: 1fr auto; align-items: center; font-size: 15px; }
.summary .label { color: #ccc; }
.summary .value { color: #fff; font-weight: 700; }
.summary .value.big { font-size: 1.15rem; }

.inline { display: flex; gap: 10px; }
.actions { display: flex; gap: 12px; margin-top: 12px; }
.actions .btn { flex: 1; }
.note { color: #aaa; font-size: .85rem; margin-top: 6px; }
.section-title { text-align: left; margin: 0 0 12px 0; }

/* Preview box (inline style’dan taşındı) */
.preview-box {
  text-align: center; background: var(--panel-2);
  border: 1px solid #333; border-radius: 10px;
  padding: 16px; margin-bottom: 20px;
}
.preview-box h3 { color: #eee; margin-top: 0; }
.preview-img { max-width: 100%; border-radius: 8px; border: 1px solid #333; }

/* Templates */
#templatesPanel {}
.templates-info { color: #ddd; font-size: .95rem; margin: 6px 0 14px 0; }
.templates-grid { display: grid; grid-template-columns: repeat(1,1fr); gap: 14px; }
@media (min-width: 680px){ .templates-grid { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 980px){ .templates-grid { grid-template-columns: repeat(3,1fr); } }
.template-card { background: var(--card); border: 1px solid var(--card-border); border-radius: 12px; padding: 12px; }
.template-media { width: 100%; aspect-ratio: 4/3; background: #0e0e0e; border: 1px solid #222; border-radius: 10px; overflow: hidden; display:flex; align-items:center; justify-content:center; }
.template-media img { max-width: 100%; max-height: 100%; display: block; }
.template-title { margin: 10px 0 6px 0; font-weight: 700; color: #f0f0f0; }
.template-qty-row { display: flex; align-items: center; gap: 8px; }
.template-qty-row input { flex: 1; min-width: 0; }
.template-qty-row small { color: #aaa; }
.templates-summary { margin-top: 12px; display:flex; justify-content:space-between; align-items:center; padding: 10px 12px; border:1px dashed #333; border-radius:10px; background:#121212; }
.templates-summary .right { min-width: 200px; }

/* Modal */
.modal { display:none; position:fixed; z-index:1000; inset:0; background:rgba(0,0,0,.7); overflow:hidden; }
.modal-content {
  background: var(--panel); border: 1px solid #333; border-radius: 12px;
  width: 90%; max-width: 640px; height: 80vh; margin: 5vh auto; padding: 18px;
  display: flex; flex-direction: column;
}
.close {
  background: #2a2a2a; border: 1px solid #444; border-radius: 8px;
  color: #fff; font-size: 18px; line-height: 1;
  padding: 6px 10px; cursor: pointer; float: right;
}
.close:hover { background: #3a3a3a; }

.icon-grid {
  flex: 1; overflow-y: auto; padding-right: 6px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(90px,1fr));
  gap: 10px; margin-top: 10px; border-top: 1px solid #333; border-bottom: 1px solid #333;
  padding-top: 10px; padding-bottom: 10px;
}
.icon-grid::-webkit-scrollbar { width: 8px; }
.icon-grid::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }
.icon-grid::-webkit-scrollbar-thumb:hover { background: #666; }

.icon-actions { display:flex; gap:10px; margin-top:16px; border-top:1px solid #222; padding-top:10px; flex-shrink:0; }
.icon-item { background:#222; border:1px solid #333; border-radius:10px; padding:10px; text-align:center; cursor:pointer; transition:.15s; }
.icon-item:hover { background:#333; transform: scale(1.04); }
.icon-item.selected { outline: 2px solid var(--pink); }
.icon-item img { width:64px; height:64px; display:block; margin:0 auto; }

.icon-position-select { text-align:center; margin-top:14px; }
.position-buttons { display:flex; justify-content:center; gap:10px; }
.pos-btn { background:#444; color:#fff; border:none; border-radius:8px; padding:8px 14px; cursor:pointer; }
.pos-btn:hover { background:#666; }
.pos-btn.active { background: var(--pink); color:#000; }

.icon-color-select { text-align:center; margin-top:8px; }
.color-chip { width: 60px; height: 34px; border:none; cursor:pointer; }
.icon-color-select input[type="color"]::-webkit-color-swatch { border-radius: 6px; border: 1px solid #555; }
.icon-color-select input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }

/* Design area içindeki ikon */
#designIcon {
  position:absolute; top:50%; transform:translateY(-50%);
  width: calc(64px * var(--design-scale));
  height:auto; opacity:.95; pointer-events:none;
}

/* Metnin ikonla çakışmaması */
#customText.icon-left  { padding-left:  calc(84px * var(--design-scale)); }
#customText.icon-right { padding-right: calc(84px * var(--design-scale)); }

/* Helpers */
.checkbox-inline {
  display:flex; align-items:center; gap:8px; margin-bottom:10px;
}
.billing-disabled { opacity:.65; pointer-events:none; }
.design-type-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.design-type-btn {
  flex: 1;
  background: #111;
  color: #fff;
  border: 1px solid #333;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.design-type-btn .emoji {
  font-size: 18px;
  filter: brightness(1.4);
}

.design-type-btn:hover {
  background: #1d1d1d;
  border-color: #555;
}

.design-type-btn.active {
  background: #e3242b;
  border-color: #e3242b;
  color: #fff;
  box-shadow: 0 0 10px rgba(227, 36, 43, 0.3);
}