/* =========================================================================
   Customizify -- Visual Product Designer
   Hand-written stylesheet. No framework, no CDN. Self-hosted fonts only.
   ========================================================================= */

/* ---- Self-hosted web fonts (woff2) ------------------------------------ */
@font-face {
  font-family: "CZ Sans";
  src: url("../fonts/liberation-sans-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "CZ Sans";
  src: url("../fonts/liberation-sans-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "CZ Serif";
  src: url("../fonts/liberation-serif-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "CZ Serif";
  src: url("../fonts/liberation-serif-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "CZ Rounded";
  src: url("../fonts/carlito-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "CZ Rounded";
  src: url("../fonts/carlito-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "CZ Mono";
  src: url("../fonts/liberation-mono-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "CZ Mono";
  src: url("../fonts/liberation-mono-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---- Tokens ------------------------------------------------------------ */
:root {
  --ink-900: #171a2b;
  --ink-700: #363b52;
  --ink-500: #656a85;
  --ink-300: #9ba0bd;
  --ink-100: #e7e8f2;
  --paper: #ffffff;
  --canvas-bg: #f4f4fa;
  --bg: #f7f7fb;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;
  --brand-100: #ebe9fe;
  --teal-600: #0d9488;
  --teal-100: #ccfbf1;
  --amber-500: #f59e0b;
  --danger-500: #e11d48;
  --danger-100: #ffe4e8;
  --ok-600: #16a34a;
  --ok-100: #dcfce7;
  --shadow-sm: 0 1px 2px rgba(23, 26, 43, 0.06), 0 1px 1px rgba(23, 26, 43, 0.04);
  --shadow-md: 0 8px 24px rgba(23, 26, 43, 0.10), 0 2px 6px rgba(23, 26, 43, 0.06);
  --shadow-lg: 0 24px 60px rgba(23, 26, 43, 0.18), 0 6px 16px rgba(23, 26, 43, 0.10);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --font-ui: "CZ Sans", "Liberation Sans", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink-900);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.15; }
p { margin: 0 0 1em; color: var(--ink-500); }
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Site header --------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 247, 251, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ink-100);
}
.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--ink-900);
}
.brand .mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-600), var(--teal-600));
  display: grid; place-items: center;
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.brand .mark svg { width: 19px; height: 19px; }
.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}
.nav-links a {
  text-decoration: none;
  color: var(--ink-700);
  font-size: .93rem;
  font-weight: 600;
}
.nav-links a:hover { color: var(--brand-600); }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 10px;
  padding: 11px 20px;
  font-weight: 700;
  font-size: .92rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--brand-600);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--brand-700); box-shadow: var(--shadow-md); }
.btn-ghost {
  background: transparent;
  color: var(--ink-700);
  border: 1px solid var(--ink-100);
}
.btn-ghost:hover { border-color: var(--ink-300); }
.btn-sm { padding: 7px 12px; font-size: .8rem; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---- Landing page ---------------------------------------------------- */
.hero {
  padding: 84px 0 60px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -140px; right: -160px;
  width: 520px; height: 520px;
  background: radial-gradient(circle at center, var(--brand-100), transparent 70%);
  z-index: -1;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-100);
  color: var(--brand-700);
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .02em;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.4rem);
  max-width: 15ch;
  letter-spacing: -0.01em;
}
.hero .lede {
  font-size: 1.14rem;
  max-width: 56ch;
  color: var(--ink-700);
}
.hero-cta { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.hero-stats {
  display: flex;
  gap: 34px;
  margin-top: 46px;
  flex-wrap: wrap;
}
.hero-stats .stat b {
  display: block;
  font-size: 1.5rem;
  color: var(--ink-900);
}
.hero-stats .stat span { font-size: .82rem; color: var(--ink-500); }

.hero-art {
  margin-top: 56px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--ink-100);
  background: linear-gradient(180deg, #ffffff, #fbfbff);
  box-shadow: var(--shadow-md);
  padding: 22px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 26px;
  align-items: center;
}
.hero-art .art-copy h3 { font-size: 1.05rem; }
.hero-art .art-copy p { font-size: .92rem; margin-bottom: 1.2em; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: .74rem;
  font-weight: 700;
  color: var(--teal-600);
  background: var(--teal-100);
  padding: 5px 10px;
  border-radius: 999px;
}
.mock-frame {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--ink-100);
  background: var(--canvas-bg);
}
.mock-frame canvas,
.mock-frame svg { display: block; width: 100%; height: auto; }

section { padding: 68px 0; }
.section-head { max-width: 62ch; margin-bottom: 40px; }
.section-head .kicker {
  color: var(--brand-600);
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature-card {
  background: var(--paper);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: box-shadow .15s ease, transform .15s ease;
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.feature-card .ico {
  width: 42px; height: 42px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: var(--brand-100);
  color: var(--brand-700);
  margin-bottom: 16px;
}
.feature-card .ico svg { width: 22px; height: 22px; }
.feature-card h3 { font-size: 1.02rem; }
.feature-card p { font-size: .89rem; margin-bottom: 0; }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.split ol.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.split ol.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 46px;
  margin-bottom: 22px;
}
.split ol.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--ink-900);
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
  display: grid; place-items: center;
}
.split ol.steps h4 { margin: 0 0 4px; font-size: .98rem; }
.split ol.steps p { font-size: .87rem; margin: 0; }

.pricing-strip {
  background: var(--ink-900);
  border-radius: var(--radius-lg);
  padding: 40px;
  color: #fff;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.pricing-strip .p-item b { display: block; font-size: 1.6rem; }
.pricing-strip .p-item span { font-size: .8rem; opacity: .7; }

.cta-band {
  text-align: center;
  background: linear-gradient(135deg, var(--brand-600), var(--teal-600));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 60px 24px;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.85); max-width: 46ch; margin: 0 auto 26px; }
.cta-band .btn-primary { background: #fff; color: var(--brand-700); }
.cta-band .btn-primary:hover { background: #f2f2ff; }

.site-footer {
  border-top: 1px solid var(--ink-100);
  padding: 34px 0;
  font-size: .82rem;
  color: var(--ink-500);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 880px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .hero-art { grid-template-columns: 1fr; }
  .pricing-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .feature-grid { grid-template-columns: 1fr; }
  .pricing-strip { grid-template-columns: 1fr 1fr; padding: 26px; }
  .nav-links { display: none; }
}

/* =========================================================================
   Designer app (designer.html)
   ========================================================================= */
.app-header {
  background: var(--paper);
  border-bottom: 1px solid var(--ink-100);
}
.app-header .bar { padding: 12px 20px; }
.app-header .crumb {
  font-size: .78rem;
  color: var(--ink-500);
}
.app-header .crumb b { color: var(--ink-900); }
.product-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}
.product-badge .thumb {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--canvas-bg);
  border: 1px solid var(--ink-100);
  display: grid; place-items: center;
}
.product-price-tag {
  font-weight: 700;
  color: var(--brand-700);
  background: var(--brand-100);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .85rem;
}

.designer-shell {
  display: grid;
  grid-template-columns: 300px 1fr 300px;
  gap: 18px;
  padding: 18px;
  max-width: 1440px;
  margin: 0 auto;
  align-items: start;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.panel + .panel { margin-top: 16px; }
.panel h2 {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-500);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Tool tabs */
.tool-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}
.tool-tab {
  border: 1px solid var(--ink-100);
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 4px;
  font-size: .74rem;
  font-weight: 700;
  color: var(--ink-700);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.tool-tab svg { width: 18px; height: 18px; }
.tool-tab.active {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
}
.tool-pane { display: none; }
.tool-pane.active { display: block; }

.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: .76rem;
  font-weight: 700;
  color: var(--ink-700);
  margin-bottom: 6px;
}
.field input[type="text"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--ink-100);
  border-radius: 8px;
  font-size: .88rem;
  font-family: var(--font-ui);
  background: #fff;
  color: var(--ink-900);
}
.field textarea { resize: vertical; min-height: 54px; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }
.font-choice select { font-size: .95rem; }

input[type="color"] {
  -webkit-appearance: none;
  width: 40px; height: 34px;
  border: 1px solid var(--ink-100);
  border-radius: 8px;
  padding: 2px;
  background: #fff;
  cursor: pointer;
}
input[type="color"]::-webkit-color-swatch { border-radius: 5px; border: none; }

.toggle-row { display: flex; gap: 8px; }
.toggle-btn {
  flex: 1;
  border: 1px solid var(--ink-100);
  background: #fff;
  border-radius: 8px;
  padding: 9px;
  cursor: pointer;
  font-weight: 700;
  font-size: .86rem;
  color: var(--ink-700);
}
.toggle-btn.on {
  background: var(--ink-900);
  border-color: var(--ink-900);
  color: #fff;
}
.toggle-btn.italic-btn { font-style: italic; }

.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input[type="range"] { flex: 1; }
.range-row output {
  min-width: 42px;
  text-align: right;
  font-size: .8rem;
  font-weight: 700;
  color: var(--ink-700);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.upload-drop {
  border: 1.5px dashed var(--ink-300);
  border-radius: 10px;
  padding: 22px 12px;
  text-align: center;
  cursor: pointer;
  background: var(--bg);
}
.upload-drop:hover { border-color: var(--brand-600); background: var(--brand-100); }
.upload-drop svg { width: 26px; height: 26px; color: var(--ink-500); margin-bottom: 8px; }
.upload-drop p { margin: 0; font-size: .82rem; }
.upload-drop span { display: block; font-size: .74rem; color: var(--ink-300); margin-top: 3px; }
.upload-hint { font-size: .74rem; color: var(--ink-300); margin-top: 8px; }

.clipart-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.clipart-item {
  border: 1px solid var(--ink-100);
  background: #fff;
  border-radius: 10px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 6px;
}
.clipart-item:hover { border-color: var(--brand-600); background: var(--brand-100); }
.clipart-item svg { width: 100%; height: 100%; }

.empty-hint {
  font-size: .82rem;
  color: var(--ink-300);
  text-align: center;
  padding: 18px 6px;
}

/* Canvas stage */
.stage-wrap {
  min-width: 0;
}
.stage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
  flex-wrap: wrap;
}
.view-switch {
  display: inline-flex;
  background: var(--ink-100);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.view-switch button {
  border: none;
  background: transparent;
  padding: 7px 16px;
  font-size: .82rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink-700);
}
.view-switch button.active { background: #fff; color: var(--ink-900); box-shadow: var(--shadow-sm); }
.history-controls { display: flex; gap: 8px; }
.icon-btn {
  border: 1px solid var(--ink-100);
  background: #fff;
  width: 36px; height: 36px;
  border-radius: 9px;
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--ink-700);
}
.icon-btn:hover:not(:disabled) { border-color: var(--brand-600); color: var(--brand-600); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.icon-btn svg { width: 17px; height: 17px; }

.shirt-colors { display: flex; align-items: center; gap: 8px; }
.shirt-colors span { font-size: .76rem; color: var(--ink-500); font-weight: 700; }
.swatch {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid #fff;
  outline: 1px solid var(--ink-100);
  cursor: pointer;
}
.swatch.active { outline: 2px solid var(--brand-600); }

.stage {
  position: relative;
  background: var(--canvas-bg);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-md);
  overflow: auto;
  display: flex;
  justify-content: center;
  padding: 18px;
}
#designer-canvas {
  background: transparent;
  touch-action: none;
  cursor: default;
  min-width: 420px;
}
.stage-caption {
  text-align: center;
  font-size: .78rem;
  color: var(--ink-300);
  margin-top: 10px;
}

/* Layers panel */
.layers-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.layer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--ink-100);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}
.layer-row.selected { border-color: var(--brand-600); background: var(--brand-100); }
.layer-row .l-ico {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--bg);
  display: grid; place-items: center;
  flex-shrink: 0;
  color: var(--ink-700);
}
.layer-row .l-ico svg { width: 15px; height: 15px; }
.layer-row .l-name {
  flex: 1;
  min-width: 0;
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.layer-row .l-actions { display: flex; gap: 2px; }
.layer-row .l-actions button {
  border: none;
  background: transparent;
  width: 24px; height: 24px;
  border-radius: 6px;
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--ink-500);
}
.layer-row .l-actions button:hover:not(:disabled) { background: var(--ink-100); color: var(--ink-900); }
.layer-row .l-actions button:disabled { opacity: .3; cursor: not-allowed; }
.layer-row .l-actions button svg { width: 14px; height: 14px; }
.layer-row .l-actions .danger:hover { background: var(--danger-100); color: var(--danger-500); }

/* Price box */
.price-lines { font-size: .84rem; }
.price-line {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  color: var(--ink-500);
}
.price-line b { color: var(--ink-900); font-weight: 600; }
.price-line.total {
  border-top: 1px dashed var(--ink-100);
  margin-top: 6px;
  padding-top: 10px;
  font-size: 1.05rem;
  color: var(--ink-900);
}
.price-line.total b { font-size: 1.2rem; color: var(--brand-700); }

/* Modal (Add to cart confirmation) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(23, 26, 43, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 460px;
  width: 100%;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  max-height: 92vh;
  overflow: auto;
}
.modal-card .ok-badge {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--ok-100);
  color: var(--ok-600);
  display: grid; place-items: center;
  margin: 0 auto 14px;
}
.modal-card .ok-badge svg { width: 26px; height: 26px; }
.modal-previews {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 18px 0;
}
.modal-previews figure {
  margin: 0;
  background: var(--canvas-bg);
  border: 1px solid var(--ink-100);
  border-radius: 10px;
  padding: 8px;
  width: 150px;
}
.modal-previews img { border-radius: 6px; width: 100%; }
.modal-previews figcaption {
  font-size: .72rem;
  color: var(--ink-500);
  margin-top: 6px;
  font-weight: 700;
}
.modal-price {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--brand-700);
  margin: 10px 0 4px;
}
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink-900);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 300;
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.selected-label {
  font-size: .78rem;
  color: var(--brand-700);
  font-weight: 700;
  background: var(--brand-100);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 1180px) {
  .designer-shell { grid-template-columns: 280px 1fr; }
  .layers-col { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .designer-shell { grid-template-columns: 1fr; padding: 12px; }
  #designer-canvas { min-width: 0; width: 100%; }
}
@media (max-width: 560px) {
  .app-header .bar { flex-wrap: wrap; gap: 10px; }
  .app-header .bar > div:first-child { width: 100%; justify-content: space-between; }
  .app-header .bar > div:last-child { width: 100%; justify-content: space-between; }
  .stage-toolbar { justify-content: flex-start; }
}
