
/* ======================================================================
   GRUPO SUPÉRATE — CSS unificado, mobile-first
   - Header fijo y estable en escritorio
   - Imagen de "Características" oculta en móvil
   - Rutas /media corregidas
   - Formulario y HTML validados
====================================================================== */

/* ==============================
   VARIABLES
============================== */
:root {
  /* Color */
  --primary: #3A09CD;
  --primary-rgb: 58 9 205;

  /* Superficies y texto */
  --bg-1: #ffffff;
  --surface-1: #f5f5f5;
  --surface-2: #1e1e1e;
  --text-1: #111111;
  --text-2: #555555;
  --muted: #e5e5e5;

  /* Componentes */
  --card-bg: #ffffff;
  --card-text: #222222;
  --card-border: #e5e5e5;

  /* Tipografía / radios */
  --font-base: 16px;
  --radius-1: 10px;
  --radius-2: 12px;

  /* Sombras y transiciones */
  --shadow-1: 0 2px 8px rgba(0,0,0,.08);
  --shadow-2: 0 8px 24px rgba(0,0,0,.12);
  --shadow-3: 0 12px 28px rgba(0,0,0,.18);
  --t-quick: 150ms;
  --t-base: 300ms;

  /* Tarjetas */
  --card-w-mobile: 437px;
  --card-h-min-mobile: 378px;
  --thumb-h-mobile: 210px;
  --body-h-min: 168px;

  /* Escritorio */
  --card-w-desktop: 375px;
  --card-h-min-desktop: 500px;
  --thumb-h-desktop: 238px;
  --grid-col-min: 260px;
  --grid-col-max: 375px;

  /* Altura del header en escritorio (coordinada con body padding-top) */
  --header-h-desktop: 96px;
}

/* Tema oscuro (manual si lo aplicas con data-theme="dark") */
:root[data-theme="dark"] {
  --bg-1: #0f1115;
  --surface-1: #14171d;
  --surface-2: #0b0d11;
  --text-1: #f1f1f3;
  --text-2: #c7c9cc;
  --muted: #2a2d34;
  --card-bg: #161a20;
  --card-text: #e8e9eb;
  --card-border: #2a2d34;
}

/* ======================================================================
   RESET & BASE
====================================================================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  overflow-x: hidden;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: var(--font-base);
  margin: 0;
  padding-top: 0;
  background-color: var(--bg-1);
  color: var(--text-1);
}
h1 { font-size: 2.2em; }
h2 { font-size: 2em; }
h3 { font-size: 1.4em; }
p, a, li { font-size: 1.1em; }
h1, h2, h3, p, a, li { word-wrap: break-word; overflow-wrap: break-word; }
.color-acento { color: #f00; }
.container { max-width: 1500px; margin: auto; padding: 0 15px; }

/* ======================================================================
   BOTONES
====================================================================== */
button {
  font-size: 1.3em;
  font-weight: bold;
  padding: 16px 32px;
  border-radius: var(--radius-1);
  border: 2px solid var(--primary);
  box-shadow: 2px 2px 10px rgba(0,0,0,0.5);
  color: #fff;
  background-color: var(--primary);
  transition: all var(--t-base) ease;
}
button:hover { background-color: rgba(58, 9, 205, 0.8); transform: translateY(-3px); }

/* ======================================================================
   HEADER
====================================================================== */
header {
  width: 100%;
  max-width: 100vw;
  background-color: var(--surface-1);
  box-shadow: var(--shadow-1);
  transition: box-shadow var(--t-quick) ease;
}
header .logo {
  margin: 0;
  padding: 10px 20px;
  font-weight: bold;
  color: var(--primary);
  font-size: 2em;
}
header .container { display: flex; flex-direction: column; align-items: center; }
header nav { display: flex; flex-direction: column; text-align: center; padding-bottom: 25px; }
header a { padding: 5px 20px; text-decoration: none; font-weight: bold; color: var(--text-1); transition: color var(--t-quick) ease; }
header a:hover { color: var(--primary); }

/* ======================================================================
   HERO
====================================================================== */
#hero {
  display: flex;
  flex-direction: column;
  justify-content: center; /* vertical */
  align-items: center;
  text-align: center;
  height: 50vh;
  color: #fff;
  padding: 0 15px;
  background-image:
    linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)),
    url(media/1.png);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
  background-attachment: scroll; /* móvil */
  transition: background var(--t-base) ease;
}
#hero h1 { font-size: 2.2em; line-height: 1.2; color: #fff; }
#hero h2 { font-size: 1.4em; line-height: 1.3; color: #fff; }
#hero .hero-btn {
  display: inline-block;
  font-size: 1.3em;
  font-weight: bold;
  padding: 16px 32px;
  border-radius: var(--radius-1);
  border: 2px solid var(--primary);
  color: #fff;
  background-color: var(--primary);
  text-decoration: none;
  box-shadow: 2px 2px 10px rgba(0,0,0,0.5);
  transition: all var(--t-base) ease;
  margin-top: 25px;
}

/* Subtítulo animado */
#hero .hero-sub {
  font-size: 3em;
  font-weight: bold;
  color: #fff;
  margin-top: 20px;
  position: relative;
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  animation: typing 3s steps(30, end) forwards;
}
@keyframes typing { from { width: 0; } to { width: 100%; } }

/* ======================================================================
   SOMOS GS
====================================================================== */
#somosgs .container { text-align: center; padding: 200px 12px; }

/* ======================================================================
   NUESTROS CURSOS
====================================================================== */
#nuestros-cursos {
  background-color: var(--surface-2);
  color: #fff;
  text-align: center;
  position: relative;
  z-index: 100;
}
#nuestros-cursos .container { padding: 60px 20px; overflow: visible; }
#nuestros-cursos h2 { margin-top: 0; font-size: 3.2em; }
#nuestros-cursos p { display: none; }

/* Tarjeta */
#nuestros-cursos .carta {
  position: relative;
  isolation: isolate;
  background: var(--card-bg);
  color: var(--card-text);
  border-radius: var(--radius-2);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-1);
  overflow: visible;
  width: 90%;
  max-width: var(--card-w-mobile);
  min-height: var(--card-h-min-mobile);
  margin: 5px;
  transition: transform var(--t-base) ease, box-shadow var(--t-base) ease;
  z-index: 1;
}
#nuestros-cursos .carta:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
#nuestros-cursos .carta:hover,
#nuestros-cursos .carta:focus-within { z-index: 3000; }

/* Miniatura */
#nuestros-cursos .course-thumb {
  background: var(--card-bg);
  padding: 16px 16px 12px;
  height: var(--thumb-h-mobile);
  display: flex;
  align-items: center;
  justify-content: center;
  border-top-left-radius: var(--radius-2);
  border-top-right-radius: var(--radius-2);
  overflow: hidden;
}
#nuestros-cursos .course-thumb img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: var(--thumb-h-mobile);
  object-fit: contain;
  display: block;
  border-radius: 10px;
  transition: transform var(--t-base) ease, filter var(--t-base) ease;
}
/* Zoom sutil */
#nuestros-cursos .carta:hover .course-thumb img { transform: scale(1.04); }

/* Cuerpo */
#nuestros-cursos .course-body { padding: 14px 16px; text-align: left; min-height: var(--body-h-min); }
#nuestros-cursos .course-title { margin: 0 0 6px; font-size: 1.05em; font-weight: 700; line-height: 1.25; color: var(--card-text); }
#nuestros-cursos .course-desc { margin: 0 0 10px; font-size: .95em; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#nuestros-cursos .course-meta { display: flex; justify-content: space-between; align-items: center; }
#nuestros-cursos .price { font-size: 1.05em; font-weight: 700; color: var(--card-text); }
#nuestros-cursos .badge { font-size: .8em; color: #444; background: #f2f2f2; border: 1px solid var(--muted); border-radius: 6px; padding: 3px 8px; }

/* Tooltip */
#nuestros-cursos .course-hover {
  position: absolute;
  z-index: 3100;
  background: var(--card-bg);
  color: var(--card-text);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: var(--shadow-3);
  padding: 16px 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  text-align: left;
  width: clamp(280px, 28vw, 340px);
  max-inline-size: calc(100vw - 40px);
  line-height: 1.35;
}
#nuestros-cursos .carta:hover .course-hover,
#nuestros-cursos .carta:focus-within .course-hover,
#nuestros-cursos .course-hover:hover { opacity: 1; pointer-events: auto; }

/* ======================================================================
   CARACTERÍSTICAS
====================================================================== */
#caracteristicas .container {
  text-align: center;
  padding: 200px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

/* En móvil NO mostramos la imagen */
#caracteristicas .img-container { display: none; }

/* Lista */
#caracteristicas ul { list-style: none; padding-left: 0; margin: 0; }
#caracteristicas li { margin: 15px 0; font-weight: bold; }

/* ======================================================================
   CONTACTO
====================================================================== */
#contacto { background-color: var(--surface-1); color: var(--text-1); padding: 70px 0; }
.contacto-container { display: flex; flex-direction: column; gap: 30px; }
.contacto-info { text-align: center; }
.contacto-form {
  background: var(--card-bg);
  padding: 30px;
  border-radius: 15px;
  box-shadow: var(--shadow-1);
  border: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.contacto-form input,
.contacto-form textarea {
  padding: 12px 15px;
  border-radius: 8px;
  border: 1px solid var(--muted);
  font-size: 1em;
  font-family: inherit;
  background: var(--bg-1);
  color: var(--text-1);
}
.contacto-form textarea { resize: none; height: 120px; }
.contacto-form button { align-self: flex-start; }

/* ======================================================================
   UBICACIÓN
====================================================================== */
#ubicacion { background-color: var(--surface-1); color: var(--text-1); padding: 60px 0; }
.ubicacion-container { display: flex; flex-direction: column; gap: 30px; }
.ubicacion-texto { text-align: center; }
.ubicacion-texto h2 { margin-top: 0; }
.ubicacion-texto ul { list-style: none; padding-left: 0; }
.ubicacion-texto li { margin: 10px 0; }
.ubicacion-mapa iframe { width: 100%; height: 350px; border: 0; }

/* ======================================================================
   REDES SOCIALES
====================================================================== */
#redes-sociales { background-color: var(--surface-2); color: #fff; padding: 50px 0; text-align: center; }
.redes-iconos { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; }
.redes-iconos a { width: 55px; height: 55px; background-color: #3a3a3a; border-radius: 50%; display: flex; justify-content: center; align-items: center; transition: transform var(--t-base) ease, background-color var(--t-base) ease, box-shadow var(--t-quick) ease; }
.redes-iconos a:hover { transform: translateY(-5px); background-color: #4a4a4a; box-shadow: var(--shadow-1); }
.redes-iconos img { width: 28px; height: 28px; }

/* ======================================================================
   FOOTER
====================================================================== */
footer { background-color: var(--surface-1); color: var(--text-2); }
footer p { margin: 0; }
footer .container { height: 150px; display: flex; justify-content: flex-end; align-items: flex-end; }

/* ======================================================================
   WHATSAPP FIJO
====================================================================== */
.whatsapp { position: fixed; right: 20px; bottom: 20px; z-index: 9999; }
.whatsapp img { width: 60.5px; height: 60.5px; }

/* ======================================================================
   ESCRITORIO (≥ 720px)
====================================================================== */
@media (min-width: 720px) {
  /* Header fijo y estable (no “baila”) */
  header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h-desktop);
    display: flex;
    align-items: center;
    z-index: 5000;
  }
  header .container { flex-direction: row; justify-content: space-between; min-height: var(--header-h-desktop); }
  header nav { flex-direction: row; padding-bottom: 0; padding-right: 20px; }

  /* Separación del contenido exacta a la altura del header */
  body { padding-top: var(--header-h-desktop); }

  /* HERO */
  #hero {
    height: 90vh;
    /* Si notas tirones al hacer scroll, comenta la siguiente línea */
    background-attachment: fixed;
    background-size: cover;
    background-position: center center;
  }
  #hero h1 { font-size: 3.5em; }

  /* SOMOS */
  #somosgs .container { display: flex; justify-content: space-evenly; gap: 20px; }
  #somosgs .texto {
    width: 50%;
    max-width: 600px;
    text-align: initial;
    padding-left: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  #somosgs .img-container {
    display: block;
    background-image: url("media/VISION.png"); /* ruta corregida */
    background-size: cover;
    background-position: center center;
    height: 500px;
    width: 400px;
    border-radius: 15px;
  }

  /* CURSOS en grid */
  #nuestros-cursos > .container {
    position: relative;
    overflow: visible;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(var(--grid-col-min), var(--grid-col-max)));
    justify-content: center;
    gap: 18px;
  }
  #nuestros-cursos p { display: block; margin-bottom: 30px; }
  #nuestros-cursos .carta {
    width: 100%;
    max-width: var(--card-w-desktop);
    min-height: var(--card-h-min-desktop);
    margin: 0;
  }
  #nuestros-cursos .course-thumb { height: var(--thumb-h-desktop); padding: 18px 18px 14px; }
  #nuestros-cursos .course-thumb img { height: var(--thumb-h-desktop); }

  /* Tooltip a la derecha por defecto; a la izquierda en borde derecho */
  #nuestros-cursos .course-hover { top: 50%; left: calc(100% + 12px); transform: translateY(-50%); }
  #nuestros-cursos .carta:nth-child(3n):hover .course-hover,
  #nuestros-cursos .carta:last-child:hover .course-hover {
    left: auto; right: calc(100% + 12px);
  }

  /* CARACTERÍSTICAS en escritorio: mostramos imagen */
  #caracteristicas .container { flex-direction: row-reverse; justify-content: space-evenly; align-items: center; padding: 100px 20px; }
  #caracteristicas .img-container {
    display: block;
    background-image: url("media/LOGO.png");
    background-size: cover;
    background-position: center center;
    width: 400px;
    height: 500px;
    border-radius: 15px;
  }
  #caracteristicas ul {
    width: 400px;
    max-width: 400px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  /* CONTACTO */
  .contacto-container { flex-direction: row; align-items: center; }
  .contacto-info { width: 45%; text-align: left; }
  .contacto-form { width: 55%; }

  /* UBICACIÓN */
  .ubicacion-container { flex-direction: row; align-items: center; }
  .ubicacion-texto { width: 45%; text-align: left; }
  .ubicacion-mapa { width: 55%; }
  .ubicacion-mapa iframe { height: 400px; }
}

/* ======================================================================
   Tooltip reorientado por columnas
====================================================================== */
@media (min-width: 1200px) {
  #nuestros-cursos .carta:nth-child(4n) .course-hover { left: auto; right: calc(100% + 12px); }
}
@media (min-width: 900px) and (max-width: 1199px) {
  #nuestros-cursos .carta:nth-child(3n) .course-hover { left: auto; right: calc(100% + 12px); }
}
@media (min-width: 720px) and (max-width: 899px) {
  #nuestros-cursos .carta:nth-child(2n) .course-hover { left: auto; right: calc(100% + 12px); }
}

/* ======================================================================
   Accesibilidad: reducir movimiento
====================================================================== */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ======================================================================
   AVAL MDT
====================================================================== */
#aval-mdt {
  position: relative;
  background: var(--surface-2);
  color: #fff;
  padding: 80px 0;
  background-image:
    radial-gradient(1200px 600px at 20% 0%, rgba(255,255,255,.06) 0%, rgba(255,255,255,0) 60%),
    radial-gradient(900px 450px at 80% 100%, rgba(255,255,255,.05) 0%, rgba(255,255,255,0) 55%);
}
#aval-mdt .aval-container { display: flex; flex-direction: column; gap: 30px; align-items: center; }
#aval-mdt .aval-texto { max-width: 780px; text-align: center; }
#aval-mdt h2 { margin: 0 0 12px; font-size: clamp(1.8rem, 2.4vw, 2.4rem); letter-spacing: .2px; }
#aval-mdt .aval-sub { margin: 0 auto 18px; max-width: 700px; color: rgba(255,255,255,.92); font-size: 1.05em; }
#aval-mdt .aval-datos { list-style: none; padding: 0; margin: 16px auto 0; display: flex; flex-direction: column; gap: 6px; color: rgba(255,255,255,.88); }
#aval-mdt .aval-datos li strong { color: #fff; }
#aval-mdt .aval-nota { margin-top: 12px; color: rgba(255,255,255,.78); font-size: .95em; }
#aval-mdt .aval-certificado { position: relative; width: min(95%, 780px); text-align: center; border-radius: 18px; box-shadow: var(--shadow-2); }
#aval-mdt .cert-marco { background: #fff; color: var(--card-text); border: 1px solid var(--card-border); border-radius: 18px; box-shadow: var(--shadow-2); padding: 20px 20px 16px; }
#aval-mdt .cert-img { display: block; width: 100%; height: auto; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.12); margin-top: 12px; }
#aval-mdt .aval-caption { margin-top: 12px; font-size: .95em; color: var(--text-2); }
@media (min-width: 900px) {
  #aval-mdt .aval-container { flex-direction: row; justify-content: space-between; align-items: center; }
  #aval-mdt .aval-texto { width: 48%; text-align: left; }
  #aval-mdt .aval-certificado { width: 48%; }
}
:root[data-theme="dark"] #aval-mdt { background: var(--surface-2); }
#aval-mdt .aval-link { color: #fff; font-weight: 700; text-decoration: none; border-bottom: 2px solid transparent; transition: color var(--t-base) ease, border-color var(--t-base) ease; }
#aval-mdt .aval-link:hover { color: var(--primary); border-color: var(--primary); }
