/* Caliente Universidad — estilos
   Colores de marca: rojo Caliente #D80212 / #E1251B, beige #E6D9CE, negro #000
   Títulos en Montserrat (sustituto libre de la Proxima Nova que usa calienteuniversidad.com.mx) */

@font-face { font-family: "Roboto"; font-weight: 300; font-display: swap; src: url("../fonts/roboto-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 400; font-display: swap; src: url("../fonts/roboto-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 500; font-display: swap; src: url("../fonts/roboto-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 600; font-display: swap; src: url("../fonts/montserrat-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url("../fonts/montserrat-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 700; font-display: swap; src: url("../fonts/roboto-latin-700-normal.woff2") format("woff2"); }

:root {
  --rojo: #d80212;
  --rojo-claro: #e1251b;
  --rojo-osc: #b00110;
  --rojo-btn: #c50211;
  --titulos: "Montserrat", "Proxima Nova", Arial, sans-serif;
  --beige: #e6d9ce;
  --beige-claro: #f4eee8;
  --negro: #111;
  --gris: #5d5d5d;
  --linea: #e6ded4;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --t: .4s;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--hh, 150px); } /* el header fijo no tapa el título de la sección */
body {
  margin: 0;
  font-family: "Roboto", Arial, sans-serif;
  color: var(--negro);
  background: #fff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h2, h3 { margin: 0; }
.container { width: min(100% - 32px, 1180px); margin-inline: auto; }
.center { text-align: center; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 170px;
  padding: 11px 26px;
  font-family: var(--titulos); font-weight: 600; font-size: .85rem; letter-spacing: .6px; text-transform: uppercase;
  text-decoration: none; color: #fff; text-align: center; line-height: 1.25;
  border: 2px solid transparent;
  border-radius: 5px;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.btn--dark { background: var(--negro); border-color: var(--negro); }
.btn--red { background: var(--rojo); border-color: var(--rojo); }
.btn--lg { padding: 13px 34px; font-size: 1rem; }
@media (hover: hover) {
  .btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0, 0, 0, .14); }
  .btn--dark:hover { background: #fff; color: var(--negro); }
  .btn--red:hover { background: #fff; color: var(--rojo); }
}

/* ---------- Header ---------- */
.header { position: sticky; top: 0; z-index: 50; background: #fff; transition: box-shadow var(--t) var(--ease); }
.header.is-scrolled { box-shadow: 0 6px 20px rgba(0, 0, 0, .08); }
.header-top { display: flex; justify-content: center; padding: 10px 16px; border-bottom: 1px solid var(--linea); }
.logo img { width: 150px; transition: transform var(--t) var(--ease); }
.logo:hover img { transform: scale(1.03); }
.header-nav {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 14px 70px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--linea);
}

/* ---------- Banner ---------- */
/* El banner toma la proporción exacta de la imagen para que el texto nunca se recorte */
.hero {
  aspect-ratio: 2000 / 761;
  background: var(--beige) url("../img/banner.jpg") center / 100% 100% no-repeat;
}

/* ---------- Secciones ---------- */
.section { padding: clamp(48px, 7vw, 80px) 0; }
.section--line { border-top: 1px solid var(--linea); }
.section--beige { background: var(--beige-claro); border-top: 0; }
.title {
  text-align: center;
  font-family: var(--titulos);
  font-weight: 600;
  font-size: clamp(1.55rem, 3vw, 1.9rem);
  letter-spacing: .5px;
  text-transform: uppercase;
  line-height: 1.2;
  color: var(--rojo);
}
/* Línea fina bajo el título, como los separadores del sitio de Caliente */
.title::after { content: ""; display: block; width: 60px; height: 2px; margin: 16px auto 0; background: var(--rojo); }
.subtitle { text-align: center; margin: 14px 0 38px; font-weight: 400; font-size: 1.05rem; color: var(--gris); }

/* Institutos */
.institutes { display: flex; justify-content: center; flex-wrap: wrap; gap: 26px; }
.institute {
  flex: 0 1 270px;
  display: flex; flex-direction: column; align-items: center;
  padding: 28px 22px 26px;
  border: 1px solid var(--rojo);
  border-radius: 5px;
  text-align: center; text-decoration: none;
  background: #fff;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), background-color var(--t) var(--ease);
}
.institute img { width: 150px; transition: transform .6s var(--ease); }
.institute h3 { margin-top: 14px; font-family: var(--titulos); font-weight: 600; font-size: 1.25rem; line-height: 1.25; color: #000; }
.institute p { margin: 12px 0 0; font-size: .88rem; color: var(--gris); }
.institute .more {
  margin-top: 14px; font-size: .85rem; font-weight: 500; color: var(--rojo);
  opacity: 0; transform: translateY(6px);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
@media (hover: hover) {
  .institute:hover { transform: translateY(-6px); box-shadow: 0 18px 36px rgba(216, 2, 18, .14); }
  .institute:hover img { transform: scale(1.06) rotate(-3deg); }
  .institute:hover .more { opacity: 1; transform: none; }
}
@media (hover: none) { .institute .more { opacity: 1; transform: none; } }

/* Categorías */
.categories { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px 18px; }
.categories span { flex: 0 1 calc((100% - 3 * 18px) / 4); }
.categories span {
  display: flex; align-items: center; justify-content: center;
  min-height: 58px; padding: 8px 12px;
  border: 1px solid #d6cfc8; border-radius: 5px; background: #fff;
  font-family: var(--titulos); font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; text-align: center; text-decoration: none; line-height: 1.25;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .06);
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t) var(--ease);
}
.categories span:hover { background: var(--rojo); border-color: var(--rojo); color: #fff; transform: translateY(-3px); outline: none; }

/* Grupo de categorías por instituto */
.cat-label { margin: -14px 0 22px; text-align: center; font-family: var(--titulos); font-weight: 600; font-size: .9rem; letter-spacing: .5px; text-transform: uppercase; color: #000; }
.js .cat-group:not(.is-active) { display: none; }
.cat-group.is-switching { animation: catIn .5s var(--ease) both; }
@keyframes catIn { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }
.no-js .cat-group + .cat-group { margin-top: 40px; }
/* Instituto elegido */
.institute.is-active { background: var(--rojo); box-shadow: 0 18px 36px rgba(216, 2, 18, .2); }
.institute.is-active h3, .institute.is-active p { color: #fff; }
.institute.is-active img { background: #fff; border-radius: 50%; }
.institute.is-active .more { color: #fff; }

/* ---------- Carrusel de cursos ---------- */
.carousel { position: relative; padding: 0 44px; }
.carousel-track {
  display: grid; grid-auto-flow: column;
  grid-auto-columns: calc((100% - 2 * 14px) / 3);
  gap: 14px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 6px 0 10px;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track:focus-visible { outline: 2px solid var(--rojo); outline-offset: 4px; }
/* Tarjeta: imagen del curso + velo oscuro al 50 % (igual que el slider de Luis);
   al pasar el cursor el título se pinta de rojo Caliente y la foto hace un zoom suave */
.course {
  position: relative; overflow: hidden; isolation: isolate;
  scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  min-height: 240px; padding: 26px 20px;
  background: #fff; /* sin imagen queda gris (blanco + velo 50 %), igual que en la versión de Luis */
  color: #fff; text-decoration: none; text-align: center;
  border-radius: 5px;
}
.course .bg {
  position: absolute; inset: 0; z-index: -2;
  background-size: cover; background-repeat: no-repeat;
  transition: transform .9s var(--ease);
}
.course::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(0, 0, 0, .5);
  transition: background-color var(--t) var(--ease);
}
.course h3 {
  font-family: var(--titulos); font-weight: 600; font-size: 1.15rem; line-height: 1.3;
  padding: 4px 10px; border-radius: 3px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .45);
  transition: background-color var(--t) var(--ease), text-shadow var(--t) var(--ease);
}
.course .go {
  font-family: var(--titulos); font-size: .76rem; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
  padding: 8px 20px; border: 1px solid rgba(255, 255, 255, .75); border-radius: 5px;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease), border-color var(--t) var(--ease);
}
.course:hover .bg, .course:focus-visible .bg { transform: scale(1.08); }
.course:hover::before, .course:focus-visible::before { background: rgba(0, 0, 0, .6); }
.course:hover h3, .course:focus-visible h3 { background: var(--rojo-claro); text-shadow: none; }
.course:hover .go, .course:focus-visible .go { background: #fff; color: var(--rojo); border-color: #fff; }
.course:focus-visible { outline: 3px solid var(--rojo); outline-offset: -3px; }

.carousel-arrow {
  position: absolute; top: calc(50% - 22px); translate: 0 -50%;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--linea); background: #fff; color: var(--rojo);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
  font-size: 1.7rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center; padding-bottom: 3px;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease), opacity var(--t) var(--ease);
}
.carousel-arrow:hover { background: var(--rojo); color: #fff; border-color: var(--rojo); }
.carousel-arrow:disabled { opacity: .3; pointer-events: none; }
.carousel-arrow.prev { left: 0; }
.carousel-arrow.next { right: 0; }
.carousel-dots { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 26px 0 30px; }
.carousel-dots button {
  width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%;
  background: #c4c4c4; cursor: pointer;
  transition: background-color var(--t) var(--ease), width var(--t) var(--ease);
}
.carousel-dots button.is-active { background: var(--rojo); width: 24px; border-radius: 6px; }

/* ---------- Contacto ---------- */
.contact { text-align: center; }
.red-line { display: block; width: 120px; height: 2px; margin: 0 auto 56px; background: var(--rojo); }
.mail { display: inline-block; font-size: .95rem; text-decoration: none; color: var(--negro); border-bottom: 1px solid transparent; transition: color var(--t) var(--ease), border-color var(--t) var(--ease); }
.mail:hover { color: var(--rojo); border-color: var(--rojo); }
.connect { margin: 28px 0 20px; font-family: var(--titulos); font-weight: 600; font-size: clamp(1.55rem, 3vw, 1.9rem); text-transform: uppercase; letter-spacing: .5px; color: var(--rojo); }
.social { display: flex; justify-content: center; gap: 12px; }
.social a {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--rojo); color: #fff;
  transition: background-color var(--t) var(--ease), transform var(--t) var(--ease);
}
.social a:hover { background: #000; transform: translateY(-3px); }
.social svg { width: 19px; height: 19px; }

/* ---------- Footer ---------- */
.footer { border-top: 2px solid var(--linea); padding: 22px 0; font-size: .78rem; color: #333; }
.footer-inner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px 40px; }
.footer img { width: 160px; }
.footer p { margin: 0; }
.footer .powered a { color: var(--rojo); font-weight: 500; text-decoration: none; }
.footer .powered a:hover { text-decoration: underline; }
.footer .powered { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.footer .gbt { display: block; }
.footer .gbt { width: 56px; height: 56px; }
.footer .gbt img { width: 56px; height: 56px; }


/* ---------- Volver arriba ---------- */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 5px; border: 0; padding: 0;
  background: var(--rojo-btn); color: #fff; cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
  opacity: 0; visibility: hidden; translate: 0 12px;
  transition: opacity var(--t) var(--ease), translate var(--t) var(--ease), visibility 0s linear var(--t), background-color var(--t) var(--ease);
}
.to-top svg { width: 20px; height: 20px; transition: translate var(--t) var(--ease); }
.to-top.is-visible { opacity: .85; visibility: visible; translate: 0 0; transition: opacity var(--t) var(--ease), translate var(--t) var(--ease), visibility 0s, background-color var(--t) var(--ease); }
.to-top.is-visible:hover, .to-top:focus-visible { opacity: 1; background: #000; }
.to-top:hover svg { translate: 0 -2px; }

/* ---------- Aparición suave ---------- */
.reveal { opacity: 0; }
.reveal.is-visible { animation: up .8s var(--ease) both; animation-delay: var(--d, 0s); }
@keyframes up { from { opacity: 0; translate: 0 22px; } to { opacity: 1; translate: 0 0; } }
.no-js .reveal { opacity: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .categories span { flex-basis: calc((100% - 2 * 18px) / 3); }
  .carousel-track { grid-auto-columns: calc((100% - 14px) / 2); }
}
@media (max-width: 767px) {
  .hero { aspect-ratio: 2000 / 800; background-image: url("../img/banner-movil.jpg"); }
  .header-nav { gap: 12px; }
  .header-nav .btn { min-width: 0; flex: 1 1 140px; }
  .categories { gap: 12px; }
  .categories span { flex-basis: calc((100% - 12px) / 2); }
  .carousel { padding: 0; }
  .carousel-track { grid-auto-columns: 84%; }
  .carousel-arrow { display: none; }
  .footer-inner { grid-template-columns: 1fr; justify-items: center; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; }
  html, .carousel-track { scroll-behavior: auto; }
}
