/**
 * ==========================================================================
 * WIX STUDIO UI DESIGN SYSTEM (styles.css)
 * Interfaz Gráfica Fiel a Wix Studio para Punto Rosario LAD-H | UNRC
 * ==========================================================================
 */

:root {
  --wix-topbar-bg: #0b1021;
  --wix-topbar-border: #1e293b;
  --wix-blue: #116dff;
  --wix-blue-hover: #0d5bd9;
  --wix-blue-soft: #ebf2ff;
  --wix-surface: #ffffff;
  --wix-surface-alt: #f7f8fa;
  --wix-stage-bg: #e8ecf2;
  --wix-border: #e2e8f0;
  --wix-border-strong: #cbd5e1;
  --wix-text: #0f172a;
  --wix-text-secondary: #475569;
  --wix-text-muted: #64748b;
  --wix-emerald: #10b981;
  --wix-amber: #f59e0b;
  --wix-danger: #ef4444;
  --wix-vino: #9f2241;
  --wix-gold: #bc955c;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
}

html, body.wix-studio-body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--wix-text);
  background: var(--wix-stage-bg);
  display: flex;
  flex-direction: column;
  user-select: none;
}

/* ==========================================================================
   1. BARRA SUPERIOR WIX STUDIO (#0B1021)
   ========================================================================== */
.wix-topbar {
  height: 48px;
  min-height: 48px;
  background: var(--wix-topbar-bg);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 0 12px;
  border-bottom: 1px solid var(--wix-topbar-border);
  z-index: 100;
}

.wix-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wix-logo-mark {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: #ffffff;
  padding-right: 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
}

.wix-logo-square {
  width: 26px;
  height: 26px;
  background: #000000;
  border: 1.5px solid #ffffff;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wix-logo-square::after {
  content: '';
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-radius: 50%;
}

.wix-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.wix-brand-text strong {
  font-size: 11.5px;
  letter-spacing: 1.2px;
  font-weight: 800;
}

.wix-brand-text span {
  font-size: 9.5px;
  color: #94a3b8;
  font-weight: 500;
}

.wix-page-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.wix-page-pill label {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}

.wix-top-select {
  background: transparent;
  color: #ffffff;
  border: none;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-ui);
  cursor: pointer;
  outline: none;
}

.wix-top-select option {
  background: #0b1021;
  color: #ffffff;
}

.wix-sheet-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 3px 9px;
  border-radius: 99px;
}

/* Centro: Breakpoints Responsivos (Desktop / Tablet / Mobile) */
.wix-topbar-center {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.wix-bp-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 32px;
  height: 28px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wix-bp-btn svg {
  width: 16px;
  height: 16px;
}

.wix-bp-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.wix-bp-btn.active {
  color: #ffffff;
  background: var(--wix-blue);
}

.wix-bp-px-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #cbd5e1;
  padding: 0 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

/* Derecha: Undo, Redo, Histórico, Vista Previa y Botón Azul Publish */
.wix-topbar-right {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 6px;
}

.wix-icon-action-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #cbd5e1;
  height: 32px;
  padding: 0 9px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wix-icon-action-btn:hover:not(:disabled) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.wix-icon-action-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.wix-icon-action-btn svg {
  width: 15px;
  height: 15px;
}

.wix-preview-top-btn {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  height: 32px;
  padding: 0 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wix-preview-top-btn:hover,
.wix-preview-top-btn.active {
  background: rgba(255, 255, 255, 0.2);
  border-color: #ffffff;
}

.wix-publish-btn {
  height: 100%;
  padding: 0 22px;
  background: var(--wix-blue);
  color: #ffffff;
  border: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background 0.15s ease;
  margin-left: 6px;
}

.wix-publish-btn:hover {
  background: var(--wix-blue-hover);
}

/* ==========================================================================
   2. ÁREA DE TRABAJO PRINCIPAL (LEFT RAIL + DRAWER + STAGE + RIGHT INSPECTOR)
   ========================================================================== */
.wix-main-workspace {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* Riel Vertical Izquierdo Blanco estilo Wix Studio */
.wix-left-rail {
  width: 52px;
  min-width: 52px;
  background: var(--wix-surface);
  border-right: 1px solid var(--wix-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  gap: 6px;
  z-index: 40;
}

.wix-rail-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--wix-text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.wix-rail-btn svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.9;
}

.wix-rail-btn:hover {
  background: var(--wix-surface-alt);
  color: var(--wix-text);
}

.wix-rail-btn.active {
  background: var(--wix-blue-soft);
  color: var(--wix-blue);
}

.wix-rail-spacer {
  flex: 1;
}

/* Cajón Deslizante Izquierdo (Drawer) */
.wix-left-drawer {
  width: 300px;
  min-width: 300px;
  background: var(--wix-surface);
  border-right: 1px solid var(--wix-border);
  display: flex;
  flex-direction: column;
  z-index: 35;
  box-shadow: 6px 0 20px rgba(15, 23, 42, 0.05);
  transition: margin-left 0.2s ease;
}

.wix-left-drawer.collapsed {
  display: none;
}

.wix-drawer-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--wix-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wix-drawer-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--wix-text);
}

.wix-drawer-close {
  background: transparent;
  border: none;
  color: var(--wix-text-muted);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.wix-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ==========================================================================
   3. ESCENARIO CENTRAL WIX STUDIO (STAGE + ARTBOARD CON HANDLES LATERALES)
   ========================================================================== */
.wix-canvas-stage {
  flex: 1;
  background: var(--wix-stage-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: auto;
  padding: 20px 28px 36px;
  position: relative;
}

/* Barra de Migas de Pan (Breadcrumbs) y Acciones Rápidas sobre el Artboard */
.wix-stage-breadcrumb-bar {
  width: 100%;
  max-width: 1320px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 6px 12px;
  background: var(--wix-surface);
  border: 1px solid var(--wix-border);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.wix-breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--wix-text-secondary);
}

.wix-breadcrumb-trail strong {
  color: var(--wix-blue);
}

.wix-stage-quick-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Contenedor Artboard con Handles Laterales "|" igual a Wix Studio */
.wix-artboard-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex: 1;
  min-height: 580px;
  position: relative;
}

.wix-side-resize-bar {
  width: 14px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: ew-resize;
  user-select: none;
}

.wix-side-resize-bar::after {
  content: '';
  width: 4px;
  height: 36px;
  background: #94a3b8;
  border-radius: 99px;
  transition: background 0.15s ease, height 0.15s ease;
}

.wix-side-resize-bar:hover::after {
  background: var(--wix-blue);
  height: 48px;
}

.wix-artboard-frame {
  width: 100%;
  height: 100%;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  transition: width 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
}

.wix-artboard-frame[data-bp="desktop"] {
  width: 100%;
  max-width: 1340px;
}

.wix-artboard-frame[data-bp="tablet"] {
  width: 768px;
}

.wix-artboard-frame[data-bp="mobile"] {
  width: 390px;
}

#wixArtboardIframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
  flex: 1;
}

/* Modo Vista Previa Pantalla Completa */
body.wix-preview-mode-active .wix-left-rail,
body.wix-preview-mode-active .wix-left-drawer,
body.wix-preview-mode-active .wix-right-inspector,
body.wix-preview-mode-active .wix-stage-breadcrumb-bar,
body.wix-preview-mode-active .wix-side-resize-bar {
  display: none !important;
}

body.wix-preview-mode-active .wix-canvas-stage {
  padding: 0;
  background: #0b1021;
}

body.wix-preview-mode-active .wix-artboard-frame[data-bp="desktop"] {
  max-width: 100%;
  border-radius: 0;
}

/* ==========================================================================
   4. INSPECTOR CONTEXTUAL DERECHO WIX STUDIO (#FFFFFF)
   ========================================================================== */
.wix-right-inspector {
  width: 326px;
  min-width: 326px;
  background: var(--wix-surface);
  border-left: 1px solid var(--wix-border);
  display: flex;
  flex-direction: column;
  z-index: 40;
}

.wix-inspector-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--wix-border);
  background: var(--wix-surface-alt);
}

.wix-inspector-obj-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.wix-inspector-obj-title strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--wix-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wix-obj-type-pill {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--wix-blue-soft);
  color: var(--wix-blue);
}

.wix-sheet-map-banner {
  margin-top: 8px;
  padding: 6px 9px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  font-size: 11px;
  color: #166534;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.wix-inspector-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--wix-border);
  background: var(--wix-surface);
}

.wix-insp-tab {
  padding: 9px 4px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--wix-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.wix-insp-tab:hover {
  color: var(--wix-text);
}

.wix-insp-tab.active {
  color: var(--wix-blue);
  border-bottom-color: var(--wix-blue);
}

.wix-inspector-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ==========================================================================
   5. COMPONENTES DE CONTROL WIX STUDIO (CAJAS W/H/X/Y, DOCKING, CARDS)
   ========================================================================== */
.wix-panel-section {
  background: var(--wix-surface);
  border: 1px solid var(--wix-border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wix-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--wix-text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Cuadrícula de Tamaño y Posición W / H / X / Y / ° estilo Wix Studio */
.wix-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.wix-metric-box {
  display: flex;
  align-items: center;
  background: var(--wix-surface-alt);
  border: 1px solid var(--wix-border);
  border-radius: 6px;
  padding: 4px 8px;
  gap: 6px;
}

.wix-metric-box:focus-within {
  border-color: var(--wix-blue);
  background: #ffffff;
}

.wix-metric-box span {
  font-size: 11px;
  font-weight: 700;
  color: var(--wix-text-muted);
  min-width: 16px;
}

.wix-metric-box input {
  width: 100%;
  border: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--wix-text);
  text-align: right;
  outline: none;
}

/* Matriz de Posicionamiento Rápido de 9 Puntos (Docking Grid) */
.wix-dock-matrix {
  display: grid;
  grid-template-columns: repeat(3, 28px);
  grid-template-rows: repeat(3, 24px);
  gap: 4px;
  justify-content: center;
  background: var(--wix-surface-alt);
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--wix-border);
}

.wix-dock-dot {
  border: 1px solid var(--wix-border-strong);
  background: #ffffff;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--wix-text-muted);
  transition: all 0.15s ease;
}

.wix-dock-dot:hover {
  border-color: var(--wix-blue);
  background: var(--wix-blue-soft);
  color: var(--wix-blue);
}

/* Controles de Formulario */
.wix-field-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.wix-field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--wix-text-secondary);
}

.wix-field-label code {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--wix-blue);
  background: var(--wix-blue-soft);
  padding: 1px 5px;
  border-radius: 4px;
}

.wix-input,
.wix-select,
.wix-textarea {
  width: 100%;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid var(--wix-border);
  background: var(--wix-surface-alt);
  color: var(--wix-text);
  font-family: var(--font-ui);
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.wix-input:focus,
.wix-select:focus,
.wix-textarea:focus {
  border-color: var(--wix-blue);
  background: #ffffff;
}

.wix-textarea {
  min-height: 70px;
  resize: vertical;
  line-height: 1.45;
}

/* Botones Wix Studio */
.wix-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-ui);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.wix-btn-primary {
  background: var(--wix-blue);
  color: #ffffff;
}

.wix-btn-primary:hover {
  background: var(--wix-blue-hover);
}

.wix-btn-outline {
  background: #ffffff;
  color: var(--wix-text);
  border-color: var(--wix-border-strong);
}

.wix-btn-outline:hover {
  border-color: var(--wix-blue);
  color: var(--wix-blue);
  background: var(--wix-blue-soft);
}

.wix-btn-vino {
  background: var(--wix-vino);
  color: #ffffff;
}

.wix-btn-sm {
  padding: 4px 8px;
  font-size: 11px;
}

/* Tarjetas para Añadir Elementos en el Drawer */
.wix-add-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.wix-add-card {
  background: var(--wix-surface-alt);
  border: 1px solid var(--wix-border);
  border-radius: 8px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wix-add-card:hover {
  border-color: var(--wix-blue);
  background: var(--wix-blue-soft);
  transform: translateY(-1px);
}

.wix-add-card-icon {
  font-size: 20px;
}

.wix-add-card strong {
  font-size: 11.5px;
  color: var(--wix-text);
}

.wix-add-card span {
  font-size: 10px;
  color: var(--wix-text-muted);
}

/* Interruptores de Visibilidad por Dispositivo */
.wix-device-visibility-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.wix-dev-toggle {
  padding: 7px 4px;
  border-radius: 6px;
  border: 1px solid var(--wix-border);
  background: var(--wix-surface-alt);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--wix-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.wix-dev-toggle.visible {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #065f46;
}

.wix-dev-toggle.hidden-dev {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
  text-decoration: line-through;
}

/* Árbol de Capas (Layers Tree) */
.wix-layer-block {
  border: 1px solid var(--wix-border);
  border-radius: 7px;
  overflow: hidden;
  background: #ffffff;
}

.wix-layer-header {
  padding: 7px 10px;
  background: var(--wix-surface-alt);
  font-weight: 700;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border-bottom: 1px solid var(--wix-border);
}

.wix-layer-item {
  padding: 6px 10px 6px 20px;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
}

.wix-layer-item:hover,
.wix-layer-header:hover {
  background: var(--wix-blue-soft);
}

.wix-layer-item.active,
.wix-layer-header.active {
  background: var(--wix-blue);
  color: #ffffff;
}

/* ==========================================================================
   6. VISTAS MODALES SUPERPUESTAS (POP-UPS, SHEET CMS, HISTÓRICO, CÓDIGO)
   ========================================================================== */
.wix-modal-backdrop {
  position: fixed;
  inset: 48px 0 0 52px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.wix-modal-backdrop.active {
  display: flex;
}

.wix-modal-window {
  width: 100%;
  max-width: 1180px;
  height: 100%;
  max-height: 86vh;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--wix-border);
}

.wix-modal-top {
  padding: 16px 22px;
  border-bottom: 1px solid var(--wix-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--wix-surface-alt);
}

.wix-modal-top h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--wix-text);
}

.wix-modal-content {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
}

/* Toast de Notificación */
.wix-toast {
  position: fixed;
  bottom: 20px;
  right: 24px;
  background: #0b1021;
  color: #ffffff;
  padding: 11px 18px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  border-left: 4px solid var(--wix-blue);
  z-index: 9999;
  opacity: 0;
  transform: translateY(15px);
  pointer-events: none;
  transition: all 0.25s ease;
}

.wix-toast.show {
  opacity: 1;
  transform: translateY(0);
}
