/* ==========================================================================
   MUDIC - Museo Didáctico e Interactivo de Ciencias
   Design System & Modern Science Museum UI Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;700&display=swap');

:root {
  /* Color Palette - Logo Original MUDIC (Fondo Blanco, Morado #5a2077 y Naranja #ff6e0d) */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fc;
  --bg-tertiary: #f1f3f9;
  --bg-glass: rgba(255, 255, 255, 0.92);
  --bg-glass-card: #ffffff;
  --bg-glass-hover: #faf8fc;

  /* Brand Accents */
  --brand-purple: #5a2077;
  --brand-orange: #ff6e0d;
  --accent-purple: #5a2077;
  --accent-purple-dark: #43145a;
  --accent-purple-light: #7b319f;
  --accent-orange: #ff6e0d;
  --accent-orange-dark: #e05a00;
  --accent-orange-light: #ff8533;
  --accent-cyan: #5a2077; /* Aliased for compatibility to brand purple */
  --accent-blue: #ff6e0d; /* Aliased for compatibility to brand orange */
  --accent-emerald: #10b981;
  --accent-amber: #ff6e0d;
  --accent-rose: #e11d48;

  /* Gradients */
  --gradient-quantum: linear-gradient(135deg, #5a2077 0%, #ff6e0d 100%);
  --gradient-brand: linear-gradient(135deg, #5a2077 0%, #ff6e0d 100%);
  --gradient-purple: linear-gradient(135deg, #5a2077 0%, #7b319f 100%);
  --gradient-orange: linear-gradient(135deg, #ff6e0d 0%, #ff8e3d 100%);
  --gradient-darwin: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-curie: linear-gradient(135deg, #5a2077 0%, #7b319f 100%);
  --gradient-newton: linear-gradient(135deg, #5a2077 0%, #ff6e0d 100%);
  --gradient-einstein: linear-gradient(135deg, #ff6e0d 0%, #d95a00 100%);
  --gradient-dark-surface: linear-gradient(180deg, #ffffff 0%, #f8f9fc 100%);

  /* Text Colors */
  --text-main: #1e1b26;
  --text-muted: #524f5d;
  --text-dim: #767283;
  --text-highlight: #5a2077;

  /* Borders & Shadows */
  --border-subtle: rgba(90, 32, 119, 0.12);
  --border-focus: #ff6e0d;
  --glow-cyan: 0 0 20px rgba(90, 32, 119, 0.2);
  --glow-purple: 0 0 20px rgba(90, 32, 119, 0.25);
  --glow-orange: 0 0 20px rgba(255, 110, 13, 0.3);
  --shadow-card: 0 6px 24px -4px rgba(90, 32, 119, 0.08), 0 2px 8px -2px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 16px 36px -6px rgba(90, 32, 119, 0.16), 0 4px 12px -2px rgba(255, 110, 13, 0.12);

  /* Typography */
  --font-display: 'Space Grotesk', -apple-system, sans-serif;
  --font-heading: 'Outfit', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.65;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Canvas Particle Container */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

.page-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

/* Typography styles */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-main);
  line-height: 1.25;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
}

p {
  color: var(--text-muted);
}

.font-mono {
  font-family: var(--font-display);
}

/* Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-narrow {
  max-width: 960px;
}

.container-fluid {
  max-width: 1440px;
}

/* Grid System */
.grid {
  display: grid;
  gap: 2rem;
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--brand-purple);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  transition: all var(--transition-normal);
}

.site-header.scrolled {
  background: #471561;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  max-width: 1440px;
  flex-wrap: nowrap;
}

/* Logo */
.brand-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.brand-logo-box {
  background: #ffffff;
  padding: 6px 14px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  transition: transform var(--transition-bounce), box-shadow var(--transition-fast);
}

.brand-logo:hover .brand-logo-box {
  transform: scale(1.05);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.brand-logo-img {
  height: 44px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  display: block;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--gradient-quantum);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.4rem;
  box-shadow: 0 4px 15px rgba(90, 32, 119, 0.25);
  transition: transform var(--transition-bounce);
}

.brand-logo:hover .brand-icon {
  transform: rotate(18deg) scale(1.08);
}

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

.brand-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #ffffff;
  line-height: 1;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  margin-top: 3px;
}

/* Navigation Links & Dropdowns */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.18rem;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.nav-item {
  position: relative;
  flex-shrink: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.45rem 0.52rem;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 8px;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.nav-link:hover,
.nav-item.active > .nav-link {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
}

.nav-link i.fa-chevron-down {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.75);
  transition: transform var(--transition-fast);
}

.nav-item:hover .nav-link i.fa-chevron-down {
  transform: rotate(180deg);
  color: #ffffff;
}

/* Mega & Sub Dropdown Menus */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 320px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.75rem;
  box-shadow: 0 12px 36px rgba(90, 32, 119, 0.15);
  backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--transition-normal);
  z-index: 110;
  white-space: normal;
}

.dropdown-menu.mega-menu {
  width: 620px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  white-space: normal;
}

.nav-item:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-item:hover .dropdown-menu.mega-menu {
  transform: translateX(-50%) translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.88rem;
  white-space: normal;
  transition: all var(--transition-fast);
}

.dropdown-item:hover {
  background: rgba(90, 32, 119, 0.06);
  color: var(--accent-purple);
  transform: translateX(4px);
}

.dropdown-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(90, 32, 119, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-purple);
  flex-shrink: 0;
  font-size: 0.95rem;
  margin-top: 2px;
}

.dropdown-item-content {
  flex: 1;
  min-width: 0;
  white-space: normal;
}

.dropdown-item-content h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
  white-space: normal;
  line-height: 1.3;
}

.dropdown-item-content p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
  white-space: normal;
  margin: 0;
}

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Mobile Toggle */
.menu-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  color: #ffffff;
  padding: 0.55rem 0.75rem;
  font-size: 1.15rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* ==========================================================================
   Buttons & Interactive Elements
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem 1.6rem;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--gradient-quantum);
  color: #fff;
  box-shadow: 0 4px 18px rgba(255, 110, 13, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 110, 13, 0.45);
  color: #fff;
}

.btn-secondary {
  background: #ffffff;
  color: var(--accent-purple);
  border: 1.5px solid rgba(90, 32, 119, 0.2);
  box-shadow: 0 2px 8px rgba(90, 32, 119, 0.05);
}

.btn-secondary:hover {
  background: #faf6fd;
  border-color: var(--accent-purple);
  color: var(--accent-purple);
  transform: translateY(-2px);
}

.btn-outline-cyan,
.btn-outline-purple {
  background: transparent;
  color: var(--accent-purple);
  border: 1.5px solid var(--accent-purple);
}

.btn-outline-cyan:hover,
.btn-outline-purple:hover {
  background: rgba(90, 32, 119, 0.08);
  color: var(--accent-purple);
  box-shadow: var(--glow-purple);
}

.btn-outline-orange {
  background: transparent;
  color: var(--accent-orange);
  border: 1.5px solid var(--accent-orange);
}

.btn-outline-orange:hover {
  background: rgba(255, 110, 13, 0.08);
  color: var(--accent-orange);
  box-shadow: var(--glow-orange);
}

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  border-radius: 6px;
}

.btn-lg {
  padding: 1rem 2.2rem;
  font-size: 1.1rem;
  border-radius: 12px;
}

/* Badges & Tags */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 20px;
  background: rgba(90, 32, 119, 0.08);
  color: var(--accent-purple);
  border: 1px solid rgba(90, 32, 119, 0.2);
}

.badge-purple {
  background: rgba(90, 32, 119, 0.1);
  color: var(--accent-purple);
  border-color: rgba(90, 32, 119, 0.25);
}

.badge-orange,
.badge-cyan {
  background: rgba(255, 110, 13, 0.1);
  color: var(--accent-orange);
  border-color: rgba(255, 110, 13, 0.25);
}

.badge-emerald {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.25);
}

.badge-amber {
  background: rgba(255, 110, 13, 0.1);
  color: var(--accent-orange);
  border-color: rgba(255, 110, 13, 0.25);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero-section {
  position: relative;
  padding: 5rem 0 6rem;
  overflow: hidden;
}

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

.hero-badge-container {
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero-title .text-gradient {
  background: var(--gradient-quantum);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2.2rem;
  max-width: 580px;
}

.hero-cta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}

.stat-item h3 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-purple);
  line-height: 1;
  margin-bottom: 0.3rem;
}

.stat-item p {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

/* Interactive Hero Simulator Card */
.hero-visual {
  position: relative;
}

.interactive-atom-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}

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

.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: #059669;
  font-weight: 700;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.4); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Science Mini Demo Canvas */
.atom-canvas-wrap {
  width: 100%;
  height: 240px;
  background: #f8f9fc;
  border-radius: 16px;
  border: 1px dashed rgba(90, 32, 119, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: crosshair;
}

.atom-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  border-radius: 16px;
}

.atom-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.2rem;
  gap: 0.8rem;
}

.atom-controls .sim-btn {
  flex: 1;
  padding: 0.5rem 0.8rem;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.atom-controls .sim-btn:hover,
.atom-controls .sim-btn.active {
  background: rgba(90, 32, 119, 0.08);
  border-color: var(--accent-purple);
  color: var(--accent-purple);
  font-weight: 600;
}

/* ==========================================================================
   Section Styles & Headers
   ========================================================================== */

.section {
  padding: 6rem 0;
  position: relative;
}

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

.section-header .badge {
  margin-bottom: 1rem;
}

.section-title {
  margin-bottom: 1rem;
}

/* ==========================================================================
   Page Hero Banner Full-Height & Full-Bleed to Right Edge of Screen
   ========================================================================== */

.page-hero-banner-section {
  padding: 0 !important;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
  position: relative;
  min-height: 440px;
  display: flex;
  align-items: center;
}

.page-hero-banner-section > .container {
  position: relative;
  z-index: 2;
  width: 100%;
}

.museo-header-grid,
.page-hero-grid {
  display: block;
}

.museo-header-content,
.page-hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3.5rem 1rem 3.5rem 0;
  max-width: 600px;
}

.museo-header-media-wrap,
.page-hero-media-wrap {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0 !important;
  left: 48%;
  width: 52% !important;
  height: 100% !important;
  min-height: 100% !important;
  display: flex;
  align-items: stretch;
  z-index: 1;
}

.museo-hero-fade-image,
.page-hero-fade-image {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  box-shadow: none;
  border-radius: 0;
  /* Máscara de degradado difuminada desde la izquierda */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.25) 14%, rgba(0, 0, 0, 0.88) 30%, black 50%);
  mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.25) 14%, rgba(0, 0, 0, 0.88) 30%, black 50%);
}

.museo-hero-img,
.page-hero-img {
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.museo-hero-gradient-overlay,
.page-hero-gradient-overlay {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 38%;
  height: 100%;
  background: linear-gradient(to right, var(--bg-secondary) 0%, transparent 100%);
  pointer-events: none;
}

@media (max-width: 991px) {
  .page-hero-banner-section {
    padding: 2.5rem 0 0 !important;
    display: flex;
    flex-direction: column;
    min-height: auto;
  }
  .page-hero-banner-section > .container {
    order: 1;
  }
  .museo-header-content,
  .page-hero-content {
    padding: 0 0 1.5rem 0;
    max-width: 100%;
  }
  .museo-header-media-wrap,
  .page-hero-media-wrap {
    position: relative !important;
    order: 2;
    top: auto;
    bottom: auto;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 300px !important;
    min-height: 300px !important;
  }
  .museo-hero-fade-image,
  .page-hero-fade-image {
    max-width: 100%;
    height: 100%;
    min-height: 100%;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.85) 18%, black 40%);
    mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.85) 18%, black 40%);
  }
  .museo-hero-gradient-overlay,
  .page-hero-gradient-overlay {
    width: 100%;
    height: 35%;
    background: linear-gradient(to bottom, var(--bg-secondary) 0%, transparent 100%);
  }
}

/* ==========================================================================
   Museum Rooms Cards Grid
   ========================================================================== */

.room-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 2.2rem;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
}

.room-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--room-color, var(--accent-purple));
  opacity: 0.9;
  transition: height var(--transition-fast);
}

.room-card:hover {
  transform: translateY(-8px);
  border-color: var(--room-color, var(--accent-purple));
  box-shadow: var(--shadow-hover);
}

.room-card:hover::before {
  height: 6px;
}

.room-icon-box {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(90, 32, 119, 0.06);
  border: 1px solid rgba(90, 32, 119, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--room-color, var(--accent-purple));
  margin-bottom: 1.5rem;
  transition: transform var(--transition-bounce);
}

.room-card:hover .room-icon-box {
  transform: scale(1.1) rotate(5deg);
  background: rgba(90, 32, 119, 0.12);
}

.room-title {
  font-size: 1.45rem;
  margin-bottom: 0.5rem;
}

.room-subtitle {
  font-size: 0.88rem;
  color: var(--accent-orange);
  font-weight: 600;
  margin-bottom: 1rem;
}

.room-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 1.8rem;
  line-height: 1.6;
}

.room-modules-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.8rem;
}

.module-pill {
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  background: rgba(90, 32, 119, 0.05);
  border: 1px solid rgba(90, 32, 119, 0.12);
  font-size: 0.76rem;
  color: var(--text-muted);
}

.room-module-item {
  background: #ffffff;
  border: 1px solid rgba(90, 32, 119, 0.12);
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
  transition: all var(--transition-fast);
}

.room-module-item:hover {
  border-color: var(--room-color, var(--accent-purple));
  background: rgba(90, 32, 119, 0.03);
  box-shadow: 0 2px 8px rgba(90, 32, 119, 0.08);
  transform: translateY(-1px);
}

.room-footer {
  margin-top: auto;
}

/* ==========================================================================
   Subvenciones & Relief Containers
   ========================================================================== */

.relief-card {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid rgba(90, 32, 119, 0.12);
  box-shadow: 
    0 2px 4px rgba(90, 32, 119, 0.04),
    0 8px 24px rgba(90, 32, 119, 0.08),
    0 20px 48px rgba(90, 32, 119, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  padding: 2.2rem;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.relief-card:hover {
  transform: translateY(-6px);
  box-shadow: 
    0 4px 8px rgba(90, 32, 119, 0.08),
    0 16px 36px rgba(90, 32, 119, 0.14),
    0 32px 64px rgba(90, 32, 119, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  border-color: rgba(90, 32, 119, 0.25);
}

.relief-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--card-accent, var(--gradient-brand));
  border-radius: 20px 20px 0 0;
}

.relief-frame {
  background: #ffffff;
  border: 1.5px solid rgba(90, 32, 119, 0.14);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 
    inset 0 2px 6px rgba(90, 32, 119, 0.08),
    inset 0 -1px 2px rgba(255, 255, 255, 0.8),
    0 6px 20px rgba(90, 32, 119, 0.08);
  margin-top: 1.5rem;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
  display: block;
  text-decoration: none;
}

.relief-frame:hover {
  box-shadow: 
    inset 0 2px 6px rgba(90, 32, 119, 0.12),
    0 10px 28px rgba(90, 32, 119, 0.14);
}

.relief-frame img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform var(--transition-fast);
}

.relief-card:hover .relief-frame img {
  transform: scale(1.01);
}

.relief-frame-overlay {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(90, 32, 119, 0.85);
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}

.relief-frame:hover .relief-frame-overlay {
  opacity: 1;
}

/* ==========================================================================
   STEAM ODS Grid & Filtering
   ========================================================================== */

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 3rem;
}

.filter-btn {
  padding: 0.6rem 1.2rem;
  border-radius: 30px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--accent-purple);
  color: #ffffff;
  border-color: var(--accent-purple);
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(90, 32, 119, 0.25);
}

.steam-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-normal);
  position: relative;
  box-shadow: var(--shadow-card);
}

.steam-card:hover {
  transform: translateY(-5px);
  border-color: var(--ods-color, var(--accent-orange));
  box-shadow: var(--shadow-hover);
}

.ods-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  color: #fff;
  background: var(--ods-color, #ff6e0d);
  margin-bottom: 1rem;
}

.steam-level {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ==========================================================================
   Interactive Visit Calculator & Planner
   ========================================================================== */

.visit-planner-container {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(20px);
}

.planner-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  position: relative;
}

.planner-step-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-dim);
}

.planner-step-item.active {
  color: var(--accent-purple);
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f3f9;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  color: var(--text-main);
}

.planner-step-item.active .step-number {
  background: var(--accent-purple);
  color: #ffffff;
  border-color: var(--accent-purple);
  box-shadow: var(--glow-purple);
}

.module-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.module-checkbox-card {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.2rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.module-checkbox-card:hover {
  background: #faf8fc;
  border-color: var(--accent-purple);
}

.module-checkbox-card.selected {
  background: rgba(90, 32, 119, 0.05);
  border-color: var(--accent-purple);
  box-shadow: 0 0 15px rgba(90, 32, 119, 0.12);
}

.module-checkbox-card input[type="checkbox"] {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  accent-color: var(--accent-orange);
  transform: scale(1.2);
}

/* ==========================================================================
   Virtual Science Lab / Experiments
   ========================================================================== */

.lab-container {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: var(--shadow-card);
}

.lab-sim-view {
  min-height: 380px;
  background: #f8f9fc;
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lab-controls-bar {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   News & Events Cards
   ========================================================================== */

.news-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  overflow: hidden;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
}

.news-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-purple);
  box-shadow: var(--shadow-hover);
}

.news-card-header {
  padding: 1.5rem 1.8rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.news-card-body {
  padding: 1.8rem;
  flex: 1;
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 0.8rem;
}

/* ==========================================================================
   Accordion / FAQs
   ========================================================================== */

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 6px rgba(90, 32, 119, 0.03);
}

.faq-item.active {
  border-color: var(--accent-purple);
  box-shadow: 0 4px 15px rgba(90, 32, 119, 0.08);
}

.faq-question {
  width: 100%;
  padding: 1.3rem 1.8rem;
  background: none;
  border: none;
  color: var(--text-main);
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.faq-icon {
  font-size: 0.9rem;
  color: var(--accent-orange);
  transition: transform var(--transition-fast);
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 1.8rem 1.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  display: none;
}

.faq-item.active .faq-answer {
  display: block;
}

/* ==========================================================================
   Forms & Contact
   ========================================================================== */

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.85rem 1.2rem;
  background: #ffffff;
  border: 1px solid rgba(90, 32, 119, 0.2);
  border-radius: 10px;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(90, 32, 119, 0.15);
  background: #ffffff;
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* Alert Boxes */
.alert {
  padding: 1rem 1.4rem;
  border-radius: 10px;
  font-size: 0.92rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.alert-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #047857;
}

.alert-danger {
  background: rgba(225, 29, 72, 0.1);
  border: 1px solid rgba(225, 29, 72, 0.3);
  color: #be123c;
}

/* ==========================================================================
   Footer & Sponsors
   ========================================================================== */

.site-footer {
  background: #f8f9fc;
  border-top: 1px solid var(--border-subtle);
  padding: 5rem 0 2rem;
  margin-top: auto;
  position: relative;
  z-index: 2;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 4rem;
}

.footer-brand p {
  margin-top: 1.2rem;
  font-size: 0.92rem;
  max-width: 320px;
  color: var(--text-muted);
}

.footer-heading {
  font-size: 1.05rem;
  color: var(--text-main);
  margin-bottom: 1.4rem;
  position: relative;
  padding-bottom: 0.5rem;
  font-weight: 700;
}

.footer-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent-orange);
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-links a:hover {
  color: var(--accent-orange);
  transform: translateX(4px);
}

.footer-sponsors {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2.5rem;
  text-align: center;
}

.sponsors-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.sponsors-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2.5rem;
}

.sponsor-badge {
  padding: 0.6rem 1.4rem;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  box-shadow: 0 2px 8px rgba(90, 32, 119, 0.04);
  transition: all var(--transition-fast);
}

.sponsor-badge:hover {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
  transform: translateY(-2px);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-dim);
  flex-wrap: wrap;
  gap: 1rem;
}

.social-links {
  display: flex;
  gap: 0.8rem;
}

.social-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(90, 32, 119, 0.08);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-purple);
  transition: all var(--transition-fast);
}

.social-btn:hover {
  background: var(--accent-orange);
  color: #ffffff;
  border-color: var(--accent-orange);
  transform: translateY(-3px);
  box-shadow: var(--glow-orange);
}

/* ==========================================================================
   Responsive Queries
   ========================================================================== */

@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .dropdown-menu.mega-menu {
    width: 480px;
  }
}

@media (max-width: 1180px) {
  .menu-toggle {
    display: block;
  }
  .nav-menu {
    position: fixed;
    top: 76px;
    left: 0;
    width: 100%;
    height: calc(100vh - 76px);
    background: #ffffff;
    border-right: 1px solid var(--border-subtle);
    box-shadow: 10px 0 30px rgba(90, 32, 119, 0.1);
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem 1.5rem;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    z-index: 99;
  }
  .nav-menu.open {
    transform: translateX(0);
  }
  .nav-item {
    width: 100%;
  }
  .nav-link {
    width: 100%;
    justify-content: space-between;
    padding: 0.85rem 0;
    font-size: 1.05rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-subtle);
    border-radius: 0;
  }
  .nav-link:hover,
  .nav-item.active > .nav-link {
    color: var(--brand-purple);
    background: rgba(90, 32, 119, 0.06);
  }
  .nav-link i.fa-chevron-down {
    color: var(--text-muted);
  }
  .dropdown-menu,
  .dropdown-menu.mega-menu {
    position: static;
    width: 100%;
    transform: none !important;
    opacity: 1;
    visibility: visible;
    display: none;
    background: #f8f9fc;
    margin-top: 0.5rem;
    grid-template-columns: 1fr;
    box-shadow: none;
  }
  .nav-item.open .dropdown-menu {
    display: block;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  .hero-stats {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .planner-steps {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

/* ==========================================================================
   OpenUs4All (Erasmus+) — banner, distintivos, tarjetas y financiación UE
   ========================================================================== */

.pending-marker {
  display: inline-block;
  background: #fff3cd;
  color: #7a4b00;
  border: 1px dashed #d99a00;
  border-radius: 6px;
  padding: 0.1rem 0.45rem;
  font-size: 0.85em;
  font-weight: 600;
}

.badge-ou4a {
  background: rgba(0, 51, 153, 0.08);
  color: #003399;
  border-color: rgba(0, 51, 153, 0.25);
  text-transform: none;
  letter-spacing: 0.02em;
}

.ou4a-logo-box {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem;
  color: #003399;
  font-size: 2.2rem;
}
.ou4a-logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }

.ou4a-banner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: linear-gradient(135deg, rgba(0, 51, 153, 0.06) 0%, rgba(90, 32, 119, 0.06) 100%);
  border: 1.5px solid rgba(0, 51, 153, 0.18);
  border-radius: 18px;
  padding: 1.6rem 2rem;
  margin-bottom: 3rem;
}
.ou4a-banner h3 { font-size: 1.25rem; margin-bottom: 0.4rem; color: var(--text-main); }
.ou4a-banner p { font-size: 0.95rem; color: var(--text-muted); line-height: 1.6; margin: 0; }
.ou4a-banner .eu-funding { margin-top: 1rem; }

.steam-card.is-ou4a { border-color: rgba(0, 51, 153, 0.22); }
.steam-card .ou4a-card-badge { margin: 0 0 0.6rem 0.4rem; vertical-align: top; }
.steam-card-actions { display: flex; flex-direction: column; gap: 0.6rem; }
.link-secondary {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-purple);
  text-align: center;
}
.link-secondary:hover { color: var(--accent-orange); }

.ou4a-project-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.6rem;
  box-shadow: var(--shadow-card);
  color: inherit;
  transition: all var(--transition-normal);
}
.ou4a-project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--project-color, var(--accent-orange)); }
.ou4a-project-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: #fff;
  background: var(--project-color, var(--accent-purple));
}
.ou4a-project-card h3 { font-size: 1.15rem; margin: 0.2rem 0 0; }
.ou4a-project-card p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.55; margin: 0; }
.ou4a-project-card .link-secondary { text-align: left; margin-top: auto; }

.ou4a-materials-list { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; gap: 1rem; }
.ou4a-materials-list li {
  display: flex; gap: 0.9rem; align-items: flex-start;
  background: #ffffff; border: 1px solid var(--border-subtle); border-radius: 14px; padding: 1.1rem 1.3rem;
  color: var(--text-muted); line-height: 1.6;
}
.ou4a-materials-list li i { color: var(--accent-purple); font-size: 1.15rem; margin-top: 0.2rem; width: 1.4rem; text-align: center; }
.ou4a-materials-list strong { color: var(--text-main); }

.ou4a-steps { counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; margin-bottom: 2rem; }
.ou4a-step { background: #ffffff; border: 1px solid var(--border-subtle); border-radius: 16px; padding: 1.5rem; position: relative; }
.ou4a-step::before {
  counter-increment: step; content: counter(step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gradient-brand); color: #fff; font-weight: 700; margin-bottom: 0.8rem;
}
.ou4a-step p { color: var(--text-muted); line-height: 1.6; margin: 0; }
.ou4a-step strong { color: var(--text-main); }

.ou4a-cta-row { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Bloque de financiación UE (obligatorio en página y noticia) */
.eu-funding {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.4rem 1.6rem;
}
.eu-funding-logo { height: 64px; width: auto; max-width: 100%; object-fit: contain; align-self: flex-start; }
.eu-funding p { font-size: 0.82rem; line-height: 1.55; color: var(--text-muted); margin: 0; }
.eu-funding.is-compact { padding: 0.9rem 1.1rem; flex-direction: row; align-items: center; gap: 1rem; flex-wrap: wrap; }
.eu-funding.is-compact .eu-funding-logo { height: 48px; }
.eu-funding.is-compact p { flex: 1 1 260px; font-size: 0.75rem; }

.footer-eu-logo { display: inline-flex; align-items: center; background: #fff; border-radius: 8px; padding: 0.35rem 0.6rem; border: 1px solid var(--border-subtle); }
.footer-eu-logo img { height: 36px; width: auto; }

.contact-extra-fields { display: none; }
.contact-extra-fields.is-visible { display: block; }

@media (max-width: 640px) {
  .ou4a-banner { flex-direction: column; align-items: flex-start; padding: 1.4rem; }
  .ou4a-logo-box { width: 72px; height: 72px; font-size: 1.7rem; }
  .eu-funding-logo { height: 52px; }
}
