/**
 * Layout 3 columnas — Generador Keko
 */

body[data-vibra-section="kekoSection"] #kekoSection.content-section,
body[data-vibra-section="kekoSection"] #kekoSection.kg-page {
  display: block !important;
  max-width: min(1400px, 96vw);
  background: transparent !important;
  box-shadow: none;
  overflow: visible;
}

.kg-page {
  margin: 0 auto;
  padding: 0 clamp(0.75rem, 2vw, 1.5rem) 2.5rem;
  font-family: var(--kg-font);
  color: var(--kg-text);
}

.kg-maintenance {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  padding: 2rem;
  border-radius: var(--kg-radius);
  background: var(--kg-surface-2);
  border: 1px solid var(--kg-border);
  text-align: center;
}

.kg-maintenance__icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.kg-maintenance__title { margin: 0 0 0.5rem; font-size: 1.25rem; }
.kg-maintenance__text { margin: 0; color: var(--kg-text-muted); max-width: 22rem; }

.kg-app {
  display: grid;
  grid-template-columns: minmax(140px, 180px) minmax(0, 1fr) minmax(220px, 280px);
  gap: clamp(0.75rem, 2vw, 1.25rem);
  align-items: stretch;
}

.kg-app > .kg-panel {
  min-height: 0;
}

.kg-panel {
  background: var(--kg-surface);
  border: 1px solid var(--kg-border);
  border-radius: var(--kg-radius);
  box-shadow: var(--kg-shadow);
  backdrop-filter: blur(12px);
  min-height: 0;
}

.kg-panel__title {
  margin: 0;
  padding: 0.85rem 1rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--kg-text-muted);
  border-bottom: 1px solid var(--kg-border);
}

.kg-panel--categories {
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
}

.kg-categories {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.4rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1;
  scrollbar-width: thin;
}

.kg-panel--preview {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.65rem;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 0;
  align-self: stretch;
  max-height: calc(100vh - 96px);
}

.kg-preview-card,
.kg-meta {
  flex-shrink: 0;
}

.kg-panel--actions {
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  padding-bottom: 0.75rem;
}

.kg-preview-card {
  background: var(--kg-surface-2);
  border: 1px solid var(--kg-border);
  border-radius: var(--kg-radius);
  overflow: hidden;
}

.kg-preview-toolbar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--kg-border);
  flex-wrap: wrap;
}

.kg-toolbar-sep {
  width: 1px;
  height: 1.25rem;
  background: var(--kg-border);
  margin: 0 0.25rem;
}

.kg-zoom-label {
  min-width: 3rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--kg-text-muted);
}

.kg-stage-wrap {
  padding: 0.75rem;
  background:
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(255, 92, 240, 0.08), transparent 70%),
    linear-gradient(180deg, rgba(20, 10, 32, 0.6) 0%, rgba(8, 4, 14, 0.95) 100%);
}

.kg-stage {
  width: 100%;
  max-width: none;
  min-height: clamp(180px, 26vh, 280px);
  height: clamp(180px, 26vh, 280px);
  border-radius: var(--kg-radius-sm);
  border: 1px solid var(--kg-border-active);
  background: transparent;
  cursor: grab;
  position: relative;
}

.kg-stage:active { cursor: grabbing; }

.kg-stage__inner {
  transition: transform var(--kg-transition);
  transform-origin: center center;
}

.kg-stage-hint {
  margin: 0;
  padding: 0;
  font-size: 0.75rem;
  color: var(--kg-text-muted);
  text-align: center;
}

.kg-stage-hint__mobile {
  display: none;
}

.kg-stage-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  padding: 0.5rem 0.75rem 0.65rem;
  border-top: 1px solid var(--kg-border);
  background: rgba(0, 0, 0, 0.2);
}

.kg-stage-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.kg-stage-toolbar__sep {
  width: 1px;
  height: 1.35rem;
  margin: 0 0.15rem;
  background: rgba(255, 92, 240, 0.35);
}

.kg-stage-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 92, 240, 0.35);
  background: rgba(255, 92, 240, 0.1);
  color: rgba(255, 154, 235, 0.95);
  cursor: pointer;
  transition:
    background var(--kg-transition),
    border-color var(--kg-transition),
    box-shadow var(--kg-transition);
}

.kg-stage-tool-btn svg {
  width: 0.95rem;
  height: 0.95rem;
}

.kg-stage-tool-btn:hover {
  border-color: rgba(255, 154, 235, 0.65);
  background: rgba(255, 92, 240, 0.22);
  box-shadow: 0 0 10px rgba(255, 92, 240, 0.35);
}

.kg-stage-tool-btn:focus-visible {
  outline: 2px solid var(--kg-accent);
  outline-offset: 2px;
}

.kg-stage-tool-zoom {
  min-width: 2.6rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 154, 235, 0.95);
}

.kg-meta {
  display: none;
}

.kg-meta[hidden] {
  display: none !important;
}

.kg-meta__row {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.kg-meta__row--figure {
  grid-column: 1 / -1;
}

.kg-meta__row dt {
  color: var(--kg-text-muted);
  font-weight: 700;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kg-meta__row dd {
  margin: 0;
  word-break: break-word;
}

.kg-meta__code {
  display: block;
  font-size: 0.68rem;
  line-height: 1.35;
  padding: 0.3rem 0.45rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--kg-border);
  max-height: 2.8rem;
  overflow: auto;
}

.kg-meta__catalog {
  font-variant-numeric: tabular-nums;
  color: var(--kg-text-muted);
}

.kg-wardrobe__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.kg-wardrobe {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: none;
  flex-shrink: 0;
  min-height: 340px;
  overflow: visible;
  border: 1px solid var(--kg-border);
  border-radius: var(--kg-radius-sm);
  background: rgba(0, 0, 0, 0.2);
  padding: 0.45rem 0.5rem 0.5rem;
}

.kg-wardrobe.kg-wardrobe--extras {
  min-height: 380px;
}

.kg-wardrobe > .kg-panels,
.kg-wardrobe > .keko-tab-panels {
  flex: none;
  min-height: 280px;
  height: auto;
  overflow: visible;
}

.kg-panels,
.keko-tab-panels {
  flex: none;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.kg-wardrobe__title,
.kg-wardrobe .kg-gender,
.kg-wardrobe .keko-gender-filter,
.kg-wardrobe .kg-wardrobe-toolbar,
.kg-wardrobe .keko-wardrobe-toolbar {
  flex-shrink: 0;
}

@media (max-width: 1024px) {
  .kg-app {
    grid-template-columns: minmax(120px, 150px) minmax(0, 1fr);
    grid-template-areas:
      "cats preview"
      "cats actions";
  }

  .kg-panel--categories { grid-area: cats; }
  .kg-panel--preview { grid-area: preview; }
  .kg-panel--actions { grid-area: actions; position: static; max-height: none; }
}

/* ≤960px: ver responsive.css (columna única) */
