/* =========================
   SIMULADOR MOSAICO - FINAL
   ========================= */

.simulador-mosaico {
  display: flex;
  gap: 24px;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

/* Panel izquierdo */
.simulador-panel {
  width: 280px;
  flex: 0 0 280px;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
}

.simulador-panel h3 {
  margin: 6px 0 14px;
  font-size: 40px;
  line-height: 1;
  text-align: center;
}

/* Paleta */
.sm-palette {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  justify-items: stretch;
  margin: 14px 0 16px;
}

.sm-color {
  appearance: none;
  border: 2px solid #ddd;
  border-radius: 14px;
  background: #fff;
  padding: 10px;
  height: 56px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, transform 0.05s ease,
    box-shadow 0.15s ease;
}

.sm-color:active {
  transform: scale(0.99);
}

.sm-swatch {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  display: block;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.sm-color.is-selected {
  border-color: #2c7be5;
  box-shadow: 0 0 0 3px rgba(44, 123, 229, 0.18);
}

/* Botones acción */
.sm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.sm-btn {
  appearance: none;
  border: 2px solid #ddd;
  border-radius: 14px;
  background: #fff;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 18px;
  transition: transform 0.05s ease, box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.sm-btn:hover {
  border-color: #cfcfcf;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
}

.sm-btn:active {
  transform: scale(0.99);
}

.sm-hint {
  margin-top: 16px;
  text-align: center;
  color: #666;
  font-size: 16px;
  line-height: 1.3;
}

/* Vista derecha (preview) */
#mosaico-preview {
  flex: 1 1 auto;
  min-width: 0;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  box-sizing: border-box;

  /* Para que el mosaico “entre” */
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 78vh;
  overflow: hidden;
}

/* SVG responsive */
#mosaico-preview svg.sm-svg {
  width: 100%;
  height: 100%;
  max-height: 72vh;
  max-width: 100%;
}

/* Interacción con zonas pintables */
.sm-paintable {
  cursor: pointer;
  transition: filter 0.12s ease, opacity 0.12s ease;
}

/* Hover state: sombra suave */
.sm-paintable.is-hover {
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.22));
  opacity: 0.98;
}

/* Error */
.sm-error {
  padding: 14px;
  border-radius: 12px;
  background: #fff5f5;
  border: 1px solid #ffd1d1;
  color: #a40000;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 980px) {
  .simulador-mosaico {
    flex-direction: column;
  }

  .simulador-panel {
    width: 100%;
    flex: 0 0 auto;
  }

  #mosaico-preview {
    max-height: 60vh;
  }

  #mosaico-preview svg.sm-svg {
    max-height: 56vh;
  }
}
