/* ============================================================
   OMNI Creador — Estilos (Fases 2–4)
   Mobile-first · app nativa · safe areas · onboarding · editor
   ============================================================ */

*,
*::before,
*::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; height: 100%; }

body.cz {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--negro-profundo);
  color: var(--blanco-pergamino);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}

button { font-family: inherit; }

/* ============================================================
   BOTONES BASE
   ============================================================ */
.cz-btn-primary,
.cz-btn-outline,
.cz-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: var(--radius-full, 9999px);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform var(--transition-fast, 150ms ease), opacity var(--transition-fast, 150ms ease), background var(--transition-fast, 150ms ease);
}

.cz-btn-primary {
  border: none;
  background: var(--naranja-accion);
  color: #050505;
}

.cz-btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.cz-btn-primary:not(:disabled):active { transform: scale(0.97); }

.cz-btn-outline {
  background: transparent;
  color: var(--oro-sagrado);
  border: 1px solid rgba(197, 160, 89, 0.5);
}

.cz-btn-outline:active { background: rgba(197, 160, 89, 0.12); }

.cz-btn-ghost {
  background: transparent;
  border: none;
  color: rgba(244, 241, 234, 0.6);
  font-weight: 500;
}

.cz-btn-block { width: 100%; }

.cz-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: var(--radius-full, 9999px);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--blanco-pergamino);
  cursor: pointer;
  transition: opacity var(--transition-fast, 150ms ease);
}

.cz-icon-btn svg { width: 20px; height: 20px; }
.cz-icon-btn:disabled { opacity: 0.28; cursor: not-allowed; }
.cz-icon-btn:not(:disabled):active { background: rgba(255, 255, 255, 0.12); }

/* ============================================================
   LOADER
   ============================================================ */
.cz-loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  background: var(--negro-profundo);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.cz-loader.is-hidden { opacity: 0; visibility: hidden; }

.cz-loader__glyph {
  font-size: 2.5rem;
  color: var(--oro-sagrado);
  animation: cz-spin 3.2s linear infinite;
}

.cz-loader__text {
  margin: 0;
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(244, 241, 234, 0.6);
}

.cz-loader__bar {
  width: min(220px, 60vw);
  height: 3px;
  border-radius: var(--radius-full, 9999px);
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.cz-loader__bar > span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--oro-sagrado);
  transition: width 0.3s ease;
}

@keyframes cz-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

/* ============================================================
   ONBOARDING
   ============================================================ */
.cz-onboarding {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  flex-direction: column;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(197, 160, 89, 0.12), rgba(5, 5, 5, 0) 55%),
    var(--negro-profundo);
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 0 calc(env(safe-area-inset-bottom, 0px) + 8px);
}

body.screen-onboarding .cz-onboarding { display: flex; }

.cz-onboarding__viewport {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.cz-onboarding__track {
  display: flex;
  width: 100%;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.cz-ob-step {
  flex: 0 0 100%;
  padding: 0 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.cz-ob-step__glyph {
  font-size: 3rem;
  color: var(--oro-sagrado);
  margin-bottom: 6px;
}

.cz-ob-step__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 0;
  color: var(--blanco-pergamino);
}

.cz-ob-step__text {
  margin: 0;
  max-width: 340px;
  font-size: 1rem;
  line-height: 1.6;
  font-family: var(--font-body);
  color: rgba(244, 241, 234, 0.78);
}

.cz-ob-step__text strong { color: var(--oro-sagrado); }

.cz-ob-step__hint {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(244, 241, 234, 0.45);
}

.cz-ob-gestures {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.875rem;
  color: rgba(244, 241, 234, 0.72);
}

.cz-ob-gestures span {
  display: inline-block;
  width: 26px;
  color: var(--oro-sagrado);
  font-size: 1.1rem;
}

.cz-onboarding__footer {
  padding: 12px 24px 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cz-ob-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.cz-ob-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: var(--radius-full, 9999px);
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: width var(--transition-smooth, 250ms ease), background var(--transition-smooth, 250ms ease);
}

.cz-ob-dot.is-active {
  width: 24px;
  background: var(--oro-sagrado);
}

.cz-ob-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ============================================================
   SELECTOR DE PRENDA (bottom sheet)
   ============================================================ */
.cz-sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: flex-end;
  background: rgba(5, 5, 5, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

body.screen-sheet .cz-sheet { display: flex; }

.cz-sheet__panel {
  width: 100%;
  max-height: 92%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--admin-card, #14141A);
  border-radius: 24px 24px 0 0;
  padding: 10px 20px calc(env(safe-area-inset-bottom, 0px) + 20px);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.6);
  animation: cz-up 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes cz-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

.cz-sheet__handle {
  width: 44px;
  height: 4px;
  border-radius: var(--radius-full, 9999px);
  background: rgba(255, 255, 255, 0.2);
  margin: 4px auto 16px;
}

.cz-sheet__head { margin-bottom: 18px; }

.cz-sheet__title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.375rem;
  color: var(--blanco-pergamino);
}

.cz-sheet__sub {
  margin: 0;
  font-size: 0.8125rem;
  color: rgba(244, 241, 234, 0.55);
}

.cz-prendas {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.cz-prenda {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 12px;
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--radius-lg, 14px);
  background: var(--admin-input-bg, #1C1C24);
  border: 1.5px solid transparent;
  color: var(--blanco-pergamino);
  cursor: pointer;
  transition: border-color var(--transition-fast, 150ms ease);
}

.cz-prenda.is-active { border-color: var(--oro-sagrado); }

.cz-prenda__name { font-weight: 600; font-size: 0.9375rem; }
.cz-prenda__meta { grid-row: 2; font-size: 0.75rem; color: rgba(244, 241, 234, 0.5); }
.cz-prenda__price {
  grid-row: 1 / span 2;
  align-self: center;
  font-weight: 600;
  color: var(--oro-sagrado);
  font-size: 0.875rem;
}

.cz-field { margin-bottom: 18px; }

.cz-field__label {
  margin: 0 0 10px;
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244, 241, 234, 0.5);
}

.cz-tallas { display: flex; flex-wrap: wrap; gap: 8px; }

.cz-talla {
  min-width: 48px;
  height: 48px;
  padding: 0 14px;
  border-radius: var(--radius-md, 10px);
  background: var(--admin-input-bg, #1C1C24);
  border: 1.5px solid transparent;
  color: var(--blanco-pergamino);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color var(--transition-fast, 150ms ease);
}

.cz-talla.is-active { border-color: var(--oro-sagrado); color: var(--oro-sagrado); }

.cz-empty {
  margin: 0;
  padding: 16px;
  text-align: center;
  font-size: 0.8125rem;
  color: rgba(244, 241, 234, 0.5);
}

/* ============================================================
   EDITOR
   ============================================================ */
.cz-editor {
  display: none;
  height: 100vh;
  height: 100dvh;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

body.screen-editor .cz-editor { display: grid; }

.cz-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) var(--space-md) 12px;
  background: linear-gradient(180deg, rgba(5, 5, 5, 0.95), rgba(5, 5, 5, 0.65) 70%, transparent);
  position: relative;
  z-index: 5;
}

.cz-header__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full, 9999px);
  color: var(--blanco-pergamino);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  flex-shrink: 0;
}

.cz-header__back svg { width: 22px; height: 22px; }

.cz-header__title { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }

.cz-header__brand {
  font-family: var(--font-display);
  font-size: 0.875rem;
  letter-spacing: 0.22em;
  color: var(--oro-sagrado);
}

.cz-header__sub {
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: rgba(244, 241, 234, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}

.cz-header__actions { margin-left: auto; display: flex; gap: 6px; flex: 0 0 auto; }

.cz-header__price {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--blanco-pergamino);
  background: rgba(197, 160, 89, 0.12);
  border: 1px solid rgba(197, 160, 89, 0.28);
  border-radius: var(--radius-full, 9999px);
  padding: 6px 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---- Stage ---- */
.cz-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 8%, rgba(197, 160, 89, 0.10) 0%, rgba(5, 5, 5, 0) 55%),
    radial-gradient(140% 90% at 50% 110%, rgba(74, 20, 140, 0.16) 0%, rgba(5, 5, 5, 0) 60%),
    var(--negro-profundo);
}

.cz-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.cz-stage__hint {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  margin: 0;
  padding: 6px 14px;
  font-size: 0.6875rem;
  color: rgba(244, 241, 234, 0.55);
  background: rgba(5, 5, 5, 0.55);
  border-radius: var(--radius-full, 9999px);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: inline-flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.cz-stage__hint--off { opacity: 0; }
.cz-stage__hint-dot { opacity: 0.5; }

/* ---- Zonebar ---- */
.cz-zonebar {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(5, 5, 5, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full, 9999px);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  max-width: calc(100% - 24px);
  overflow-x: auto;
  scrollbar-width: none;
}

.cz-zonebar::-webkit-scrollbar { display: none; }

.cz-zonebar__btn {
  flex-shrink: 0;
  min-height: 36px;
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius-full, 9999px);
  background: transparent;
  color: rgba(244, 241, 234, 0.7);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
}

.cz-zonebar__btn.is-active {
  background: var(--oro-sagrado);
  color: #050505;
}

/* ---- Handles ---- */
.cz-handles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8; /* los handles siempre por encima de chips y FABs */
  opacity: 0;
  transition: opacity 0.15s ease;
}

.cz-handles.is-visible { opacity: 1; }

.cz-handle {
  position: absolute;
  top: 0;
  left: 0;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border-radius: var(--radius-full, 9999px);
  border: 1.5px solid var(--oro-sagrado);
  background: rgba(5, 5, 5, 0.78);
  color: var(--oro-sagrado);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  will-change: transform;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

/* Área táctil ampliada (~48px) sin agrandar el icono */
.cz-handle::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: var(--radius-full, 9999px);
}

.cz-handle svg { width: 15px; height: 15px; }

.cz-handle--move {
  border-color: rgba(244, 241, 234, 0.85);
  color: var(--blanco-pergamino);
}

.cz-handle--corner {
  border-color: var(--naranja-accion);
  color: var(--naranja-accion);
}

.cz-handle:active { cursor: grabbing; }

/* ---- Acciones de capa seleccionada ---- */
.cz-sel-actions {
  position: absolute;
  bottom: 70px; /* Bajado para despejar el mockup */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 6;
  max-width: calc(100% - 28px);
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.cz-sel-actions::-webkit-scrollbar { display: none; }

.cz-chip {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 7px 14px;
  border-radius: var(--radius-full, 9999px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(5, 5, 5, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--blanco-pergamino);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.cz-chip--danger { color: #ff6b4a; border-color: rgba(255, 107, 74, 0.4); }

/* ============================================================
   BARRA INFERIOR
   ============================================================ */
.cz-bar {
  padding: 14px var(--space-md) calc(env(safe-area-inset-bottom, 0px) + 16px);
  background: linear-gradient(0deg, rgba(5, 5, 5, 0.98), rgba(5, 5, 5, 0.85) 60%, transparent);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 42vh;
  overflow-y: auto;
}

.cz-bar__section { max-width: 640px; margin: 0 auto; width: 100%; }

.cz-bar__label {
  margin: 0 0 10px;
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244, 241, 234, 0.5);
}

.cz-swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.cz-swatches--sm { gap: 10px; }

.cz-swatch {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full, 9999px);
  border: 2px solid rgba(255, 255, 255, 0.18);
  padding: 0;
  cursor: pointer;
  position: relative;
  transition: transform var(--transition-fast, 150ms ease), border-color var(--transition-fast, 150ms ease), box-shadow var(--transition-fast, 150ms ease);
}

.cz-swatch:active { transform: scale(0.92); }
.cz-swatch.is-active,
.cz-swatch[aria-checked="true"] {
  border-color: var(--oro-sagrado);
  box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.25);
}

.cz-swatch--light { border-color: rgba(0, 0, 0, 0.25); }

/* ---- Estantería de diseños ---- */
.cz-shelf {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.cz-shelf::-webkit-scrollbar { display: none; }

.cz-shelf__item {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md, 10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  cursor: pointer;
  transition: border-color var(--transition-fast, 150ms ease), transform var(--transition-fast, 150ms ease);
}

.cz-shelf__item:active { transform: scale(0.94); }
.cz-shelf__item:hover { border-color: rgba(197, 160, 89, 0.5); }

.cz-shelf__item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* ============================================================
   TOAST
   ============================================================ */
.cz-toast {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 76px);
  bottom: auto;
  transform: translate(-50%, -14px);
  z-index: 200;
  max-width: 88vw;
  padding: 12px 18px;
  border-radius: var(--radius-full, 9999px);
  background: rgba(20, 20, 26, 0.96);
  border: 1px solid rgba(197, 160, 89, 0.35);
  color: var(--blanco-pergamino);
  font-size: 0.8125rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.cz-toast--show { opacity: 1; transform: translate(-50%, 0); }
.cz-toast--error { border-color: rgba(255, 107, 74, 0.5); }

/* ============================================================
   TABS DE LA BARRA + PANELES
   ============================================================ */
.cz-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.cz-tab {
  flex: 1;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full, 9999px);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(244, 241, 234, 0.62);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast, 150ms ease), color var(--transition-fast, 150ms ease), border-color var(--transition-fast, 150ms ease);
}

.cz-tab.is-active {
  background: rgba(197, 160, 89, 0.16);
  border-color: rgba(197, 160, 89, 0.55);
  color: var(--oro-sagrado);
}

.cz-tabpanel { display: none; }
.cz-tabpanel.is-active { display: block; }

/* ---- Subida ---- */
.cz-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 12px 18px;
  border-radius: var(--radius-lg, 14px);
  border: 1.5px dashed rgba(197, 160, 89, 0.5);
  background: rgba(197, 160, 89, 0.06);
  color: var(--oro-sagrado);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast, 150ms ease), transform var(--transition-fast, 150ms ease);
}

.cz-upload svg { width: 20px; height: 20px; }
.cz-upload:active { transform: scale(0.98); background: rgba(197, 160, 89, 0.14); }

.cz-hint {
  margin: 10px 0 0;
  font-size: 0.6875rem;
  line-height: 1.5;
  color: rgba(244, 241, 234, 0.42);
  text-align: center;
}

/* ============================================================
   MODALES (texto / propiedades)
   ============================================================ */
.cz-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: flex-end;
  background: rgba(5, 5, 5, 0.7);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.cz-modal.is-open { display: flex; }

.cz-modal__panel {
  width: 100%;
  max-height: 92%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--admin-card, #14141A);
  border-radius: 24px 24px 0 0;
  padding: 10px 20px calc(env(safe-area-inset-bottom, 0px) + 20px);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.6);
  animation: cz-up 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cz-modal__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* ---- Campos ---- */
.cz-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: var(--radius-md, 10px);
  background: var(--admin-input-bg, #1C1C24);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--blanco-pergamino);
  font-size: 0.9375rem;
  font-family: inherit;
}

.cz-input:focus {
  outline: none;
  border-color: rgba(197, 160, 89, 0.6);
}

.cz-field--row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cz-field--row .cz-field__label { margin-bottom: 6px; }

.cz-range {
  width: 100%;
  height: 32px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
}

.cz-range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: var(--radius-full, 9999px);
  background: rgba(255, 255, 255, 0.16);
}

.cz-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -10px;
  border-radius: var(--radius-full, 9999px);
  background: var(--oro-sagrado);
  border: 2px solid #0d0d10;
}

.cz-range::-moz-range-track {
  height: 4px;
  border-radius: var(--radius-full, 9999px);
  background: rgba(255, 255, 255, 0.16);
}

.cz-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full, 9999px);
  background: var(--oro-sagrado);
  border: 2px solid #0d0d10;
}

.cz-color-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.cz-color-row input[type="color"] {
  width: 48px;
  height: 48px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md, 10px);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.cz-swatch--mini {
  width: 32px;
  height: 32px;
  border-width: 1.5px;
}

/* ============================================================
   FAB — VISTA PREVIA
   ============================================================ */
.cz-stage__hint { top: 64px; bottom: auto; }

.cz-cta-stack {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 7;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.cz-fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 8px;
  height: 48px;
  padding: 0 16px;
  border-radius: var(--radius-full, 9999px);
  border: 1px solid rgba(197, 160, 89, 0.45);
  background: rgba(5, 5, 5, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--oro-sagrado);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  transition: transform var(--transition-fast, 150ms ease);
}

.cz-fab svg { width: 20px; height: 20px; }
.cz-fab:active { transform: scale(0.96); }

.cz-fab--ghost { /* estilo base */ }

.cz-fab--primary {
  border-color: transparent;
  background: var(--naranja-accion);
  color: #050505;
  box-shadow: 0 6px 22px rgba(255, 109, 0, 0.35);
}

/* ============================================================
   VISTA PREVIA
   ============================================================ */
.cz-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.cz-preview__item { margin: 0; text-align: center; }

.cz-preview__item img {
  width: 100%;
  display: block;
  border-radius: var(--radius-lg, 14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0a0a0d;
}

.cz-preview__item figcaption {
  margin-top: 6px;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(244, 241, 234, 0.5);
}

/* ============================================================
   DESGLOSE DE PRECIO
   ============================================================ */
.cz-breakdown {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
}

.cz-breakdown__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 0.875rem;
  color: rgba(244, 241, 234, 0.78);
}

.cz-breakdown__row--sub {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  color: var(--blanco-pergamino);
}

.cz-breakdown__row--total {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 1.0625rem;
  color: var(--oro-sagrado);
}

/* ============================================================
   PEDIDO — método de pago + éxito
   ============================================================ */
textarea.cz-input {
  min-height: 64px;
  resize: none;
  line-height: 1.5;
}

.cz-pay {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cz-pay__card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-lg, 14px);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  background: var(--admin-input-bg, #1C1C24);
  cursor: pointer;
  transition: border-color var(--transition-fast, 150ms ease), background var(--transition-fast, 150ms ease);
}

.cz-pay__card:has(input:checked) {
  border-color: var(--oro-sagrado);
  background: rgba(197, 160, 89, 0.08);
}

.cz-pay__card input[type="radio"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--oro-sagrado);
  flex-shrink: 0;
}

.cz-pay__body { display: flex; flex-direction: column; gap: 3px; }

.cz-pay__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--blanco-pergamino);
}

.cz-pay__desc {
  font-size: 0.8125rem;
  color: rgba(244, 241, 234, 0.6);
}

.cz-success__glyph {
  font-size: 2.5rem;
  color: var(--oro-sagrado);
  text-align: center;
  margin-bottom: 8px;
}

/* ============================================================
   SKELETON + ACCESIBILIDAD
   ============================================================ */
.cz-skel {
  height: 66px;
  border-radius: var(--radius-lg, 14px);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.09) 37%, rgba(255, 255, 255, 0.05) 63%);
  background-size: 400% 100%;
  animation: cz-shimmer 1.4s ease infinite;
  margin-bottom: 10px;
}

@keyframes cz-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

.cz-fab:focus-visible,
.cz-btn-primary:focus-visible,
.cz-btn-outline:focus-visible,
.cz-btn-ghost:focus-visible,
.cz-icon-btn:focus-visible,
.cz-tab:focus-visible,
.cz-talla:focus-visible,
.cz-swatch:focus-visible,
.cz-shelf__item:focus-visible,
.cz-zonebar__btn:focus-visible,
.cz-chip:focus-visible,
.cz-prenda:focus-visible,
.cz-input:focus-visible,
.cz-ob-dot:focus-visible,
.cz-pay__card:focus-within {
  outline: 2px solid var(--oro-sagrado);
  outline-offset: 2px;
}

.cz-noscript {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px;
  text-align: center;
  background: var(--negro-profundo);
  color: var(--blanco-pergamino);
  font-family: var(--font-ui);
}

/* ============================================================
   MÓVIL (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {
  .cz-header { gap: 8px; padding-left: 10px; padding-right: 10px; }
  .cz-header__back { width: 40px; height: 40px; }
  .cz-header__brand { font-size: 0.8125rem; letter-spacing: 0.16em; }
  .cz-header__price { font-size: 0.8125rem; padding: 5px 10px; }
  .cz-icon-btn { width: 36px; height: 36px; }
  .cz-icon-btn svg { width: 18px; height: 18px; }

  .cz-cta-stack {
    left: 10px;
    right: 10px;
    bottom: 10px;
    gap: 8px;
  }
  .cz-fab { height: 42px; padding: 0 14px; font-size: 0.78rem; }
  .cz-fab svg { width: 17px; height: 17px; }
  .cz-sel-actions { bottom: 58px; gap: 6px; }
  .cz-chip { min-height: 32px; padding: 5px 11px; font-size: 0.72rem; }
  .cz-zonebar__btn { min-height: 32px; padding: 5px 11px; font-size: 0.6875rem; }

  /* Handles de edición (rotar/escalar/mover): compactos en móvil */
  .cz-handle { width: 26px; height: 26px; }
  .cz-handle::after { inset: -9px; }
  .cz-handle svg { width: 12px; height: 12px; }
}

/* Pantallas bajas (móvil en horizontal) */
@media (max-height: 520px) {
  .cz-stage__hint { display: none; }
  .cz-sel-actions { bottom: 54px; }
}

/* ============================================================
   DESKTOP (centrado tipo app)
   ============================================================ */
@media (min-width: 900px) {
  body.cz { max-width: 480px; margin: 0 auto; border-left: 1px solid rgba(255, 255, 255, 0.06); border-right: 1px solid rgba(255, 255, 255, 0.06); }
  .cz-onboarding, .cz-sheet, .cz-loader, .cz-modal { max-width: 480px; left: 0; right: 0; margin: 0 auto; }
  .cz-swatch { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .cz-loader__glyph { animation: none; }
  .cz-onboarding__track { transition: none; }
  .cz-skel { animation: none; }
}
