:root {
  --bg: #FAF8F5;
  --surface: #FFFFFF;
  --ink: #181512;
  --muted: #736B63;
  --accent: #8C3B4A;
  --gold: #B88E4A;
  --border: #E6DFD5;
  --radius: 20px;
  --shadow: 0 12px 32px rgba(24, 21, 18, 0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  padding-bottom: 96px;
}

h1, h2, h3, .serif {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -0.2px;
}

/* Cabecera Editorial */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 245, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand strong {
  font-family: Georgia, serif;
  font-size: 1.35rem;
  display: block;
  line-height: 1.1;
}

.brand span {
  font-size: 0.62rem;
  letter-spacing: 2.5px;
  color: var(--muted);
  text-transform: uppercase;
}

.lang-bar { display: flex; gap: 6px; }
.lang-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}
.lang-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Contenedor y Tarjetas */
.container { max-width: 520px; margin: 0 auto; padding: 16px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.step-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--muted);
  margin: 16px 0 8px;
  display: block;
}

.pill-group { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
}
.pill.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Botones de Cámara / Galería */
.cam-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 104px;
  border: 1.5px dashed #C9B9A6;
  border-radius: 16px;
  padding: 14px 10px;
  text-align: center;
  background: #FCFBF9;
  cursor: pointer;
}
.upload-zone .icon { font-size: 1.75rem; margin-bottom: 4px; }
.upload-zone strong { font-size: 0.88rem; color: var(--ink); display: block; }
.upload-zone small { font-size: 0.72rem; color: var(--muted); }
input[type="file"] { display: none !important; }

/* Lienzo de Estudio */
.canvas-wrapper {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #E8E1D7;
  border: 1px solid var(--border);
  touch-action: none;
}
canvas { width: 100%; height: auto; display: block; cursor: grab; }

.status-bar {
  font-size: 0.76rem;
  color: var(--ink);
  background: #F4EFE8;
  padding: 8px 12px;
  border-radius: 10px;
  text-align: center;
  margin-top: 10px;
}

/* Métricas Diagnóstico */
.diag-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0; }
.diag-box {
  background: var(--bg);
  padding: 8px 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
  text-align: center;
}
.diag-box span { font-size: 0.64rem; color: var(--muted); display: block; text-transform: uppercase; }
.diag-box strong { font-size: 0.78rem; }

/* Círculos de Color */
.swatches-row { display: flex; gap: 10px; margin: 8px 0 14px; flex-wrap: wrap; }
.swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14);
  cursor: pointer;
  position: relative;
}
.swatch.active { transform: scale(1.14); outline: 2px solid var(--ink); }
.swatch.locked::after {
  content: "👑";
  position: absolute;
  bottom: -4px;
  right: -4px;
  font-size: 0.72rem;
  background: #fff;
  border-radius: 50%;
  padding: 1px;
}
.swatch.avoid { width: 32px; height: 32px; opacity: 0.85; }
.swatch.avoid::after {
  content: "✕";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: bold;
}

/* Cuadrícula de Looks 4 Piezas */
.look-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.look-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.look-item strong { font-size: 0.84rem; display: block; margin-top: 4px; }
.look-item small { font-size: 0.72rem; color: var(--muted); display: block; margin-bottom: 8px; }
.look-shop-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  width: 100%;
}

/* Botones y Controles */
.slider-row { margin: 12px 0; }
.slider-top { display: flex; justify-content: space-between; font-size: 0.8rem; font-weight: 600; margin-bottom: 4px; }
input[type="range"] { width: 100%; accent-color: var(--accent); }

.btn {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-secondary { background: #F3ECE3; color: var(--ink); border: 1px solid var(--border); }
.btn-gold { background: linear-gradient(135deg, #C59B5F 0%, #9E7436 100%); color: #fff; }

.result-box {
  display: none;
  margin-top: 14px;
  padding: 16px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  text-align: center;
}
.score-big { font-size: 2.2rem; font-weight: 800; color: var(--accent); }
.preview-mini { width: 110px; height: 110px; object-fit: cover; border-radius: 12px; margin: 8px auto; display: block; }

/* Planes VIP */
.plan-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  background: #FCFBF9;
  position: relative;
}
.plan-card.featured { border: 2px solid var(--gold); background: #FFFDF9; }
.ribbon {
  position: absolute;
  top: -10px;
  right: 14px;
  background: var(--gold);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
}
.plan-flex { display: flex; justify-content: space-between; align-items: center; }
.plan-price { font-size: 1.25rem; font-weight: 800; }

/* Navegación Inferior */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 8px 4px;
}
.nav-item {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}
.nav-item.active { color: var(--accent); }
.nav-item span.ico { font-size: 1.25rem; }

.section-tab { display: none; }
.section-tab.active { display: block; }
.hint { font-size: 0.78rem; color: var(--muted); margin-top: 6px; display: block; }