* { box-sizing: border-box; }
[hidden] { display: none !important; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }

:root {
  --bg: #fbf7f1;
  --surface: #ffffff;
  --ink: #241f19;
  --muted: #6b6257;
  --line: #e4dccf;
  --accent: #7b5e3b;
  --accent-hover: #64492b;
  --sale: #b3261e;
  --danger-bg: #fdecec;
  --danger-ink: #9b2c2c;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 19px;
  line-height: 1.55;
}

h1, h2 { font-family: 'Fraunces', Georgia, serif; line-height: 1.2; }
h2 { font-size: 1.8rem; margin: 0 0 16px; }

/* Sale bar */
.sale-bar {
  background: var(--sale);
  color: #fff;
  text-align: center;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 1rem;
}

/* Header */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.brand { font-family: 'Fraunces', Georgia, serif; font-weight: 700; font-size: 1.6rem; color: var(--ink); text-decoration: none; }
.header-cta { color: var(--accent); font-weight: 700; text-decoration: none; font-size: 1.1rem; padding: 10px 14px; }

/* Hero */
.hero { text-align: center; padding: 48px 20px 32px; max-width: 760px; margin: 0 auto; }
.hero h1 { font-size: clamp(2.2rem, 7vw, 3.2rem); margin: 0 0 14px; }
.lead { font-size: 1.3rem; color: var(--muted); margin: 0 0 26px; }

/* Buttons: big for phones */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 64px;
  padding: 16px 22px;
  border: none;
  border-radius: 14px;
  font: inherit;
  font-weight: 700;
  font-size: 1.25rem;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.btn-big { max-width: 440px; margin: 0 auto; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* How it works */
.how { max-width: 760px; margin: 0 auto; padding: 8px 20px 36px; }
.how h2 { text-align: center; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li { display: flex; gap: 16px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.steps p { margin: 4px 0 0; color: var(--muted); font-size: 1.05rem; }

.num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
  margin-right: 6px;
}
.steps .num { margin-right: 0; }

/* Studio */
.studio { max-width: 760px; margin: 0 auto; padding: 0 16px 16px; display: grid; gap: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.panel h2 { display: flex; align-items: center; gap: 12px; font-size: 1.5rem; }
.center { text-align: center; }

.uploads { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.drop {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 190px;
  border: 2px dashed #cfc4b2;
  border-radius: 16px;
  background: #fcfaf6;
  cursor: pointer;
  padding: 12px;
  text-align: center;
}
.drop:hover { border-color: var(--accent); }
.drop-empty { display: flex; flex-direction: column; gap: 6px; }
.drop-title { font-weight: 700; font-size: 1.25rem; }
.drop-hint { color: var(--muted); font-size: 1rem; }
.thumb { width: 100%; max-height: 240px; object-fit: cover; border-radius: 12px; }

.alert {
  margin-top: 16px;
  background: var(--danger-bg);
  color: var(--danger-ink);
  border: 1px solid #f3c4c4;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 1.05rem;
}

/* Styles */
.style-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.style-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 110px;
  padding: 16px 10px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fcfaf6;
  font: inherit;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
  cursor: pointer;
}
.style-tile.selected { border-color: var(--accent); background: #f4ecdf; }
.style-emoji { font-size: 2rem; }

/* Result */
.result { text-align: center; }
.frame {
  display: inline-block;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px -12px rgba(0,0,0,0.25);
  max-width: 100%;
}
.frame canvas { display: block; max-width: 100%; max-height: 560px; width: auto; height: auto; margin: 0 auto; }
.protect, .protect img, .protect canvas {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}
.note { color: var(--muted); font-size: 1rem; }
.fine { color: var(--muted); font-size: 0.95rem; margin-top: 14px; }

.product-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 18px 0; text-align: left; }
.product-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fcfaf6;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}
.product-card.selected { border-color: var(--accent); background: #f4ecdf; }
.pc-thumb { width: 92px; height: 92px; flex: 0 0 92px; object-fit: cover; border-radius: 12px; background: #f4efe7; pointer-events: none; }
.pc-body { display: flex; flex-direction: column; gap: 2px; }
.pc-tag { align-self: flex-start; background: var(--sale); color: #fff; font-size: 0.85rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.pc-title { font-weight: 700; font-size: 1.3rem; }
.pc-price { font-size: 1.15rem; }
.pc-price s { color: var(--muted); }
.pc-price b { color: var(--sale); font-size: 1.4rem; }
.pc-desc { color: var(--muted); font-size: 1rem; }

.size-row { display: flex; flex-direction: column; gap: 8px; align-items: center; margin: 14px 0; font-weight: 700; }
.size-row select { font: inherit; font-size: 1.2rem; padding: 12px 16px; border-radius: 12px; border: 2px solid var(--line); min-width: 180px; }

.mockup { margin: 12px auto 16px; max-width: 360px; }
.mockup img { display: block; width: 100%; height: auto; border-radius: 16px; background: #f4efe7; pointer-events: none; }

.mockup-gallery { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px 4px; }
.mockup-gallery button {
  flex: 0 0 72px; height: 72px; padding: 0; border: 3px solid transparent; border-radius: 12px;
  background: #f4efe7; cursor: pointer; overflow: hidden;
}
.mockup-gallery button.selected { border-color: var(--accent); }
.mockup-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }

.color-row { margin: 8px 0 4px; }
.color-label { margin: 0 0 8px; font-size: 1.1rem; }
.swatches { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.swatch {
  width: 52px; height: 52px; border-radius: 50%; cursor: pointer;
  border: 2px solid #cfc4b2; box-shadow: inset 0 0 0 3px #fff;
}
.swatch.selected { border: 3px solid var(--accent); box-shadow: inset 0 0 0 4px #fff, 0 0 0 2px #f4ecdf; }

.btn-spinner {
  display: inline-block; width: 22px; height: 22px; margin-right: 10px;
  border: 3px solid rgba(255,255,255,0.4); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.9s linear infinite;
}

/* Change / retry */
.tweak { margin: 18px 0 8px; padding: 18px; border: 2px dashed var(--line); border-radius: 16px; background: #fcfaf6; }
.tweak h3, .pick-title { font-family: 'Fraunces', Georgia, serif; font-size: 1.35rem; margin: 0 0 4px; }
.pick-title { margin-top: 22px; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px 0; }
.chip {
  font: inherit; font-size: 1.02rem; padding: 10px 16px; border-radius: 999px;
  border: 2px solid var(--line); background: #fff; color: var(--ink); cursor: pointer;
}
.chip.selected { border-color: var(--accent); background: #f4ecdf; }
#editInput {
  width: 100%; font: inherit; font-size: 1.1rem; padding: 14px 16px; margin-bottom: 12px;
  border: 2px solid var(--line); border-radius: 12px; background: #fff;
}
.tweak-row { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
.btn-soft { background: #fff; color: var(--accent); border: 2px solid var(--accent); min-height: 56px; font-size: 1.1rem; }
.btn-soft:hover:not(:disabled) { background: #f4ecdf; }
@media (min-width: 720px) { .tweak-row { grid-template-columns: 1fr 1fr; } }

/* Trust badges and progress */
.badges {
  list-style: none; margin: 0; padding: 10px 16px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px;
  background: #f1e9dc; color: var(--ink); font-weight: 600; font-size: 0.98rem;
}
.eyebrow { color: var(--sale); font-weight: 700; font-size: 1.1rem; margin: 0 0 8px; }
.progress {
  list-style: none; padding: 0; margin: 22px auto 0;
  display: flex; justify-content: center; flex-wrap: wrap; gap: 6px;
  font-weight: 700; color: var(--muted); font-size: 1.05rem;
}
.progress li + li::before { content: '›'; margin-right: 6px; color: var(--accent); }
.trustpilot-box { margin-top: 18px; }
.tip { color: var(--muted); font-size: 1rem; margin: 12px 0 0; text-align: center; }
.drop-icon { font-size: 2.4rem; }

/* Examples */
.examples { max-width: 960px; margin: 0 auto; padding: 8px 16px 32px; }
.examples h2 { text-align: center; }
.example-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.example-grid figure { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px; }
.example-grid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.example-grid figcaption { text-align: center; color: var(--muted); font-size: 0.95rem; padding-top: 6px; }

/* Gift section */
.gift { max-width: 760px; margin: 36px auto 0; padding: 0 16px; text-align: center; }
.gift-list { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 12px; text-align: left; }
.gift-list li { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; font-size: 1.1rem; }

/* Exit offer popup */
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(36,31,25,0.6);
}
.modal-card {
  width: 100%; max-width: 440px; background: var(--surface); border-radius: 20px;
  padding: 28px 22px 18px; text-align: center; box-shadow: 0 20px 60px -20px rgba(0,0,0,0.5);
}
.modal-card h2 { font-size: 1.9rem; margin-bottom: 10px; color: var(--sale); }
.modal-card p { font-size: 1.15rem; margin: 0 0 18px; }
.modal-gift { font-size: 3rem; }
.link-btn {
  margin-top: 12px; background: none; border: none; color: var(--muted);
  font: inherit; font-size: 1.05rem; text-decoration: underline; cursor: pointer; padding: 10px;
}

/* Working */
.working { padding: 24px 0 8px; }
.working p { font-size: 1.2rem; margin: 10px 0 0; }
.spinner {
  width: 44px; height: 44px; margin: 0 auto;
  border: 5px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Thanks */
#thanks p { font-size: 1.15rem; }
#thanks .btn { margin-top: 16px; }

/* Reviews */
.reviews { max-width: 760px; margin: 36px auto 0; padding: 0 16px; }
.reviews h2 { text-align: center; }
.review-list { display: grid; gap: 14px; }
.review { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.review-photo { width: 64px; height: 64px; flex: 0 0 64px; border-radius: 50%; object-fit: cover; }
.review .stars { color: #d49a10; font-size: 1.2rem; }
.review p { margin: 8px 0 4px; }
.review .who { color: var(--muted); font-size: 1rem; }

/* FAQ */
.faq { max-width: 760px; margin: 36px auto 0; padding: 0 16px; }
.faq h2 { text-align: center; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-bottom: 10px; }
.faq summary { font-weight: 700; cursor: pointer; font-size: 1.1rem; }
.faq p { color: var(--muted); margin: 10px 0 0; }
.faq a { color: var(--accent); }

/* Footer */
.site-footer { text-align: center; color: var(--muted); padding: 28px 20px; margin-top: 36px; border-top: 1px solid var(--line); font-size: 1rem; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 20px; margin-bottom: 10px; }
.footer-links a { color: var(--muted); text-decoration: none; }

@media (min-width: 720px) {
  .product-grid { grid-template-columns: 1fr 1fr; }
  .style-grid { grid-template-columns: 1fr 1fr 1fr; }
  .example-grid { grid-template-columns: 1fr 1fr 1fr; }
}