/* ==========================
    VARIABLES GLOBALES
   ========================== */
:root {
  /* Colores base */
  --color-azul-principal: #00308B;
  --color-azul-claro: #E0F1FF;
  --color-gris-claro: #eee;
  --color-gris-medio: #f0f0f0;
  --color-texto: #333;
  --color-blanco: #ffffff;

  /* Colores de enlaces y acentos */
  --color-link-fondo: #f9faff;
  --color-link-borde: #0045bf;
  --color-link-texto: #0045bf;
  --color-acento-cian: #008ca2;
  --color-acento-morado: #93328E;

  /* Slider */
  --slider-bg: var(--color-azul-principal);
  --slider-text: var(--color-blanco);
  --slider-dot: var(--color-blanco);
  --slider-dot-active: var(--color-acento-morado);

  /* Tipografía */
  --fuente-principal: 'Claro', Arial, sans-serif;

  --peso-regular: normal;
  --peso-medio: 500;
  --peso-negrita: bold;

  --tracking-normal: 0px;
  --tracking-negativo-sm: -0.75px;
  --tracking-sm: 0.03px;

  --font-xs: 1.0rem; /* 16px */
  --font-sm: 1.5rem; /* 24px */
  --font-md: 1.875rem; /* 30px */
  --font-lg: 2.5rem; /* 40px */
  --font-xl: 4.6875rem; /* 75px */
  --font-xxl: 5.0rem; /* 80px */

  --line-height-xs: 0.75rem; /* 12px */
  --line-height-sm: 1.75rem; /* 28px */
  --line-height-md: 2.4375rem; /* 39px */
  --line-height-lg: 5.3125rem; /* 85px */
  --line-height-xl: 6.25rem; /* 100px */
}

/* ==========================
   ESTILOS TIPOGRÁFICOS
   ========================== */
.texto-blanco-xs-bold {
  font-family: var(--fuente-principal);
  font-weight: var(--peso-negrita);
  font-size: var(--font-xs);
  line-height: var(--line-height-xs);
  color: var(--color-blanco);
}

.texto-morado-xs-bold {
  font-family: var(--fuente-principal);
  font-weight: var(--peso-negrita);
  font-size: var(--font-xs);
  line-height: var(--line-height-xs);
  color: var(--color-acento-morado);
}

.texto-azul-sm-regular {
  font-family: var(--fuente-principal);
  font-weight: var(--peso-regular);
  font-size: var(--font-sm);
  line-height: var(--line-height-sm);
  color: var(--color-azul-principal);
}

.texto-blanco-md-bold {
  font-family: var(--fuente-principal);
  font-weight: var(--peso-negrita);
  font-size: var(--font-md);
  line-height: var(--line-height-md);
  color: var(--color-blanco);
}

.texto-azul-lg-medium {
  font-family: var(--fuente-principal);
  font-weight: var(--peso-medio);
  font-size: var(--font-lg);
  line-height: var(--line-height-lg);
  color: var(--color-azul-principal);
}

.texto-azul-xl {
  font-family: var(--fuente-principal);
  font-weight: var(--peso-regular);
  font-size: var(--font-xl);
  line-height: var(--line-height-lg);
  color: var(--color-azul-principal);
}

.texto-blanco-xxl {
  font-family: var(--fuente-principal);
  font-weight: var(--peso-regular);
  font-size: var(--font-xxl);
  line-height: var(--line-height-xl);
  color: var(--color-blanco);
}

/* ==========================
   ESTILOS BASE Y COMPONENTES
   ========================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'AMX', sans-serif;
  font-size: 1rem;
  color: var(--color-texto);
  /*letter-spacing: -0.8px;*/
}
body.modal-open {
  overflow: hidden;
}
.mb-12 {
  margin-bottom: 0.75rem;
}
.mb-32 {
  margin-bottom: 2rem;
}
.mb-50 {
  margin-bottom: 3.125rem;
}
.mb-67 {
  margin-bottom: 4.1875rem;
}
.fs-16 {
  font-size: 1.0rem;
  line-height: 0.75rem;
}
.fs-18 {
  font-size: 1.125rem;
  line-height: 1.5rem;
}
.fs-20 {
  font-size: 1.25rem;
  line-height: 1.75rem;
}
.fs-24 {
  font-size: 1.5rem;
  line-height: 2.25rem;
}
.fs-32 {
  font-size: 2.0rem;
  line-height: 2.625rem;
}
.fs-30 {
  font-size: 1.875rem;
  line-height: 2.4375rem;
}
.fs-36 {
  font-size: 2.25rem;
  line-height: 3.0rem;
}
.fs-40 {
  font-size: 2.5rem;
  line-height: 5.3125rem;
}
.fs-75 {
  font-size: 4.6875rem;
  line-height: 5.3125rem;
}
.fs-80 {
  font-size: 5.0rem;
  line-height: 6.25rem;
}
.lh-28 {
  line-height: 1.75rem;
}
.ls-75 {
  letter-spacing: -0.75px;
}
.pl-5 {
  padding-left: 0.3125rem;
}
.mt-12 {
  margin-top: 0.75rem;
}
.mt-16 {
  margin-top: 1.0rem;
}
.mt-24 {
  margin-top: 1.5rem;
}
.pt-32 {
  padding-top: 2rem;
}
.ps-32 {
  padding-left: 2rem;
}
.me-15 {
  margin-right: 15px;
}
.small {
  font-size: 80%;
}
.text-start {
  text-align: left;
}
.text-center {
  text-align: center;
}
.text-primary {
  color: var(--color-azul-principal);
}
.text-light {
  color: var(--color-blanco);
}
.text-dark {
  color: var(--color-texto);
}
.text-shadow {
  text-shadow: 0px 3px 6px #00000080;
}
.text-dark .text-shadow {
  text-shadow: 3px 0px 6px #ffffff;
}
.text-decoration-none {
  text-decoration: none;
}
.position-relative {
  position: relative;
}
.d-flex {
  display: flex;
}
.justify-between {
  justify-content: space-between;
}
.fw-normal {
  font-weight: 400;
}
.fw-semibold {
  font-weight: 600;
}
.w-100 {
  width: 100%;
}
.h-100 {
  height: 100%;
}
p {
  margin-bottom: 20px;
}
header {
  background-color: var(--color-blanco);
  position: sticky;
  top: 0;
  z-index: 1024;
  box-shadow: inset 0px -1px 0px rgba(0, 0, 0, 0.1), 0px 2px 4px rgba(0, 0, 0, 0.1);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 72px;
}

.header-top .title {
  font-weight: bold;
  color: var(--color-azul-principal);
}

.header-top .logo img {
  margin-right: 8px;
}

.header-top .logo {
  display: flex;
  align-items: center;
  gap: 8px;
}
.titulo-principal {
  font-style: normal;
  font-weight: bold;
  font-size: 2rem; /* 32px */
  color: #003087;
  text-align: left;
  text-decoration: none;
  letter-spacing: -1.1px;
  line-height: 64px;
}

.container {
  max-width: 1220px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo .barra {
  font-size: 50px;
  color: var(--color-acento-morado);
  font-weight: 100;
}

.logo .conocimiento {
  font-weight: 500;
  color: var(--color-acento-morado);
  max-width: 147px;
}

.main-menu {
  background-color: var(--color-azul-claro);
  text-align: center;
  padding: 15px 0;
}

.main-menu ul {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 0;
}
.main-menu ul li {
  padding: 0 12px;
}

.main-menu li a {
  color: var(--color-azul-principal);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.24rem; /* 20px */
  width: 240px;
  display: block;
  text-align: center;
}

.intro-link {
  display: inline-table;
  text-decoration: none;
  border: 2px solid var(--color-link-borde);
  border-radius: 33px;
  background-color: var(--color-link-fondo);
  color: var(--color-link-texto);
  transition: all 0.3s ease;
}
/*.intro-link:hover {
  background-color: var(--color-link-borde);
  color: var(--color-blanco);
}
.intro-link:hover path {
  fill: var(--color-blanco) !important;
}*/
.arrow-icon {
  font-weight: bold;
  margin-right: 0.5rem;
}

.slider {
  aspect-ratio: 2.81 / 1;
  max-height: 600px;
  position: relative;
  overflow: hidden;
}

.slides-wrapper {
  display: flex;
  position: relative;
  height: 100%;
}

.slide {
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
  z-index: 0;
  position: absolute;
}

.slide.active {
  opacity: 1;
  z-index: 1;
  position: relative;
}

.slider picture,
.slider img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slide-content {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  max-width: 40%;
  margin: 0 auto;
}

.slide-content h4 {
  font-weight: normal;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1.2;
}

.slide-content .icon {
  width: auto;
  margin-bottom: 25px;
  height: 35px;
}

.slide-content p {
  font-size: 1.2rem;
}

.nav-controls {
  position: absolute;
  bottom: 20px;
  display: flex;
  gap: 10px;
  z-index: 4;
}

.nav {
  width: 40px;
  height: 40px;
  border: 2px solid var(--color-blanco);
  border-radius: 50%;
  background-color: transparent;
  color: var(--color-blanco);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.3s ease, transform 0.2s ease;
}
.next {
  margin-left: 16px;
}

.nav:hover {
  background-color: rgba(255, 255, 255, 0.15);
  transform: scale(1.1);
}

.dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  z-index: 4;
}

.dots button {
  border: none;
  height: 12px;
  width: 12px;
  border-radius: 50px;
  margin: 0 4px;
  background-color: var(--slider-dot);
  box-shadow: inset 0px -6px 3px #00000029, 0px 10px 10px #00000029;
  border: 1px solid #707070;
  cursor: pointer;
  transition: all 0.3s ease;
}

.dots .active {
  background-color: var(--slider-dot-active);
  width: 40px;
}

.intro, .destacados, .categorias {
  padding: 2rem;
  text-align: center;
}
.intro {
  padding-top: 4rem;
}

/* Estilos base de la grilla */
.grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3rem 1.5rem;
  margin-inline: auto;
  max-width: 100%;
}

/* Estilo base de las tarjetas (3 por fila en desktop) */
.grid > * {
  flex: 1 1 calc(33.333% - 1.5rem);
  max-width: calc(33.333% - 1.5rem);
  display: flex;
}

.card-categoria,
.destacado {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.destacado {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
}
.destacado::before {
  content: "";
  display: block;
  padding-top: 220px;
}

.destacado img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
  object-fit: cover;
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
}

.destacado .overlay {
  position: absolute;
  z-index: 2;
  inset: 0;
  color: var(--color-blanco);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
  opacity: 1;
  transition: background 0.3s ease;
}

.destacado .overlay p {
  margin-bottom: 0.5rem;
  text-align: left;
  max-width: 380px;
}

.text-uppercase {
  text-transform: uppercase;
}

.destacado .btn {
  display: none;
  background-color: var(--color-acento-morado);
  color: var(--color-blanco);
  text-decoration: none;
  padding: 1rem 1rem;
  border-radius: 30px;
  font-size: 0.9rem;
  align-self: flex-start;
  width: 172px;
  height: 48px;
  margin: 0 auto 50px;
}
.destacado:focus .overlay,
.destacado:hover .overlay {
  background: rgba(0, 0, 0, 0.6);
}
.destacado:focus p,
.destacado:hover p {
  display: none;
}
.destacado:focus .btn,
.destacado:hover .btn {
  display: inline-block;
}

.destacado:hover> img {
  transform: scale(1.05);
}

.card-categoria {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  background-color: var(--color-azul-claro);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  border-radius: 12px;
}

.card-img {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  transition: transform 0.4s ease;
  z-index: 1;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
}
.card:hover .card-img img {
  transform: scale(1.05);
}
.card-img::before {
  content: "";
  display: block;
  padding-top: 200px;
}

.card-icon {
  position: absolute !important;
  top: 20px !important;
  left: 20px !important;
  width: 40px !important;
  height: 40px !important;
  border-radius: 50%;
  background-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-overlay {
  position: absolute;
  z-index: 1;;
  bottom: 0px;
  left: 0px;
  right: 0px;
  color: var(--color-blanco);
  text-align: left;
  padding: 20px 39px;
  background: transparent linear-gradient(0deg, #000000 0%, #00308700 100%) 0% 0% no-repeat padding-box;
}

.card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.5rem;
  height: 115px;
}

.card-content p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: calc(1.2em * 3);
  line-height: 0.98rem;
  margin-bottom: 0;
}

.card-link {
  font-weight: 500;
  color: var(--color-acento-morado);
  text-decoration: none;
  align-self: flex-end;
}

.card-link:hover {
  text-decoration: underline;
}

.slider-destacados-wrapper {
  position: relative;
  overflow: hidden;
  gap: 12px;
}

.slider-destacados {
  display: flex;
  transition: transform 0.4s ease;
  gap: 24px;
}

.btn-slider {
  width: 40px;
  height: 40px;
  border: 2px solid var(--color-texto);
  border-radius: 50%;
  background-color: transparent;
  color: var(--color-texto);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.3s ease, transform 0.2s ease;
  position: absolute;
}
.btn-slider:disabled {
  opacity: 0.3;
  pointer-events: none;
}
.btn-slider.prev {
  left: -50px;
  top: 50%;
  transform: translateY(-50%);
}
.btn-slider.next {
  right: -50px;
  top: 50%;
  transform: translateY(-50%);
}
.footer {
  background-color: var(--color-azul-principal);
  color: var(--color-blanco);
  text-align: center;
  padding: 32px 0px 24px;
}
.footer ul {
  display: flex;
  align-items: center;
  list-style: none;
}
.footer ul li {
  position: relative;
}
.footer ul li a {
  font-size: 14px;
  font-size: .875rem;
  font-weight: 500;
  display: inline-block;
}

.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
  border: 0;
}

.rotar-45 {
  transform: rotate(-45deg);
  transform-origin: center;
  margin-bottom: -10px;
}

.separator {
  padding-left: 32px;
  padding-right: 32px;
}

.divider {
  width: 100%;
  height: 1px;
  background-color: var(--color-azul-principal);
  border: 0;
  margin: 2rem 0 2rem;
}
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000000001;
}
.modal.show {
  display: flex !important;
}
.modal .modal-dialog {
  background-color: var(--color-blanco);
  border-radius: 12px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: fadeIn 0.25s ease-out;
  overflow: hidden;
}
.modal .modal-header {
  padding: 16px 24px;
  border-bottom: 2px solid var(--color-acento-morado);
  background-color: var(--color-blanco);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal .modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--color-texto);
  line-height: normal;
}
.modal .modal-header .close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--color-texto);
  cursor: pointer;
  padding: 0;
}
.modal .modal-header .close:hover {
  color: var(--color-acento-morado);
}
.modal .modal-body {
  padding: 24px;
  background-color: var(--color-blanco);
  max-height: 380px;
  overflow: auto;
}
.modal .modal-body ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.modal .modal-body li {
  margin-bottom: 16px;
}
.modal .modal-body a {
  color: var(--color-acento-cian);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.modal .modal-body a:hover {
  text-decoration: underline;
}
.modal.show .modal-dialog {
  animation: fadeInModal 0.3s ease forwards;
}

.modal.fade-out .modal-dialog {
  animation: fadeOutModal 0.3s ease forwards;
}

#contenedor-destacados {
  display: flex;
  gap: 24px;
  transition: transform 0.3s ease-in-out;
  will-change: transform;
}

.slider-destacados article.destacado {
  flex: 0 0 calc(100% / 1 - 16px);
  max-width: calc(100% / 1 - 16px);
  border-radius: 16px;
  position: relative;
}

#dots-destacados {
  position: relative;
  bottom: 0;
  transform: none;
  display: none;
  left: 0;
  margin-top: 20px;
  justify-content: center;
}

@media (min-width: 600px) {
  .slider-destacados article.destacado {
    flex: 0 0 calc(100% / 2 - 16px);
    max-width: calc(100% / 2 - 16px);
    border-radius: 16px;
  }
}

@media (min-width: 992px) {
  .modal .modal-dialog.modal-lg {
    max-width: 800px;
  }
}

@media (min-width: 1024px) {
  .slider-destacados article.destacado {
    flex: 0 0 calc(100% / 3 - 16px);
    max-width: calc(100% / 3 - 16px);
    border-radius: 16px;
  }
}


@media (max-width: 1024px) {
  .slide-content h4 {
    font-size: var(--font-lg);
    line-height: var(--line-height-md);
  }
  .grid > * {
    flex: 1 1 calc(50% - 1.5rem);
    max-width: calc(50% - 1.5rem);
  }
}

@media (max-width: 768px) {
  .fs-24 {
    font-size: 1rem; /* 16px */
    line-height: 1.5rem; /* 24px */
  }
  .fs-36 {
    font-size: 1.5rem; /* 24px */
    line-height: 1.7rem; /* 27px */
  }
  .main-menu {
    padding: 5px 0;
  }
  .main-menu ul {
    justify-content: space-evenly;
  }
  .header-top {
    min-height: 50px;
  }
  .header-top .logo {
    gap: 4px;
  }
  .titulo-principal {
    font-size: 1rem; /* 16px */
    line-height: 1.5rem; /* 24px */
  }
  .logo .barra {
    font-size: 25px;
  }
  .logo img {
    max-height: 16px;
    margin-right: 0 !important;
  }
  .logo .conocimiento {
    font-size: .625rem; /* 10px */
    line-height: .75rem; /* 12px */
    max-width: 60px;
  }
  .main-menu li a {
    font-size: 0.75rem; /* 12px */
    line-height: 1.25rem; /* 20px */
    width: 100%;
  }
  .btn-slider,
  .nav-controls {
    display: none;
  }
  #dots-destacados {
    display: flex;
  }
  .slide-content {
    max-width: 100%;
  }
  .grid {
    gap: 2rem 1.5rem;
  }
  .grid > * {
    flex: 1 1 100%;
    max-width: 100%;
  }
  .slider-destacados article.destacado {
    flex: 0 0 100%;
    max-width: 100%;
  }
  .intro, .destacados, .categorias, .separator {
    padding-left: 0;
    padding-right: 0;
  }
  #titulo-categorias {
    text-align: left;
  }
  .card-overlay {
    padding: 20px;
  }
  .intro, .destacados, .categorias {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
  .intro {
    padding-top: 3rem;
  }
  .mb-50 {
    margin-bottom: 25px;
  }
  .divider {
    margin: 1.75rem 0 1.75rem;
  }
  .footer .justify-between {
    flex-direction: column;
    align-items: center;
    line-height: normal;
  }
  .footer ul {
    margin-top: 12px;
  }
  .footer img{
    height: 20px;
  }
}

@media (max-width: 640px) {
  .slider {
    aspect-ratio: 16 / 16;
    max-height: initial;
  }
  .slide-content {
    max-width: 100%;
    transform: none;
    top: 48px;
    padding-right: 1rem;
  }
  .slide-content h4 {
    font-size: 1.5rem !important; /* 24px */
    line-height: 1.7rem; /* 27px */
  }
}


@keyframes fadeInModal {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOutModal {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(20px); }
}