/* ==========================================================================
   KLEIDUNG
   Segmented switch (shared .segmented, components.css) between two tabs:
   "Kleidungsstücke" reuses the Wunschliste/Geschenkideen card-grid component
   wholesale (.fin-wishlist-* classes, css/pages/finance-wishlist.css) — only
   the extra meta/chip lines below the title are page-specific. "Körpermaße"
   is a single per-user form next to a small decorative body silhouette.
   ========================================================================== */

.clothing-card-meta {
  font-size: var(--fs-s);
  color: var(--ink-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clothing-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
}

/* ---------- Farbe-Picker: swatch instead of a generic icon ---------- */
/* See setClothingColorField()/wireClothingColorBtn() in kleidung.js — the
   trigger button always shows the chosen colour as a small swatch to the
   left of its label, and every row in its popover shows its own swatch the
   same way. */

.clothing-color-btn {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.clothing-color-swatch {
  display: inline-block;
  flex: 0 0 auto;
  width: var(--icon-md);
  height: var(--icon-md);
  border-radius: var(--radius);
  border: var(--bw) solid var(--line-strong);
}

/* Inside the popover's own 20×20 icon box (searchable-popover.js), fill it
   completely instead of using the standalone trigger-button size/border —
   the box itself already clips + rounds the corner. */
.searchable-popover-item-icon .clothing-color-swatch {
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: none;
}

/* ---------- Materialzusammensetzung: Siegel-chip look + an inline, directly
   editable percent (see renderClothingCompositionField() in kleidung.js). ---------- */

#clCompositionChips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
}

#clCompositionChips:not(:empty) {
  margin-bottom: var(--space-6);
}

.clothing-material-chip input[type="number"] {
  width: 2.5em;
  border: none;
  background: none;
  padding: 0;
  text-align: right;
  font-size: inherit;
  color: inherit;
}

#clCompositionSum {
  margin-top: var(--space-6);
}

/* ---------- Körpermaße ---------- */

.clothing-body-intro {
  color: var(--ink-dim);
  font-size: var(--fs-s);
  margin: 0 0 var(--space-16);
}

.clothing-body-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--space-24);
  align-items: start;
}

.clothing-body-visual {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.clothing-body-silhouette {
  display: flex;
  justify-content: center;
  padding-top: var(--space-8);
  color: var(--brass-soft);
}

.clothing-body-silhouette svg {
  width: 100%;
  max-width: 200px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* A selected measurement's marker: the tape-measure line (thicker, accent) +
   its numbered badge — toggled via the `hidden` attribute in kleidung.js
   selectBodyMeasurement(). Written out explicitly (rather than relying on the
   browser's default `[hidden]{display:none}` UA rule) because that rule loses
   to SVG's own UA stylesheet (`g{display:inline}`) for elements in the SVG
   namespace — an author-level rule doesn't have that problem. */
.body-marker[hidden] {
  display: none;
}

.body-marker line {
  stroke: var(--coral);
  stroke-width: 3;
}

.body-marker-badge {
  fill: var(--coral);
  stroke: none;
}

.body-marker-num {
  fill: var(--on-accent, #fff);
  stroke: none;
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
}

.clothing-body-hint {
  min-height: 2.6em;
  font-size: var(--fs-s);
  color: var(--ink-dim);
  text-align: center;
  padding: 0 var(--space-4);
}

/* ---------- Körpermaße: measurement list (right column) ---------- */

.clothing-body-row {
  display: flex;
  align-items: center;
  gap: var(--space-10);
  padding: var(--space-8) var(--space-4);
  border-bottom: var(--bw) solid var(--line);
  cursor: pointer;
}

.clothing-body-row:last-child {
  border-bottom: none;
}

.clothing-body-row:hover,
.clothing-body-row.is-active {
  background: var(--panel-alt);
}

.clothing-body-row-num {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--coral);
  color: var(--on-accent, #fff);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 700;
}

.clothing-body-row-label {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
}

.clothing-body-row-input {
  flex: 0 0 auto;
  width: 92px;
}

.clothing-body-row-input input {
  width: 100%;
}

@media (max-width: 640px) {
  .clothing-body-layout {
    grid-template-columns: 1fr;
  }

  .clothing-body-silhouette {
    padding-top: 0;
  }

  .clothing-body-silhouette svg {
    max-width: 160px;
  }
}
