/**
 * AETHER3D STUDIO — Hoja de Estilos UX/UI CAD Técnico, Neuromarketing y Galería Digital
 * Especialistas: Diseñador UX/UI, Especialista en Neuromarketing, Curador de Arte
 */

:root {
  --bg-deep: #090b10;
  --bg-panel: #11151f;
  --bg-card: #171c29;
  --bg-hover: #1f2637;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(56, 189, 248, 0.45);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --accent-cyan: #38bdf8;
  --accent-blue: #0284c7;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-purple: #a855f7;
  --danger: #ef4444;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-lg: 0 20px 45px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13.5px;
  line-height: 1.45;
  overflow-x: hidden;
}

/* TOPBAR NAVIGATION */
.topbar {
  height: 58px;
  background: rgba(17, 21, 31, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent-cyan), #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 16px;
  color: #06101e;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.35);
}

.brand-title {
  font-weight: 800;
  font-size: 15.5px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

/* TOOL SWITCHER TABS */
.tool-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-deep);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.tool-tab {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 7px 13px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
}

.tool-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.tool-tab.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(2, 132, 199, 0.28));
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.12);
}

/* TRUST & ACTION PILLS */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trust-pill {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.32);
  color: #34d399;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.trust-pill:hover {
  background: rgba(16, 185, 129, 0.22);
}

.top-btn {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.top-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.top-btn-pro {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(217, 119, 6, 0.28));
  border-color: rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}

/* MAIN 3-COLUMN WORKSPACE */
.studio-workspace {
  display: grid;
  grid-template-columns: 310px 1fr 340px;
  min-height: calc(100vh - 58px);
  border-bottom: 1px solid var(--border-subtle);
}

.panel-left,
.panel-right {
  background: var(--bg-panel);
  padding: 16px;
  overflow-y: auto;
  max-height: calc(100vh - 58px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-left {
  border-right: 1px solid var(--border-subtle);
}

.panel-right {
  border-left: 1px solid var(--border-subtle);
}

.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 13px;
}

.section-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* UPLOAD DROPZONE */
.dropzone {
  border: 1.5px dashed rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.04);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropzone:hover,
.dropzone.dragover {
  background: rgba(56, 189, 248, 0.1);
  border-color: var(--accent-cyan);
}

.dropzone-icon {
  font-size: 24px;
  margin-bottom: 6px;
}

.dropzone-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-main);
}

.dropzone-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* PRESET CHIPS */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.preset-btn {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 7px 6px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.preset-btn:hover,
.preset-btn.active {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
}

/* 2D HEIGHTMAP PREVIEW */
.preview-2d-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

#heightmapPreviewCanvas {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: #000;
  flex-shrink: 0;
}

.diag-list {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.diag-ok {
  color: #34d399;
  font-weight: 600;
}

/* CENTER VIEWPORT 3D */
.viewport-center {
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 42%, #1a2234 0%, #090b10 85%);
  position: relative;
  overflow: hidden;
}

.viewport-toolbar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 20;
  pointer-events: none;
}

.viewport-pill-group {
  display: flex;
  gap: 6px;
  background: rgba(17, 21, 31, 0.85);
  backdrop-filter: blur(10px);
  padding: 5px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  pointer-events: auto;
}

.vp-btn {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.vp-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.vp-btn.active {
  background: var(--accent-blue);
  color: #fff;
}

.vp-btn.backlight-on {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #fff;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.45);
}

#canvasContainer {
  flex: 1;
  width: 100%;
  min-height: 460px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 9:16 TIKTOK / REELS VERTICAL FRAME OVERLAY */
.social-frame-overlay {
  position: absolute;
  width: 290px;
  height: 515px;
  border: 2px dashed rgba(168, 85, 247, 0.75);
  border-radius: 16px;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(5, 7, 11, 0.55);
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
  z-index: 15;
}

.social-frame-overlay.visible {
  display: flex;
}

.social-frame-badge {
  background: rgba(168, 85, 247, 0.85);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  align-self: center;
}

/* LIVE METROLOGY & NON-INVASIVE SMART AFFILIATE BAR */
.metrology-bar {
  background: rgba(17, 21, 31, 0.95);
  border-top: 1px solid var(--border-subtle);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  z-index: 20;
}

.metric-items {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.metric-chip {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.metric-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.metric-val.highlight-price {
  color: var(--accent-emerald);
}

.smart-material-advisor {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(56, 189, 248, 0.07);
  border: 1px solid rgba(56, 189, 248, 0.22);
  padding: 6px 12px;
  border-radius: var(--radius-md);
}

.advisor-text {
  font-size: 11.5px;
  color: var(--text-muted);
}

.advisor-text strong {
  color: var(--accent-cyan);
}

.advisor-link {
  background: rgba(56, 189, 248, 0.16);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.advisor-link:hover {
  background: var(--accent-cyan);
  color: #06101e;
}

/* FORM CONTROLS & SLIDERS */
.control-group {
  margin-bottom: 11px;
}

.control-group:last-child {
  margin-bottom: 0;
}

.control-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
  color: var(--text-main);
  font-weight: 500;
}

.control-val {
  color: var(--accent-cyan);
  font-family: monospace;
  font-weight: 700;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent-cyan);
  cursor: pointer;
  height: 5px;
}

select,
input[type="text"],
input[type="number"] {
  width: 100%;
  background: var(--bg-panel);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  outline: none;
}

select:focus,
input[type="text"]:focus {
  border-color: var(--accent-cyan);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-main);
  cursor: pointer;
  margin-top: 6px;
}

/* PRIMARY & SECONDARY CTA BUTTONS */
.btn-primary-export {
  width: 100%;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #ffffff;
  border: none;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 22px rgba(14, 165, 233, 0.32);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.btn-primary-export:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(14, 165, 233, 0.45);
}

.export-sub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.btn-secondary-action {
  background: var(--bg-panel);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s;
}

.btn-secondary-action:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-pod-order {
  width: 100%;
  margin-top: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.38);
  color: #34d399;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s;
}

.btn-pod-order:hover {
  background: rgba(16, 185, 129, 0.22);
}

/* LOWER SECTIONS: GEO/SEO HUB, PRICING & LEGAL CENTER */
.below-fold-container {
  max-width: 1340px;
  margin: 0 auto;
  padding: 42px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.hub-header {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 24px;
}

.hub-header h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.hub-header p {
  color: var(--text-muted);
  font-size: 14px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.price-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.price-card.featured {
  border-color: var(--accent-amber);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, var(--bg-panel) 100%);
  box-shadow: 0 12px 32px rgba(245, 158, 11, 0.12);
}

.price-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  color: var(--accent-cyan);
  margin-bottom: 12px;
  align-self: flex-start;
}

.price-card.featured .price-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.price-amount {
  font-size: 26px;
  font-weight: 900;
  margin: 6px 0 2px;
}

.price-period {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.price-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.price-features li::before {
  content: "✔ ";
  color: var(--accent-emerald);
  font-weight: 700;
}

/* GEO TECHNICAL TABLE & LEGAL TABS */
.geo-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-panel);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.geo-table th,
.geo-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}

.geo-table th {
  background: var(--bg-card);
  color: var(--accent-cyan);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11.5px;
}

.legal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.legal-box {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
}

.legal-box h3 {
  font-size: 15px;
  margin: 8px 0;
  color: var(--text-main);
}

.legal-box p {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.legal-clauses {
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* MODALS (POST-DOWNLOAD, SOCIAL STUDIO, POD ORDER, B2B CLOSER) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 12, 0.78);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 250;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-window {
  background: var(--bg-panel);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 100%;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}

.code-copy-area {
  width: 100%;
  background: var(--bg-deep);
  color: #e5e7eb;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-family: monospace;
  font-size: 12px;
  resize: vertical;
  min-height: 110px;
}

@media (max-width: 1150px) {
  .studio-workspace {
    grid-template-columns: 1fr;
  }
  .panel-left,
  .panel-right {
    max-height: none;
  }
  .pricing-grid,
  .legal-grid {
    grid-template-columns: 1fr;
  }
}


/* AUDITOR DE CALIDAD DE IMAGEN & RESTAURADOR 3D */
.quality-audit-banner {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
  font-size: 11.5px;
}

.quality-audit-banner.warning {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.10);
}

.quality-audit-banner.low {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.12);
}

.quality-badge-title {
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.btn-enhance-magic {
  width: 100%;
  margin-top: 8px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: #fff;
  border: none;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
  transition: transform 0.15s;
}

.btn-enhance-magic:hover {
  transform: translateY(-1px);
}

/* ESTUDIO MULTICOLOR Y TABLA DE PAUSAS / SEPARACIÓN DE PIEZAS */
.color-palette-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 8px;
}

.color-layer-row {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.color-swatch-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.color-dot {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

.color-layer-meta {
  font-size: 11px;
  line-height: 1.3;
}

.color-layer-meta strong {
  color: var(--text-main);
  display: block;
}

.color-layer-meta span {
  color: var(--accent-cyan);
  font-size: 10.5px;
}

.btn-mini-stl {
  background: rgba(56, 189, 248, 0.14);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.btn-mini-stl:hover {
  background: var(--accent-cyan);
  color: #06101e;
}


/* ===== FASE 3: 6 pestañas de herramientas sin desbordar la barra superior ===== */
.tool-tabs {
  overflow-x: auto;
  max-width: 62vw;
  scrollbar-width: thin;
}

.tool-tab {
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 11.5px;
  padding: 7px 10px;
}
