/* ============================================================
   ESTILOS PRINCIPALES - ESTUDIO DE MOCKUPS (DEVICE MOCKUP GENERATOR)
   ============================================================ */

:root {
  /* Paleta base y fondos de interfaz */
  --bg-app: #0b0d13;
  --bg-sidebar: #12151e;
  --bg-card: #181c28;
  --bg-card-hover: #1f2433;
  --bg-input: #11141d;
  --bg-active: #2a3147;
  
  /* Bordes y separadores */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.14);
  --border-active: rgba(99, 102, 241, 0.6);
  --border-focus: #6366f1;

  /* Colores de texto */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Acentos de marca */
  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  --accent-glow: rgba(99, 102, 241, 0.25);
  --accent-success: #10b981;

  /* Dimensiones y espaciados */
  --header-height: 64px;
  --sidebar-width: 380px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* Sombras de interfaz */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.35);

  /* Transiciones */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset básico y tipografía */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Utilidad para lectores de pantalla */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   CABECERA PRINCIPAL
   ============================================================ */
.app-header {
  height: var(--header-height);
  background: rgba(18, 21, 30, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  z-index: 100;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 1.25rem;
  gap: 1rem;
}

/* Marca y logotipo */
.brand-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand-logo-box {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.brand-text h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #ffffff;
}

.badge-free {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.brand-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Acciones y selectores de cabecera */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: nowrap;
}

.form-select-header {
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0 0.75rem;
  cursor: pointer;
  outline: none;
  transition: var(--transition-fast);
}

.form-select-header:hover, .form-select-header:focus {
  border-color: var(--border-medium);
  background: var(--bg-card-hover);
}

.form-select-format {
  width: 140px;
}

/* Selector de resolución segmentado */
.resolution-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px 4px 2px 8px;
}

.selector-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.btn-group-segmented {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.btn-segment {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.btn-segment:hover {
  color: var(--text-primary);
}

.btn-segment.active {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

/* Botones de acción */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 36px;
  padding: 0 0.95rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  outline: none;
  transition: var(--transition-normal);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
}

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */
.studio-main-layout {
  display: flex;
  height: calc(100vh - var(--header-height));
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* ============================================================
   PANEL LATERAL: EDITOR DE OPCIONES
   ============================================================ */
.sidebar-editor {
  width: var(--sidebar-width);
  height: 100%;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex-shrink: 0;
  z-index: 20;
}

/* Scrollbar personalizada */
.sidebar-editor::-webkit-scrollbar {
  width: 6px;
}
.sidebar-editor::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-editor::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}
.sidebar-editor::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Tarjetas y Acordeones */
.control-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.upload-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border-radius: 999px;
}

/* Dropzone de subida rápida */
.upload-dropzone-inline {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
  padding: 1rem 0.75rem;
  text-align: center;
  transition: var(--transition-fast);
  cursor: pointer;
}

.upload-dropzone-inline:hover, .upload-dropzone-inline.drag-active {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.08);
}

.dropzone-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  color: var(--text-muted);
}

.dropzone-primary-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.dropzone-sub-text {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.dropzone-sub-text strong {
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}

.image-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.6rem;
  padding: 0.4rem 0.6rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
}

.image-name-text {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.btn-remove-link {
  background: none;
  border: none;
  color: #818cf8;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.75rem;
}

.btn-remove-link:hover {
  text-decoration: underline;
}

/* Acordeones colapsables */
.control-accordion {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition-fast);
}

.control-accordion[open] {
  border-color: var(--border-medium);
}

.accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  user-select: none;
  background: var(--bg-card);
  transition: var(--transition-fast);
}

.accordion-summary::-webkit-details-marker {
  display: none;
}

.accordion-summary:hover {
  background: var(--bg-card-hover);
}

.summary-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.summary-current-value {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.accordion-content {
  padding: 1rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Cuadrícula de dispositivos */
.device-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.device-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.device-card:hover {
  border-color: var(--border-medium);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.device-card.active {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.12);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px var(--accent-primary);
}

.device-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.device-name {
  font-size: 0.72rem;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* Muestras de color del chasis */
.color-swatches-group {
  display: flex;
  gap: 0.5rem;
}

.swatch-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.swatch-btn:hover {
  transform: scale(1.1);
}

.swatch-btn.active {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px var(--accent-primary);
}

/* Campos de formulario */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-control {
  height: 36px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.82rem;
  padding: 0 0.75rem;
  outline: none;
  transition: var(--transition-fast);
  width: 100%;
}

.form-control:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon svg {
  position: absolute;
  left: 0.75rem;
  color: var(--text-dim);
  pointer-events: none;
}

.input-with-icon .form-control {
  padding-left: 2.2rem;
}

/* Toggles / Switches */
.toggles-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toggle-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
}

.toggle-item input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  width: 36px;
  height: 20px;
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: 999px;
  position: relative;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: var(--transition-fast);
}

.toggle-item input:checked + .toggle-track {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.toggle-item input:checked + .toggle-track::after {
  transform: translateX(16px);
  background: #ffffff;
}

.toggle-text {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Galería de degradados (24 presets) */
.bg-palette-container {
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

.bg-palette-container::-webkit-scrollbar {
  width: 4px;
}
.bg-palette-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.45rem;
}

.gradient-swatch-box {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
}

.gradient-swatch-box:hover {
  transform: scale(1.12);
  z-index: 2;
  box-shadow: var(--shadow-sm);
}

.gradient-swatch-box.active {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px var(--accent-primary), var(--shadow-sm);
  transform: scale(1.05);
}

/* Selector de color compuesto */
.color-picker-composite {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.color-picker-input {
  width: 40px;
  height: 36px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
  padding: 0;
}

.color-hex-input {
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
}

/* Botones de relación de aspecto */
.ratio-buttons-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.ratio-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.ratio-btn:hover {
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.ratio-btn.active {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.12);
  color: #ffffff;
}

.ratio-tag {
  font-size: 0.82rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.ratio-name {
  font-size: 0.68rem;
  color: var(--text-dim);
}

.ratio-btn.active .ratio-name {
  color: #cbd5e1;
}

/* Sliders de rango estilizados */
.range-slider-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.range-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.range-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.range-value {
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
}

.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: 999px;
  outline: none;
  border: 1px solid var(--border-subtle);
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--accent-primary);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  transition: var(--transition-fast);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Utilidades de espaciado */
.mb-3 { margin-bottom: 0.75rem; }
.mt-3 { margin-top: 0.75rem; }

/* ============================================================
   ÁREA CENTRAL: LIENZO Y VISUALIZADOR
   ============================================================ */
.stage-container {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #090a0f;
  position: relative;
  overflow: hidden;
}

/* Barra superior del visor */
.stage-toolbar {
  height: 44px;
  background: rgba(14, 17, 24, 0.7);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  z-index: 10;
}

.canvas-dimensions-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.btn-zoom, .btn-zoom-fit {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
}

.btn-zoom:hover, .btn-zoom-fit:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.zoom-level-text {
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-secondary);
  min-width: 48px;
  text-align: center;
}

/* Espacio infinito de trabajo */
.stage-viewport {
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 2rem;
  position: relative;
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Overlay de soltar imagen */
.drop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 13, 19, 0.85);
  backdrop-filter: blur(8px);
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.drop-overlay.active {
  display: flex;
}

.drop-overlay-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: var(--accent-primary);
  border: 2px dashed var(--accent-primary);
  border-radius: var(--radius-lg);
  padding: 3rem 4rem;
  background: rgba(99, 102, 241, 0.08);
}

.drop-overlay-box p {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
}

/* ============================================================
   LIENZO EXPORTABLE (THE CANVAS ELEMENT)
   ============================================================ */
.mockup-canvas {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: width 0.2s ease, height 0.2s ease, transform 0.1s ease;
  overflow: hidden;
  transform-origin: center center;
  flex-shrink: 0;
}

/* Capas del lienzo */
.canvas-background-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  transition: background 0.3s ease;
}

.canvas-pattern-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  pointer-events: none;
}

/* Patrones decorativos */
.pattern-dots {
  background-image: radial-gradient(rgba(255, 255, 255, 0.18) 1.5px, transparent 1.5px);
  background-size: 20px 20px;
}

.pattern-grid {
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
}

.pattern-grain {
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, rgba(0, 0, 0, 0.05) 1px);
  background-size: 4px 4px;
}

/* Textos integrados en el mockup */
.canvas-text-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  padding: 1.5rem 2rem;
  text-align: center;
}

.text-pos-top {
  margin-bottom: auto;
}

.text-pos-bottom {
  margin-top: auto;
}

.mockup-heading {
  font-size: 2rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.4rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.mockup-subheading {
  font-size: 1.05rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.4;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}

/* Contenedor del dispositivo */
.canvas-device-wrapper {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  perspective: 1200px;
}

.device-chassis {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out;
}

/* Toast de feedback */
.feedback-toast {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  opacity: 0;
  background: rgba(18, 21, 30, 0.95);
  backdrop-filter: blur(12px);
  color: #ffffff;
  border: 1px solid var(--accent-success);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(16, 185, 129, 0.3);
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  pointer-events: none;
}

.feedback-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-icon-check {
  color: #34d399;
}

/* Barra de pestañas móvil */
.mobile-tabs-bar {
  display: none;
}

/* ============================================================
   RESPONSIVE DESIGN (MÓVIL Y TABLET)
   ============================================================ */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 320px;
  }
  
  .brand-text p {
    display: none;
  }
}

@media (max-width: 768px) {
  html, body {
    overflow: auto;
  }

  .app-header {
    height: auto;
    padding: 0.6rem 0;
  }

  .header-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    padding: 0 0.75rem;
  }

  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .resolution-selector-wrapper {
    display: none;
  }

  .mobile-tabs-bar {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 90;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.35rem 0.75rem;
    gap: 0.5rem;
  }

  .mobile-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: 38px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
  }

  .mobile-tab-btn.active {
    background: var(--accent-primary);
    color: #ffffff;
    border-color: var(--accent-primary);
  }

  .studio-main-layout {
    flex-direction: column;
    height: auto;
  }

  .sidebar-editor {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }

  .sidebar-editor.tab-hidden {
    display: none;
  }

  .stage-container {
    height: 70vh;
  }

  .stage-container.tab-hidden {
    display: none;
  }
}
