/* ============================================================
   TOPPERS — Estilos específicos
   ============================================================ */

.topper-layout {
  gap: 24px;
}

.topper-canvas-wrapper {
  position: relative;
  width: 100%;
  border-bottom: 1px solid var(--cream-dark);
}

#topperCanvas {
  display: block;
  width: 100%;
  cursor: crosshair;
  touch-action: none;
}

.topper-area-label {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 0.7rem;
  color: var(--text-light);
  font-family: 'Raleway', sans-serif;
  opacity: 0.6;
  pointer-events: none;
}

/* ─── Lista de capas ─────────────────────────────────────── */
#capasLista {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.capa-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--cream);
  border: 1.5px solid var(--cream-dark);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}
.capa-item:hover { border-color: var(--gold); }
.capa-item.activa {
  border-color: var(--burgundy);
  background: rgba(123,45,66,0.06);
}

.capa-badge {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--burgundy);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.capa-texto-preview {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.capa-acciones {
  display: flex;
  gap: 4px;
}

.capa-btn {
  width: 26px; height: 26px;
  border-radius: 4px;
  border: 1px solid var(--cream-dark);
  background: white;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.capa-btn:hover { background: var(--cream-dark); }
.capa-btn.eliminar:hover { background: rgba(123,45,66,0.1); border-color: var(--burgundy); color: var(--burgundy); }

/* ─── Botón añadir capa ──────────────────────────────────── */
.btn-add-capa {
  width: 100%;
  padding: 10px;
  border: 1.5px dashed var(--gold);
  border-radius: var(--radius);
  background: transparent;
  color: var(--gold-dark);
  font-family: 'Raleway', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-add-capa:hover {
  background: rgba(201,169,110,0.1);
  border-style: solid;
}
.btn-add-capa:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ─── Info STL ───────────────────────────────────────────── */
.info-stl {
  font-size: 0.85rem;
}
.info-stl h4 {
  font-size: 1rem;
  margin-bottom: 10px;
}
.info-stl ul {
  list-style: none;
  padding: 0;
}
.info-stl li {
  padding: 4px 0;
  color: var(--text-light);
  border-bottom: 1px solid var(--cream-dark);
}
.info-stl li:last-child { border: none; }

/* ─── Preview panel STL ──────────────────────────────────── */
.stl-preview-panel {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px;
  text-align: center;
  margin-top: 20px;
}
.stl-preview-panel h3 {
  margin-bottom: 8px;
}
#stlPreviewCanvas {
  max-width: 100%;
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius);
  margin: 16px auto;
  display: block;
}
.stl-info p {
  font-size: 0.85rem;
  margin-bottom: 16px;
}

/* ─── Slider ─────────────────────────────────────────────── */
.slider-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-elegante {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: var(--cream-dark);
  border-radius: 2px;
  outline: none;
}
.range-elegante::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--burgundy);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(123,45,66,0.3);
}

.range-value {
  font-size: 0.8rem;
  color: var(--text-light);
  min-width: 36px;
  text-align: right;
}

/* ─── Chip fuente (preview en la propia fuente) ──────────── */
.chip-fuente {
  font-size: 1rem !important;
  padding: 6px 14px !important;
}

/* ─── Hint text ──────────────────────────────────────────── */
.hint-text {
  font-size: 0.82rem;
  color: var(--text-light);
  font-style: italic;
  margin-bottom: 14px;
  line-height: 1.4;
}

/* ─── Botón generar STL ──────────────────────────────────── */
#btnGenerarSTL {
  position: relative;
  overflow: hidden;
}
#btnGenerarSTL.generando::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

/* ─── Responsive toppers ─────────────────────────────────── */
@media (max-width: 768px) {
  .stl-preview-panel { padding: 18px 14px; }
  #stlPreviewCanvas { width: 100%; height: auto; }
}

@media (max-width: 480px) {
  .capa-item { padding: 8px 10px; }
  .capa-acciones .capa-btn { width: 30px; height: 30px; font-size: 0.85rem; }
}

/* ─── Modal confirmar diseño ─────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-card {
  background: #FAF6F0;
  border-radius: 16px;
  padding: 40px 36px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal-icono {
  font-size: 2rem;
  color: var(--gold, #C9A96E);
  margin-bottom: 16px;
}
.modal-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  color: var(--burgundy, #7B2D42);
  margin-bottom: 12px;
}
.modal-card p {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.6;
  margin-bottom: 28px;
}
.modal-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.modal-btns .btn-outline,
.modal-btns .btn-primary {
  flex: 1;
  max-width: 160px;
}
