/* ============================================================
   Lienz · styles
   ============================================================ */
:root {
  --bg-1: #0F2027;
  --bg-2: #203A43;
  --bg-3: #2C5364;
  --accent: #00F5A0;
  --accent-2: #00D9F5;
  --text: #FFFFFF;
  --muted: rgba(255,255,255,0.7);
  --card: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.12);
  --danger: #FF6B6B;
  --whatsapp: #25D366;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, var(--bg-1), var(--bg-2) 50%, var(--bg-3));
  min-height: 100vh;
  line-height: 1.5;
}

/* ============================ topbar ============================ */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 20px;
}
.brand .logo { font-size: 28px; }
.topnav { display: flex; gap: 20px; }
.topnav a { color: var(--muted); text-decoration: none; font-size: 14px; }
.topnav a:hover { color: var(--accent); }

/* ============================ hero ============================ */
.hero {
  text-align: center;
  padding: 60px 20px 30px;
}
.hero h1 {
  font-size: clamp(32px, 6vw, 56px);
  margin: 0 0 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.tagline { color: var(--muted); font-size: 18px; max-width: 600px; margin: 0 auto; }

/* ============================ steps ============================ */
main { max-width: 900px; margin: 0 auto; padding: 0 20px 60px; }
.step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px;
  margin: 24px 0;
  backdrop-filter: blur(8px);
}
.step h2 {
  margin: 0 0 20px;
  font-size: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.step-num {
  background: var(--accent);
  color: #000;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* ============================ product list ============================ */
.product-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.product-card {
  background: rgba(255,255,255,0.04);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.product-card:hover { background: rgba(255,255,255,0.08); }
.product-card.selected {
  border-color: var(--accent);
  background: rgba(0,245,160,0.08);
}
.product-card h3 { margin: 8px 0 4px; font-size: 18px; }
.product-card .price { color: var(--accent); font-size: 20px; font-weight: 700; }
.product-card .desc { color: var(--muted); font-size: 13px; }

/* ============================ prompt ============================ */
.prompt-box { display: flex; flex-direction: column; gap: 14px; }
textarea, input, select {
  background: rgba(0,0,0,0.25);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-size: 15px;
  font-family: inherit;
  width: 100%;
}
textarea { resize: vertical; min-height: 80px; }
textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}
.style-row {
  display: grid;
  grid-template-columns: 1fr 100px 1fr;
  gap: 12px;
}
.style-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}

/* ============================ file upload ============================ */
.upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.file-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(0, 245, 160, 0.08);
  border: 1px dashed var(--accent);
  border-radius: 8px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.file-label:hover { background: rgba(0, 245, 160, 0.15); transform: translateY(-1px); }
.file-label.has-file { background: rgba(0, 245, 160, 0.18); border-style: solid; }
.file-name { font-size: 13px; color: var(--muted); }
.upload-hint { font-size: 12px; margin: 0; }
button.ghost.small {
  padding: 6px 12px;
  font-size: 13px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
button.ghost.small:hover { color: var(--text); border-color: var(--accent); }

/* ============================ buttons ============================ */
button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s;
}
button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #000;
}
button.primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,245,160,0.3); }
button.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
button.ghost {
  background: rgba(255,255,255,0.1);
  color: var(--text);
  border: 1px solid var(--border);
}
button.ghost:hover { background: rgba(255,255,255,0.15); }

.status {
  margin-top: 10px;
  font-size: 14px;
  min-height: 20px;
}
.status.error { color: var(--danger); }
.status.success { color: var(--accent); }
.muted { color: var(--muted); font-size: 14px; }

/* ============================ viewer 3D ============================ */
.viewer {
  width: 100%;
  height: 420px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.2));
  border-radius: 12px;
  border: 1px solid var(--border);
  margin: 16px 0;
  touch-action: none;
  position: relative;
  overflow: hidden;
}
.viewer canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  cursor: grab;
}
.viewer canvas:active { cursor: grabbing; }

/* ====== Controles del diseño (offset + zoom) ====== */
.design-controls {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.design-controls .control-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.design-controls label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.design-controls label output {
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}
.design-controls input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  padding: 0;
  border: none;
}
.design-controls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 245, 160, 0.4);
  transition: transform 0.15s;
}
.design-controls input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}
.design-controls input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 245, 160, 0.4);
}
.design-controls .buttons {
  flex-direction: row;
  justify-content: flex-start;
}
.design-controls .control-row-extras {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.design-controls .control-row-extras .coef-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.design-controls .control-row-extras input[type="number"] {
  width: 64px;
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.design-controls .control-row-extras input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
}
.design-controls .control-row-extras button {
  width: 32px;
  height: 28px;
  padding: 0;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.design-controls .flips {
  flex-direction: row;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}
.design-controls .flips .flip-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  cursor: pointer;
  user-select: none;
}
.design-controls .flips input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}
.design-controls .design-hint {
  font-size: 12px;
  margin: 0;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.viewer-controls {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  flex-wrap: wrap;
}

/* Tuning interno de la vista 3D (temporal, para encontrar valores ideales) */
.view-tuning {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 200, 0, 0.4);
  border-radius: 10px;
  margin-bottom: 6px;
}
.view-tuning-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.view-tuning-row span { opacity: 0.85; }
.view-tuning-row output {
  font-variant-numeric: tabular-nums;
  min-width: 50px;
  text-align: right;
  font-weight: 600;
  color: var(--accent);
}
.view-tuning-row input[type="range"] {
  margin: 0;
}

/* ============================ whatsapp ============================ */
.whatsapp-btn {
  display: inline-block;
  background: var(--whatsapp);
  color: #fff;
  text-decoration: none;
  padding: 16px 28px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 16px;
  margin-top: 16px;
}
.whatsapp-btn:hover { transform: translateY(-1px); }

/* ============================ how it works ============================ */
.how-it-works {
  margin-top: 40px;
  padding: 40px 20px;
  text-align: center;
}
.how-it-works h2 { margin-bottom: 30px; }
.how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
  text-align: left;
}
.how-grid h3 { color: var(--accent); margin: 0 0 8px; }
.how-grid p { margin: 0; color: var(--muted); font-size: 14px; }

/* ============================ footer ============================ */
.footer {
  text-align: center;
  padding: 30px 20px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
}
.footer a { color: var(--accent); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ============================ mobile ============================ */
@media (max-width: 640px) {
  .style-row { grid-template-columns: 1fr; }
  .step { padding: 20px; }
  .hero h1 { font-size: 32px; }
  .viewer { height: 320px; }
}