/* ===================== VARIABLES ===================== */
:root {
  --azul:           #044559;
  --azul-dark:      #022e3b;
  --azul-mid:       #055a72;
  --amarillo:       #d9cb12;
  --amarillo-hover: #c4b810;
  --texto-claro:    #cdd5e8;
  --texto-muted:    #7a8fa8;
  --borde:          rgba(255,255,255,0.09);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Segoe UI', sans-serif; background: #fff; }

/* ===================== NAVBAR ===================== */
.navbar {
  background: var(--azul);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
  /* Necesario para anclar el mega-menú */
  overflow: visible;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-icon {
  height: 42px;
  width: auto;
  flex-shrink: 0;
  display: block;
}
.logo-text { display: none; }

.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  height: 100%;
  gap: 0;
  overflow: visible;
}
.nav-menu li { height: 100%; position: relative; }
/* El li del mega-menú necesita position static para que el menú ocupe todo el ancho */
.nav-menu li.has-mega { position: static; height: 100%; }
.nav-menu li a,
.nav-menu li button {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 100%;
  padding: 0 10px;
  color: var(--texto-claro);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.nav-menu li a:hover,
.nav-menu li button:hover { color: #fff; background: rgba(255,255,255,0.07); }
.nav-menu li.active > a { color: var(--amarillo); border-bottom: 2px solid var(--amarillo); }
.nav-menu li.has-mega.active > button { color: var(--amarillo); border-bottom: 2px solid var(--amarillo); }

.chevron { font-size: 9px; opacity: 0.6; transition: transform 0.2s; display: inline-block; }
.nav-menu li:hover .chevron { transform: rotate(180deg); }

/* Dropdown simple (por si queda alguno) */
.dropdown {
  display: none;
  position: absolute;
  top: 64px;
  left: 0;
  background: var(--azul);
  border-top: 2px solid var(--amarillo);
  min-width: 240px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  z-index: 200;
}
.nav-menu li:hover .dropdown { display: block; }
.dropdown a {
  display: block !important;
  height: auto !important;
  padding: 10px 18px !important;
  font-size: 12px !important;
  color: var(--texto-claro) !important;
  border-bottom: 0.5px solid rgba(255,255,255,0.06) !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-weight: 400 !important;
}
.dropdown a:hover { color: var(--amarillo) !important; background: rgba(255,255,255,0.05) !important; }

/* ===================== MEGA MENÚ ===================== */
.has-mega { position: static; height: 100%; }

.mega-menu {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--azul-dark);
  border-top: 2px solid var(--amarillo);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  z-index: 999;
  padding: 28px 48px;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
/* Mega menú controlado 100% por JS con inline styles */

.mega-col {
  padding: 0 28px;
  border-right: 1px solid rgba(255,255,255,0.07);
}
.mega-col:first-child { padding-left: 0; }
.mega-col:last-child { border-right: none; }

.mega-col-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--amarillo);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(217,203,18,0.25);
  display: flex;
  align-items: center;
  gap: 7px;
}
.mega-col-title i { font-size: 13px; }

.mega-col a {
  display: block !important;
  height: auto !important;
  padding: 6px 0 !important;
  font-size: 12.5px !important;
  color: var(--texto-claro) !important;
  border-bottom: none !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-weight: 400 !important;
  transition: color 0.15s, padding-left 0.15s !important;
  border-left: 2px solid transparent !important;
  background: none !important;
  white-space: normal !important;
  line-height: 1.4 !important;
}
.mega-col a:hover {
  color: var(--amarillo) !important;
  padding-left: 6px !important;
  border-left-color: var(--amarillo) !important;
  background: none !important;
}

.nav-cta {
  background: var(--amarillo) !important;
  color: var(--azul) !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  padding: 8px 14px !important;
  border-radius: 4px;
  height: auto !important;
  text-transform: uppercase !important;
  letter-spacing: 0.4px !important;
  margin-left: 8px;
  border: none !important;
}
.nav-cta:hover { background: var(--amarillo-hover) !important; }

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 26px;
  cursor: pointer;
}

/* ===================== HERO ===================== */
.hero {
  background: var(--azul);
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 420px;
  overflow: hidden;
}
.hero-left {
  padding: 52px 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 2;
}
.hero-title {
  font-size: 34px;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}
.hero-title .highlight { color: var(--amarillo); display: block; }
.hero-subtitle {
  font-size: 13.5px;
  color: #aab4cc;
  line-height: 1.6;
  margin-bottom: 28px;
  max-width: 360px;
}
.hero-buttons { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-primary {
  background: var(--amarillo);
  color: var(--azul);
  font-size: 12px;
  font-weight: 700;
  padding: 13px 22px;
  border-radius: 4px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--amarillo-hover); }

.btn-secondary {
  background: transparent;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 4px;
  border: 1.5px solid rgba(255,255,255,0.35);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.2s, background 0.2s;
}
.btn-secondary:hover { border-color: #fff; background: rgba(255,255,255,0.07); }

.hero-right {
  position: relative;
  overflow: hidden;
  min-height: 380px;
}
.hero-right img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.hero-right::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, var(--azul) 0%, transparent 40%);
  z-index: 1;
}
.hero-diagonal {
  position: absolute;
  top: 0; left: -30px;
  width: 70px; height: 100%;
  background: var(--azul);
  transform: skewX(-4deg);
  z-index: 2;
}
.hero-badge {
  position: absolute;
  bottom: 20px; right: 20px;
  background: var(--amarillo);
  color: var(--azul);
  font-size: 11px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 4px;
  z-index: 3;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.hero-features {
  grid-column: 1 / -1;
  background: var(--azul-dark);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--borde);
}
.feature-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  border-right: 1px solid var(--borde);
}
.feature-item:last-child { border-right: none; }
.feature-icon { font-size: 24px; color: var(--amarillo); flex-shrink: 0; }
.feature-text strong { display: block; font-size: 12px; font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: 0.3px; }
.feature-text span { font-size: 11px; color: var(--texto-muted); }

/* ===================== SECCIÓN GENÉRICA ===================== */
.section-title {
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  color: var(--azul);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}
.section-underline {
  width: 48px;
  height: 3px;
  background: var(--amarillo);
  margin: 0 auto 32px;
  border-radius: 2px;
}

/* ===================== QUÉ QUERÉS ESTUDIAR ===================== */
.section-estudiar { padding: 60px 48px; background: #fff; }

.tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
  border-radius: 6px;
  overflow: hidden;
  border: 1.5px solid #dde2ee;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
.tab-btn {
  padding: 11px 22px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
  background: #fff;
  color: var(--texto-muted);
  cursor: pointer;
  border-right: 1px solid #dde2ee;
  transition: background 0.2s, color 0.2s;
}
.tab-btn:last-child { border-right: none; }
.tab-btn:hover { background: #f0f4fa; color: var(--azul); }
.tab-btn.active { background: var(--azul); color: #fff; }

.tab-content { display: none; }
.tab-content.active { display: block; }

.grado-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.carrera-card {
  border: 1.5px solid #dde2ee;
  border-radius: 8px;
  padding: 24px;
  display: flex;
  gap: 18px;
  background: #fff;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.carrera-card:hover { border-color: var(--azul); box-shadow: 0 4px 16px rgba(4,69,89,0.1); }
.carrera-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: #e8f2f6;
  display: flex; align-items: center; justify-content: center;
  color: var(--azul); font-size: 22px; flex-shrink: 0;
}
.carrera-name { font-size: 13px; font-weight: 800; color: var(--azul); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 6px; line-height: 1.3; }
.carrera-desc { font-size: 12px; color: var(--texto-muted); line-height: 1.5; margin-bottom: 12px; }
.carrera-meta { display: flex; gap: 16px; margin-bottom: 14px; }
.meta-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--texto-muted); }
.meta-item i { font-size: 13px; color: #aab4cc; }
.carrera-link { font-size: 11.5px; font-weight: 700; color: var(--azul); text-decoration: none; text-transform: uppercase; letter-spacing: 0.4px; display: inline-flex; align-items: center; gap: 4px; }
.carrera-link:hover { color: var(--amarillo-hover); }

.tec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tec-card {
  border: 1.5px solid #dde2ee;
  border-radius: 8px;
  padding: 20px;
  display: flex; gap: 14px; align-items: flex-start;
  background: #fff;
  transition: box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
}
.tec-card:hover { border-color: var(--azul); box-shadow: 0 4px 16px rgba(4,69,89,0.1); }
.tec-icon { width: 40px; height: 40px; border-radius: 50%; background: #e8f2f6; display: flex; align-items: center; justify-content: center; color: var(--azul); font-size: 18px; flex-shrink: 0; }
.tec-name { font-size: 12px; font-weight: 800; color: var(--azul); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 8px; line-height: 1.3; }

.cursos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.curso-card {
  border: 1.5px solid #dde2ee;
  border-radius: 8px;
  padding: 20px;
  background: #fff;
  transition: box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
}
.curso-card:hover { border-color: var(--azul); box-shadow: 0 4px 16px rgba(4,69,89,0.1); }
.curso-badge { display: inline-block; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; padding: 3px 10px; border-radius: 3px; margin-bottom: 10px; }
.badge-diplomatura { background: #e0f0f6; color: #044559; }
.badge-curso { background: #e8f8f2; color: #0e6655; }
.badge-taller { background: #fdf6d0; color: #7a6900; }
.curso-icon { font-size: 28px; margin-bottom: 10px; display: block; color: var(--azul); }
.curso-name { font-size: 12.5px; font-weight: 700; color: var(--azul); line-height: 1.4; margin-bottom: 8px; }
.curso-modalidad { font-size: 10.5px; color: var(--texto-muted); text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600; }

/* ===================== ESTUDIÁ A TU MANERA ===================== */
.section-etm { background: var(--azul); padding: 60px 48px; }
.etm-title {
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.etm-underline { width: 48px; height: 3px; background: var(--amarillo); margin: 0 auto 44px; border-radius: 2px; }
.etm-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.etm-item {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 32px 28px;
  border-right: 1px solid var(--borde);
  transition: background 0.2s;
}
.etm-item:last-child { border-right: none; }
.etm-item:hover { background: rgba(255,255,255,0.04); }
.etm-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 2px solid var(--amarillo);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
  color: var(--amarillo);
  font-size: 26px;
  transition: background 0.2s, color 0.2s;
}
.etm-item:hover .etm-icon { background: var(--amarillo); color: var(--azul); }
.etm-label { font-size: 15px; font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.etm-desc { font-size: 12.5px; color: var(--texto-muted); line-height: 1.6; max-width: 180px; }

/* ===================== FOOTER ===================== */
.footer { background: var(--azul-dark); padding: 52px 48px 0; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.4fr 1.4fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--borde);
}
.footer-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; text-decoration: none; }
.footer-logo-icon { height: 38px; width: auto; display: block; flex-shrink: 0; }
.footer-logo-text { display: none; }
.footer-tagline { font-size: 12px; color: var(--texto-muted); line-height: 1.6; max-width: 240px; margin-bottom: 20px; }

.footer-social { display: flex; gap: 10px; }
.social-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.15); display: flex; align-items: center; justify-content: center; color: var(--texto-muted); text-decoration: none; font-size: 15px; transition: border-color 0.2s, color 0.2s; }
.social-btn:hover { border-color: var(--amarillo); color: var(--amarillo); }

.footer-col-title { font-size: 11px; font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--amarillo); display: inline-block; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: 12.5px; color: var(--texto-muted); text-decoration: none; transition: color 0.2s; display: flex; align-items: center; gap: 6px; }
.footer-links a:hover { color: var(--amarillo); }
.footer-links a i { font-size: 13px; }

.contact-item { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 13px; }
.contact-item i { font-size: 15px; color: var(--amarillo); margin-top: 1px; flex-shrink: 0; }
.contact-item span { font-size: 12px; color: var(--texto-muted); line-height: 1.5; }
.contact-item a { color: var(--texto-muted); text-decoration: none; transition: color 0.2s; }
.contact-item a:hover { color: var(--amarillo); }

.horario-item { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 0.5px solid rgba(255,255,255,0.05); font-size: 12px; }
.horario-item:last-child { border-bottom: none; }
.horario-item span:first-child { color: var(--texto-muted); }
.horario-item span:last-child { color: #fff; font-weight: 600; }

.footer-bottom { padding: 18px 0; display: flex; justify-content: space-between; align-items: center; }
.footer-bottom p { font-size: 11.5px; color: #3a5060; }
.footer-bottom a { color: #3a5060; text-decoration: none; transition: color 0.2s; }
.footer-bottom a:hover { color: var(--amarillo); }

/* ===================== PÁGINA INTERNA — HERO SIMPLE ===================== */
.page-hero {
  background: var(--azul);
  padding: 52px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.page-hero .breadcrumb {
  font-size: 12px;
  color: var(--texto-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.page-hero .breadcrumb a { color: var(--texto-muted); text-decoration: none; transition: color 0.2s; }
.page-hero .breadcrumb a:hover { color: var(--amarillo); }
.page-hero h1 {
  font-size: 36px;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 12px;
  max-width: 700px;
}
.page-hero h1 span { color: var(--amarillo); }
.page-hero p {
  font-size: 14px;
  color: #aab4cc;
  line-height: 1.7;
  max-width: 580px;
}

/* ===================== PÁGINA INTERNA — CONTENIDO ===================== */
.page-content { padding: 56px 48px; max-width: 1100px; margin: 0 auto; }
.page-content h2 { font-size: 22px; font-weight: 800; color: var(--azul); margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid var(--amarillo); display: inline-block; }
.page-content p { font-size: 14px; color: #444; line-height: 1.8; margin-bottom: 16px; }
.page-content ul { margin: 0 0 20px 20px; }
.page-content ul li { font-size: 14px; color: #444; line-height: 1.8; margin-bottom: 6px; }

.info-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 48px;
  align-items: start;
}
.info-sidebar {
  background: #f4f8fa;
  border-radius: 10px;
  padding: 28px;
  border-left: 4px solid var(--amarillo);
}
.info-sidebar h3 { font-size: 14px; font-weight: 700; color: var(--azul); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 16px; }
.info-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 0.5px solid #dde2ee; font-size: 13px; }
.info-row:last-child { border-bottom: none; }
.info-row span:first-child { color: var(--texto-muted); }
.info-row span:last-child { color: var(--azul); font-weight: 700; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  .nav-menu { display: none; }
  .nav-hamburger { display: block; }
  .nav-menu.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--azul);
    padding: 16px 0;
    height: auto;
    z-index: 999;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    overflow-y: auto;
    max-height: calc(100vh - 64px);
  }
  .nav-menu.open li { height: auto; }
  .nav-menu.open li a,
  .nav-menu.open li button { height: auto; padding: 10px 20px; font-size: 13px; }
  .nav-menu.open .dropdown { position: static; box-shadow: none; border-top: none; padding-left: 16px; }
  /* Mega menú mobile: controlado por JS */
  .nav-menu.open .mega-menu {
    flex-direction: column;
    position: static;
    padding: 8px 0 8px 20px;
    border-top: none;
    box-shadow: none;
    gap: 0;
  }
  .nav-menu.open .mega-col {
    padding: 8px 0;
    border-right: none;
    border-bottom: 0.5px solid rgba(255,255,255,0.07);
  }
  .nav-menu.open .mega-col:last-child { border-bottom: none; }
  .nav-menu.open .mega-col a { padding: 6px 0 !important; font-size: 12px !important; }
  /* hover manejado por JS */

  .hero { grid-template-columns: 1fr; }
  .hero-right { display: none; }
  .hero-left { padding: 40px 24px; }
  .hero-title { font-size: 26px; }
  .hero-features { grid-template-columns: repeat(2, 1fr); }

  .section-estudiar { padding: 40px 20px; }
  .grado-grid, .tec-grid, .cursos-grid { grid-template-columns: 1fr; }
  .tabs { flex-wrap: wrap; }

  .section-etm { padding: 40px 20px; }
  .etm-grid { grid-template-columns: repeat(2, 1fr); }

  .footer { padding: 40px 20px 0; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }

  .page-hero { padding: 36px 20px; }
  .page-hero h1 { font-size: 26px; }
  .page-content { padding: 36px 20px; }
  .info-grid { grid-template-columns: 1fr; }
}
