.armario-body {
  display: block;
  align-items: initial;
  justify-content: initial;
  padding: 0;
}

.armario-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  max-width: 900px;
  margin: 0 auto;
}
.armario-header .brand { margin-bottom: 0; }
.armario-header h1 { font-size: 1.2rem; }

.armario-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px 60px;
  display: grid;
  gap: 18px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 18px;
}
.panel h2 { margin: 0 0 12px; font-size: 1.02rem; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.panel-head h2 { margin: 0; }

.btn-small {
  padding: 8px 12px;
  font-size: 0.82rem;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.btn-small:hover { background: var(--primary-hover); }

/* Probador stage */
.stage-wrap {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.stage {
  position: relative;
  width: 320px;
  max-width: 100%;
  aspect-ratio: 3 / 4;
  background: #0c0f1e;
  border: 1px solid var(--field-border);
  border-radius: 14px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}
.stage-model { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.stage-garment {
  position: absolute;
  left: 0; top: 0;
  width: 55%;
  transform-origin: center center;
  cursor: grab;
  display: none;
  will-change: left, top, transform;
}
.stage-garment.active { display: block; }
.stage-empty {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.85rem;
}
.stage-empty.is-hidden { display: none; }

.controls {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
}
.controls label {
  display: grid;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}
.controls input[type="range"] { width: 100%; accent-color: var(--primary); }

/* Probador con IA */
.tryon-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: stretch;
}
.tryon-left {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tryon-preview {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mini {
  width: 84px;
  height: 84px;
  border-radius: 12px;
  border: 1px solid var(--field-border);
  background: #0c0f1e center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.72rem;
  flex-shrink: 0;
}
.mini.has span { display: none; }
.mini.checker.has {
  background-image:
    var(--tile-img),
    linear-gradient(45deg, #23263a 25%, transparent 25%),
    linear-gradient(-45deg, #23263a 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #23263a 75%),
    linear-gradient(-45deg, transparent 75%, #23263a 75%);
  background-size: contain, 14px 14px, 14px 14px, 14px 14px, 14px 14px;
  background-position: center, 0 0, 0 7px, 7px -7px, -7px 0;
  background-repeat: no-repeat, repeat, repeat, repeat, repeat;
}
.mini.checker.has { background-color: #0c0f1e; }
.plus { color: var(--muted); font-size: 1.4rem; }
.field-label {
  display: grid;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}
.field-label select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--field-border);
  background: var(--field);
  color: var(--text);
  font-size: 0.9rem;
}
.tryon-result {
  flex: 1;
  min-width: 220px;
  position: relative;
  aspect-ratio: 3 / 4;
  background: #0c0f1e;
  border: 1px solid var(--field-border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.result-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}

/* Grids */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}
.tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  border: 2px solid var(--field-border);
  background: #0c0f1e center/contain no-repeat;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s ease;
}
.tile.checker {
  background-image:
    var(--tile-img),
    linear-gradient(45deg, #23263a 25%, transparent 25%),
    linear-gradient(-45deg, #23263a 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #23263a 75%),
    linear-gradient(-45deg, transparent 75%, #23263a 75%);
  background-size: contain, 16px 16px, 16px 16px, 16px 16px, 16px 16px;
  background-position: center, 0 0, 0 8px, 8px -8px, -8px 0;
  background-repeat: no-repeat, repeat, repeat, repeat, repeat;
}
.tile.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108,140,255,0.25); }
.tile .del {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff; border: 0;
  font-size: 13px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.tile .name {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-size: 0.65rem; padding: 3px 5px;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile.result { cursor: default; }

.tiny { font-size: 0.75rem; }

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: var(--card); border: 1px solid var(--card-border);
  color: var(--text); padding: 11px 18px; border-radius: 12px;
  font-size: 0.86rem; box-shadow: 0 10px 30px rgba(0,0,0,0.4); z-index: 50;
}
.toast.is-error { border-color: rgba(255,107,129,0.5); color: var(--danger); }
.spinner-tile {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.72rem; aspect-ratio: 1;
  border: 2px dashed var(--field-border); border-radius: 12px;
}
