/* ==========================================================================
   PLATAFORMA LABORATORIO MATEMÁTICO — ESTILOS GLOBALES
   Identidad visual: Verde matemático profundo, blanco limpio, crema suave,
   cubo matemático 3D interactivo y diseño responsive sobrio y profesional.
   ========================================================================== */

:root {
  /* Paleta cromática matemática enriquecida */
  --bg-main: #FFFFFF;
  --bg-surface: #FCFDFB;
  --bg-subtle: #F2F7F4;       /* Crema muy suave con tinte vegetal */
  --bg-cream: #FAF9F5;        /* Superficie cálida tenue */
  --bg-muted: #E6EFE9;
  
  /* Verdes rectores de la plataforma */
  --green-deep: #163B2B;       /* Verde bosque profundo */
  --green-primary: #215A41;    /* Verde medio académico */
  --green-medium: #388463;     /* Verde secundario balanceado */
  --green-light: #E8F5EE;      /* Fondo suave verde */
  --green-border: #C2DFCF;     /* Borde verde sutil */
  
  /* Textos */
  --text-primary: #15221B;     /* Grafito vegetal muy oscuro */
  --text-secondary: #3B4D43;   /* Gris medio académico */
  --text-tertiary: #5E7267;    /* Gris atenuado legible */
  --text-subtle: #8FA297;

  /* Bordes */
  --border-light: #E1EBE4;
  --border-strong: #C9D9CE;
  
  /* Acentos de identidad de laboratorios */
  --accent-forest: #215A41;    /* Jardín / Botánica */
  --accent-fountain: #0284C7;  /* Parábolas / Agua */
  --accent-kraft: #8A5A36;     /* Taller de Cajas */
  --accent-algebra: #0F766E;   /* Operaciones / Álgebra */
  --accent-amber: #D97706;     /* Acento dorado/cálido métrico */

  /* Tipografías */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: 'Newsreader', Georgia, Cambria, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Elevaciones sutiles */
  --shadow-sm: 0 1px 2px rgba(22, 59, 43, 0.05);
  --shadow-md: 0 4px 14px rgba(22, 59, 43, 0.08), 0 1px 3px rgba(22, 59, 43, 0.04);
  --shadow-lg: 0 14px 34px rgba(22, 59, 43, 0.1), 0 2px 6px rgba(22, 59, 43, 0.05);

  --header-height: 64px;
}

/* Reset y base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Selección de texto */
::selection {
  background-color: #C8E6C9;
  color: #163B2B;
}

/* ==========================================================================
   NAVEGACIÓN GLOBAL SUPERIOR
   ========================================================================== */
.global-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transition: all 0.25s ease;
}

.header-container {
  max-width: 1240px;
  margin: 0 auto;
  height: 100%;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* Logo de la plataforma */
.brand-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--green-deep);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.brand-link:hover {
  opacity: 0.85;
}

.brand-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: var(--green-light);
  border: 1px solid var(--green-border);
  border-radius: 9px;
  font-size: 1.15rem;
  box-shadow: var(--shadow-sm);
}

.brand-name {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--green-deep);
}

.brand-badge {
  font-size: 0.68rem;
  color: var(--green-medium);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Enlaces del Header */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
  background: none;
  border: 1px solid transparent;
}

.nav-link:hover {
  color: var(--green-deep);
  background-color: var(--bg-subtle);
  border-color: var(--border-light);
}

.nav-link.active {
  color: var(--green-deep);
  background-color: var(--green-light);
  border-color: var(--green-border);
  font-weight: 750;
}

.nav-btn-teacher {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--green-deep);
  background-color: var(--green-light);
  border: 1px solid var(--green-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn-teacher:hover {
  background-color: #DCEDE3;
  transform: translateY(-1px);
}

/* ==========================================================================
   BARRA DE CONTEXTO DENTRO DE UN SIMULADOR (ACTIVE SIMULATOR BAR)
   ========================================================================== */
.simulator-context-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.simulator-context-bar.active {
  display: flex;
}

.btn-back-platform {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  font-size: 0.88rem;
  font-weight: 750;
  color: var(--green-deep);
  background-color: var(--bg-surface);
  border: 1px solid var(--green-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn-back-platform:hover {
  background-color: var(--green-light);
  border-color: var(--green-primary);
  transform: translateX(-2px);
}

.simulator-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.breadcrumb-item {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}

.breadcrumb-item:hover {
  color: var(--green-primary);
}

.breadcrumb-separator {
  color: var(--text-subtle);
  font-size: 0.75rem;
}

.breadcrumb-current {
  color: var(--green-deep);
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Controles del simulador en header */
.simulator-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   VISTA DE LA PLATAFORMA (HERO + SIMULADORES)
   ========================================================================== */
#platform-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  transition: opacity 0.3s ease;
}

#platform-view.hidden {
  display: none;
}

/* Hero Principal con atmósfera sutil verde y crema */
.hero-section {
  position: relative;
  padding: 4.5rem 1.5rem 3.5rem;
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
  background: radial-gradient(circle at 82% 38%, rgba(33, 90, 65, 0.08) 0%, rgba(242, 247, 244, 0.5) 45%, transparent 72%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  align-items: center;
  gap: 3.5rem;
}

@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.38rem 0.95rem;
  background-color: var(--green-light);
  border: 1px solid var(--green-border);
  border-radius: 9999px;
  width: fit-content;
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green-deep);
}

.hero-badge-dot {
  width: 8px;
  height: 8px;
  background-color: var(--green-primary);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(33, 90, 65, 0.2);
}

.hero-title {
  font-size: clamp(2.3rem, 4.8vw, 3.8rem);
  font-weight: 850;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--green-deep);
}

.hero-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.25rem, 2.2vw, 1.68rem);
  line-height: 1.35;
  color: var(--green-primary);
  letter-spacing: -0.01em;
}

.hero-desc {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 540px;
}

/* Botones principales de acción */
.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.75rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.88rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 750;
  letter-spacing: 0.03em;
  color: #FFFFFF;
  background-color: var(--green-deep);
  border: 1px solid var(--green-deep);
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(22, 59, 43, 0.2);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover {
  background-color: var(--green-primary);
  border-color: var(--green-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.88rem 1.55rem;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--green-deep);
  background-color: var(--bg-surface);
  border: 1px solid var(--green-border);
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background-color: var(--bg-subtle);
  border-color: var(--green-primary);
  transform: translateY(-1px);
}

/* ==========================================================================
   CUBO MATEMÁTICO 3D INTERACTIVO
   ========================================================================== */
.math-space-container {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cube-interactive-wrapper {
  width: 100%;
  background: radial-gradient(circle at 50% 45%, #FFFFFF 35%, var(--bg-subtle) 100%);
  border: 1.5px solid var(--green-border);
  border-radius: 26px;
  padding: 1.75rem 1.5rem 1.25rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: none;
  cursor: grab;
}

.cube-interactive-wrapper.grabbing {
  cursor: grabbing;
}

/* Escena con perspectiva 3D */
.cube-scene {
  perspective: 950px;
  width: 250px;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.cube-object {
  width: 190px;
  height: 190px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.04s linear;
}

.cube-object.animating-to-face {
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Caras del cubo */
.cube-face {
  width: 190px;
  height: 190px;
  position: absolute;
  border: 1.5px solid var(--green-primary);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 8px 24px rgba(22, 59, 43, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.cube-face:hover {
  border-color: var(--green-deep);
  box-shadow: 0 0 0 2px rgba(33, 90, 65, 0.25), 0 12px 28px rgba(22, 59, 43, 0.15);
}

.cube-face.active-face {
  border-color: var(--green-deep);
  background-color: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(33, 90, 65, 0.3), 0 12px 28px rgba(22, 59, 43, 0.16);
}

/* Transformaciones espaciales para las 6 caras (ancho 190px -> translateZ 95px) */
.face-front  { transform: rotateY(0deg) translateZ(95px); }
.face-right  { transform: rotateY(90deg) translateZ(95px); }
.face-back   { transform: rotateY(180deg) translateZ(95px); }
.face-left   { transform: rotateY(-90deg) translateZ(95px); }
.face-top    { transform: rotateX(90deg) translateZ(95px); }
.face-bottom { transform: rotateX(-90deg) translateZ(95px); }

/* Estructura interna de cada cara */
.face-badge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--green-deep);
  text-transform: uppercase;
  background-color: var(--green-light);
  border: 1px solid var(--green-border);
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  width: fit-content;
}

.face-badge-dot {
  width: 5px;
  height: 5px;
  background-color: var(--green-primary);
  border-radius: 50%;
}

.face-visual {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem;
}

.face-svg {
  width: 100%;
  height: 100%;
  max-height: 110px;
}

.face-footer {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-align: center;
  letter-spacing: 0.04em;
  padding-top: 0.2rem;
  border-top: 1px solid var(--border-light);
}

/* Panel contextual inferior de la cara */
.cube-info-panel {
  width: 100%;
  background-color: #FFFFFF;
  border: 1px solid var(--green-border);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  margin-top: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: all 0.25s ease;
}

.cube-info-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.cube-info-icon {
  font-size: 1.1rem;
}

.cube-info-title {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--green-deep);
}

.cube-info-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Barra de ayuda y alineación rápida */
.cube-controls-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.cube-drag-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--green-medium);
}

.cube-preset-dots {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.preset-dot {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.18rem 0.45rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-dot:hover {
  background-color: var(--green-light);
  border-color: var(--green-primary);
  color: var(--green-deep);
}

.preset-dot.active {
  background-color: var(--green-deep);
  border-color: var(--green-deep);
  color: #FFFFFF;
}

/* ==========================================================================
   SECCIÓN DE CATÁLOGO: EXPLORA LOS LABORATORIOS
   ========================================================================== */
.catalog-section {
  padding: 4.5rem 1.5rem 5rem;
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
  border-top: 1px solid var(--border-light);
  background: linear-gradient(180deg, var(--bg-main) 0%, var(--bg-subtle) 100%);
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 3.5rem;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--green-medium);
  margin-bottom: 0.5rem;
  display: block;
}

.section-title {
  font-size: clamp(1.8rem, 3.2vw, 2.4rem);
  font-weight: 850;
  letter-spacing: -0.03em;
  color: var(--green-deep);
  margin-bottom: 0.75rem;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Grid de tarjetas compactas */
.simulators-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
}

@media (max-width: 768px) {
  .simulators-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

/* Tarjeta individual */
.simulator-card {
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: 18px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.simulator-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--green-primary);
}

/* Barra superior de la tarjeta con número e insignia */
.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-num {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--green-deep);
  background-color: var(--green-light);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--green-border);
}

.card-tag {
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
}

/* Tags temáticos */
.tag-garden {
  background-color: #EAF3EC;
  color: #215A41;
  border: 1px solid #C8DEC9;
}

.tag-fountain {
  background-color: #E0F2FE;
  color: #0369A1;
  border: 1px solid #BAE6FD;
}

.tag-craft {
  background-color: #F7EFE8;
  color: #8A5A36;
  border: 1px solid #E4D0C2;
}

.tag-algebra {
  background-color: #E6F4F1;
  color: #0F766E;
  border: 1px solid #BCE3DC;
}

/* Representación gráfica compacta de cada simulador */
.card-preview-canvas {
  width: 100%;
  height: 120px;
  background-color: var(--bg-subtle);
  border-radius: 12px;
  border: 1px solid var(--border-light);
  margin-bottom: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Contenido de la tarjeta */
.card-body {
  margin-bottom: 1.5rem;
  flex: 1;
}

.card-title {
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--green-deep);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--green-primary);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Acciones de la tarjeta */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
}

.btn-open-lab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #FFFFFF;
  background-color: var(--green-deep);
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  box-shadow: 0 2px 4px rgba(22, 59, 43, 0.15);
}

.btn-open-lab:hover {
  background-color: var(--green-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-open-lab span {
  transition: transform 0.2s ease;
}

.btn-open-lab:hover span {
  transform: translateX(3px);
}

/* ==========================================================================
   CONTENEDOR PERSISTENTE DE SIMULADORES (ACTIVE VIEWPORT)
   ========================================================================== */
#simulator-viewport-container {
  display: none;
  flex: 1;
  width: 100%;
  height: calc(100vh - var(--header-height));
  position: relative;
  background-color: #FFFFFF;
}

#simulator-viewport-container.active {
  display: block;
}

.simulator-frame-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  border: none;
}

.simulator-frame-wrapper.active {
  display: block;
}

.simulator-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ==========================================================================
   FOOTER MINIMALISTA
   ========================================================================== */
.global-footer {
  border-top: 1px solid var(--border-light);
  background-color: var(--bg-subtle);
  padding: 2.5rem 1.5rem;
  margin-top: auto;
}

.footer-container {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--green-deep);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.footer-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--green-medium);
  font-weight: 600;
}

/* ==========================================================================
   MODALES: MODO PROFESOR & CONOCER LA PLATAFORMA
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(22, 59, 43, 0.4);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  max-width: 720px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 2.25rem;
  box-shadow: var(--shadow-lg);
  transform: translateY(12px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-light);
}

.modal-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.modal-title {
  font-size: 1.45rem;
  font-weight: 850;
  letter-spacing: -0.02em;
  color: var(--green-deep);
}

.modal-subtitle {
  font-size: 0.88rem;
  color: var(--text-tertiary);
}

.btn-close-modal {
  background: none;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-tertiary);
  font-size: 1.1rem;
  transition: all 0.15s ease;
}

.btn-close-modal:hover {
  background-color: var(--bg-subtle);
  color: var(--green-deep);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.teacher-lab-item {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.teacher-lab-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.teacher-lab-item-title {
  font-weight: 750;
  color: var(--green-deep);
  font-size: 1rem;
}

.btn-teacher-open {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 6px;
  background-color: var(--bg-surface);
  border: 1px solid var(--green-border);
  color: var(--green-deep);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-teacher-open:hover {
  background-color: var(--green-deep);
  color: #FFFFFF;
}

/* ==========================================================================
   OPTIMIZACIONES PARA PANTALLAS GRANDES Y MODO PROYECTOR
   ========================================================================== */
@media (min-width: 1400px) {
  .header-container,
  .hero-section,
  .catalog-section,
  .footer-container {
    max-width: 1360px;
  }

  .hero-title {
    font-size: 4rem;
  }
}

@media (max-width: 980px) {
  .hero-section {
    padding: 3rem 1.25rem 2.5rem;
  }

  .cube-scene {
    width: 220px;
    height: 220px;
  }

  .cube-object {
    width: 170px;
    height: 170px;
  }

  .cube-face {
    width: 170px;
    height: 170px;
    padding: 8px;
  }

  .face-front  { transform: rotateY(0deg) translateZ(85px); }
  .face-right  { transform: rotateY(90deg) translateZ(85px); }
  .face-back   { transform: rotateY(180deg) translateZ(85px); }
  .face-left   { transform: rotateY(-90deg) translateZ(85px); }
  .face-top    { transform: rotateX(90deg) translateZ(85px); }
  .face-bottom { transform: rotateX(-90deg) translateZ(85px); }
}

@media print {
  .global-header,
  .global-footer,
  .hero-actions {
    display: none;
  }
}
