/* HGS Customizer – querformatige Arbeitsfläche, motiv-grid fix */

.hgs-customizer{
  max-width: 980px;
  margin: 16px auto;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 12px;
  background:#fafafa;
  display:grid;
  grid-template-columns: 300px 1fr;
  grid-template-rows: auto auto auto 1fr auto auto;
  grid-gap: 12px;
}

.hgs-toolbar{
  grid-column: 1 / 2;
  display:grid; grid-template-columns: 1fr 1fr; gap:8px;
}
.hgs-panel{
  grid-column: 1 / 2;
  background:#fff; border:1px solid #ccc; border-radius:8px; padding:8px;
}
.hgs-text-list{ min-height: 160px; border:1px dashed #bbb; border-radius:6px; padding:6px; background:#fafafa; }
.hgs-text-row{ margin-bottom:6px; }
.hgs-text-row input{ width:100%; }

.hgs-controls{
  grid-column: 1 / 2;
  background:#fff; border:1px solid #ccc; border-radius:8px; padding:8px;
}
.hgs-row{ display:flex; gap:12px; margin-bottom:8px; flex-wrap:wrap; }
.hgs-group{ min-width: 120px; }
.hgs-group.full{ flex:1; }
.hgs-label{ font-size:12px; color:#555; margin-bottom:4px; }

.hgs-btnset{ display:flex; gap:6px; }
.btn{ display:inline-flex; align-items:center; justify-content:center; border:1px solid #aaa; border-radius:6px; padding:6px 10px; background:#f2f2f2; cursor:pointer; }
.btn:disabled{ opacity:.5; cursor:not-allowed; }
.btn-icon{ width:36px; height:32px; padding:0; }

.btn-secondary{ background:#e9ecef; }
.btn-dark{ background:#6c757d; color:#fff; }
.btn-danger{ background:#dc3545; color:#fff; }

.form-control{ width:100%; height:32px; }
.hgs-color{ padding:0 4px; }

/* --- Arbeitsfläche: standard 4:3, wird per JS auf Bildverhältnis gesetzt --- */
.canvas-wrap{
  grid-column: 2 / 3; grid-row: 1 / 5;
  border:1px dashed #aaa; border-radius:6px; background:#fff;
  aspect-ratio: 4 / 3;     /* Querformat */
  width: 100%;
  height: auto;            /* von aspect-ratio abgeleitet */
  min-height: 300px;
}
canvas{ display:block; width:100%; height:100%; }

.hgs-motifs{
  grid-column: 1 / 2;
  background:#fff; border:1px solid #ccc; border-radius:8px; padding:8px;
  max-height: 220px;
}
.hgs-motif-grid{
  display:grid; grid-template-columns: repeat(4, 1fr); gap:8px; margin-top:6px;
}
.hgs-motif-item{
  position:relative; width:100%; padding-top:100%;
  border:1px solid #ccc; border-radius:8px; background:#fafafa;
  background-image: var(--bg); background-size: contain; background-repeat:no-repeat; background-position:center;
}
.hgs-chip{ position:absolute; top:4px; left:4px; font-size:10px; background:#343a40; color:#fff; padding:2px 4px; border-radius:4px; }

.hgs-export{
  grid-column: 1 / 2;
  background:#fff; border:1px solid #ccc; border-radius:8px; padding:8px;
}

.hgs-hint{
  grid-column: 1 / 3;
  text-align:center; font-size:12px; color:#555;
}

.hgs-scroll{ overflow:auto; }

@media (max-width: 920px){
  .hgs-customizer { grid-template-columns: 1fr; grid-template-rows: auto auto auto auto auto auto; }
  .canvas-wrap{ grid-column: 1 / 2; grid-row: auto; }
  .hgs-motif-grid{ grid-template-columns: repeat(3, 1fr); }
}
