:root {
  --background-color: #f5f8fc;
  --surface-color: #ffffff;
  --second-color: #0c2d57;
  --primary-title: #003184;
  --primary-blue: #023e8a;
  --primary-line: #d6e1ef;
  --muted-text: #64748b;
  --footer-text: #ffffff;
}

/* =========================
   CONFIGURACIÓN GENERAL
========================= */

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--background-color);
  color: #1f2937;
}

/* =========================
   CABECERA
========================= */

.topbar {
  width: 100%;
  background: linear-gradient(90deg, #ffffff 0%, #f7faff 55%, #eef4ff 100%);
  border-bottom: 1px solid var(--primary-line);
  box-shadow: 0 3px 14px rgba(0, 49, 132, 0.05);
}

.nav-content {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 10px 32px;
  display: flex;
  align-items: center;
}

.img-nav {
  width: auto;
  height: 82px;
  object-fit: contain;
}

/* =========================
   CONTENIDO PRINCIPAL
========================= */

.main-content {
  flex: 1;
  width: 100%;
  display: flex;
}

.section-cards {
  width: 100%;
  min-height: 540px;
  padding: 55px 40px 70px;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.section-heading {
  text-align: center;
  margin-bottom: 38px;
}

h1 {
  color: var(--primary-title);
  font-size: clamp(32px, 3vw, 44px);
  line-height: 1.15;
  font-weight: 750;
  letter-spacing: -0.5px;
}

.section-description {
  margin-top: 12px;
  color: var(--muted-text);
  font-size: 18px;
  line-height: 1.5;
}

/* =========================
   TARJETAS
========================= */

#cards {
  width: 100%;
  max-width: 1180px;

  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

.card {
  min-width: 0;
  height: 230px;

  background-color: var(--surface-color);
  border: 1px solid #e6edf5;
  border-radius: 18px;

  overflow: hidden;
  cursor: pointer;

  box-shadow: 0 8px 24px rgba(0, 49, 132, 0.09);

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-7px);
  border-color: #c4d5ea;
  box-shadow: 0 16px 34px rgba(0, 49, 132, 0.16);
}

.card a {
  width: 100%;
  height: 100%;

  display: flex;
  flex-direction: column;

  text-decoration: none;
  color: inherit;
}

.card-image {
  flex: 1;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 20px;
  background: radial-gradient(circle at center, #ffffff 0%, #fbfdff 100%);
}

.card-image img {
  width: 100%;
  height: 145px;

  object-fit: contain;
  object-position: center;

  transition: transform 0.25s ease;
}

.card:hover .card-image img {
  transform: scale(1.045);
}

.card-text {
  width: 100%;

  background: linear-gradient(
    90deg,
    var(--primary-title) 0%,
    var(--primary-blue) 100%
  );

  color: #ffffff;
  text-align: center;

  padding: 14px 12px;

  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.15px;
}

/* =========================
   BOTÓN FLOTANTE
========================= */

.boton-flotante {
  position: fixed;
  right: 24px;
  bottom: 24px;

  width: 48px;
  height: 48px;

  display: flex;
  justify-content: center;
  align-items: center;

  background-color: var(--primary-blue);
  color: white;

  border: 3px solid var(--primary-line);

  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(0, 49, 132, 0.25);

  text-decoration: none;
  font-size: 21px;
  font-weight: 900;

  border-radius: 50%;

  box-shadow: 0 6px 16px rgba(0, 45, 100, 0.28);

  transition:
    background-color 0.25s ease,
    transform 0.25s ease;

  z-index: 1000;
}

.boton-flotante:hover {
  background-color: var(--primary-title);
  transform: translateY(-3px);
}

/* =========================
   SECCIONES DE INFORMACIÓN
   (por si vuelves a activarlas)
========================= */

#contenedor-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  padding: 30px 60px;
}

#contenedor-info div {
  width: 100%;
  display: flex;
  justify-content: center;
}

#contenedor-info .img-info {
  width: min(900px, 92%);
  height: auto;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 49, 132, 0.1);
}

/* =========================
   FOOTER
========================= */

footer {
  width: 100%;
  color: var(--footer-text);
  border-top: 3px solid #e5bf17;

  background: linear-gradient(
    60deg,
    #ffffff 0%,
    #ffffff 29.9%,
    var(--second-color) 30.1%,
    #113968 100%
  );
}

.footer-content {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;

  min-height: 110px;
  padding: 18px 42px;

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 35px;
}

.footer-logos {
  display: flex;
  align-items: center;
  gap: 15px;
}

.footer-logo-box {
  min-height: 62px;
  min-width: 120px;

  /* padding: 8px 14px; */

  display: flex;
  justify-content: center;
  align-items: center;

  background-color: #ffffff;
  border-radius: 10px;
}

.footer_laby {
  width: 180px;
  max-height: 50px;
  object-fit: contain;
}

.footer_lab {
  width: 60px;
  max-height: 50px;
  object-fit: contain;
}

.footer-textos {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  text-align: right;
}

.footer-textos p {
  color: #ffffff;
  font-size: 15px;
  line-height: 1.55;
}

.footer-textos strong {
  font-weight: 700;
}

.footer-textos span {
  display: inline-block;
  margin-left: 6px;
  opacity: 0.9;
}

/* =========================
   TABLETS
========================= */

@media (max-width: 1024px) {
  .nav-content {
    padding: 10px 24px;
  }

  .img-nav {
    height: 72px;
  }

  .section-cards {
    padding: 45px 28px 60px;
  }

  #cards {
    max-width: 760px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .card {
    height: 225px;
  }

  .footer-content {
    padding: 18px 28px;
  }
}

/* =========================
   CELULARES
========================= */

@media (max-width: 640px) {
  .nav-content {
    justify-content: center;
    padding: 9px 16px;
  }

  .img-nav {
    height: 68px;
    max-width: 92%;
  }

  .section-cards {
    min-height: auto;
    padding: 38px 18px 48px;
  }

  .section-heading {
    margin-bottom: 28px;
  }

  h1 {
    font-size: 30px;
  }

  .section-description {
    font-size: 16px;
  }

  #cards {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .card {
    width: 100%;
    max-width: 390px;
    height: 220px;
    justify-self: center;
  }

  .footer-content {
    padding: 24px 18px 30px;

    flex-direction: column;
    justify-content: center;

    gap: 18px;
  }

  .footer-logos {
    width: 100%;
    justify-content: center;
  }

  .footer_laby {
    width: 70px;
  }

  .footer_lab {
    width: 30px;
  }

  .footer-textos p {
    width: 100%;
    justify-content: center;
    text-align: center;
    color: #000000;
  }

  .footer-textos span {
    display: block;
    margin-left: 0;
    margin-top: 3px;
  }

  .boton-flotante {
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
  }
}

/* =========================================================
   UROS.HTML - ESTILOS ADICIONALES
   Estos estilos se agregan sin modificar los estilos existentes.
========================================================= */

body.page-uros #contenedor-info {
  padding-top: 38px;
}

/* Barra de acciones ubicada arriba de la imagen */
#contenedor-info .acciones-info {
  width: min(1100px, 92%);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

/* Botones de la página de Urocultivo */
.btn-accion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

/* Botón regresar */
.btn-regresar {
  background-color: #ffffff;
  color: var(--primary-blue);
  border: 1px solid var(--primary-blue);
}

.btn-regresar:hover {
  background-color: #edf4ff;
  transform: translateY(-2px);
}

/* Botón descargar */
.btn-descargar {
  background-color: var(--primary-blue);
  color: #ffffff;
  border: 1px solid var(--primary-blue);
  box-shadow: 0 4px 10px rgba(0, 49, 132, 0.15);
}

.btn-descargar:hover {
  background-color: #024caa;
  transform: translateY(-2px);
  box-shadow: 0 7px 15px rgba(0, 49, 132, 0.2);
}

/* Solo en uros.html se permite que la imagen aproveche un poco más el ancho */
body.page-uros #contenedor-info .img-info {
  width: min(1100px, 92%);
}

.img-desktop {
  display: block;
}

.img-mobile {
  display: none;
}

/* Ajustes móviles únicamente para los nuevos elementos de uros.html */
@media (max-width: 640px) {
  #contenedor-info .acciones-info {
    width: 95%;
    flex-direction: column;
    align-items: stretch;
  }

  .btn-accion {
    width: 100%;
  }

  body.page-uros #contenedor-info .img-info {
    width: 95%;
  }

  .img-desktop {
    display: none;
  }

  .img-mobile {
    display: block;
  }
}

/* =========================================================
   UROS.HTML - POSICIÓN DE BOTONES
   Agregado sin modificar los estilos existentes.
========================================================= */

body.page-uros #contenedor-info .acciones-info {
  justify-content: center;
  align-items: center;
}

/* body.page-uros #contenedor-info .acciones-superiores {
  margin-top: -20px;
  margin-bottom: -5px;
}

body.page-uros #contenedor-info .acciones-inferiores {
  margin-top: -5px;
} */

@media (max-width: 640px) {
  body.page-uros #contenedor-info .acciones-info {
    width: 95%;
    flex-direction: row;
    justify-content: center;
    align-items: center;
  }

  body.page-uros #contenedor-info .acciones-superiores {
    margin-top: -20px;
    margin-bottom: -15px;
  }

  body.page-uros #contenedor-info .acciones-inferiores {
    margin-top: -10px;
  }

  body.page-uros .btn-accion {
    width: auto;
    max-width: 100%;
  }
}

/* =========================================================
   FOOTER MÓVIL
   Único cambio: fondo azul sólido.
   Se conservan la línea amarilla y todos los demás estilos.
========================================================= */

@media (max-width: 640px) {
  footer {
    background: var(--surface-color);
  }
}

/* =========================================================
   INDEX - AJUSTES MÓVILES
   Corrige scroll horizontal y centra los textos.
   No modifica el diseño de escritorio.
========================================================= */

@media (max-width: 640px) {
  /* Evita desplazamiento lateral en celulares */
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .main-content,
  .section-cards,
  .section-heading,
  #cards,
  .card {
    min-width: 0;
    max-width: 100%;
  }

  .main-content {
    width: 100%;
    overflow-x: hidden;
  }

  .section-cards {
    width: 100%;
    padding-left: 16px;
    padding-right: 16px;
    overflow-x: hidden;
  }

  /* Título y descripción centrados */
  .section-heading {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }

  .section-heading h1,
  .section-description {
    width: 100%;
    text-align: center;
  }

  /* Tarjetas centradas y sin provocar desbordamiento */
  #cards {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    justify-items: center;
  }

  .card {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  /* Texto de cada tarjeta completamente centrado */
  .card-text {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
  }
}

/* =========================================================
   INDEX MÓVIL - CENTRADO VERTICAL DE TEXTO EN TARJETAS
   Evita que la franja azul se comprima.
========================================================= */

@media (max-width: 640px) {
  .card {
    height: 235px;
  }

  .card-image {
    min-height: 0;
    padding: 16px;
  }

  .card-image img {
    height: 135px;
    max-height: 100%;
  }

  .card-text {
    flex: 0 0 44px;
    min-height: 44px;
    padding: 0 12px;

    display: flex;
    justify-content: center;
    align-items: center;

    text-align: center;
    line-height: 1.2;
  }
}

/* =========================================================
   INDEX MÓVIL - 4 CARDS VISIBLES EN CUADRÍCULA 2 X 2
   Solo afecta pantallas de hasta 640px.
========================================================= */

/* @media (max-width: 640px) {

  .section-cards {
    padding: 24px 12px 32px;
  }

  .section-heading {
    margin-bottom: 20px;
  }

  .section-heading h1 {
    font-size: 26px;
    line-height: 1.15;
  }

  .section-description {
    font-size: 14px;
    margin-top: 8px;
  }

  #cards {
    width: 100%;
    max-width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .card {
    width: 100%;
    max-width: none;
    height: 175px;
    border-radius: 14px;
  }

  .card-image {
    padding: 10px;
  }

  .card-image img {
    width: 100%;
    height: 112px;
    max-height: 112px;
    object-fit: contain;
  }

  .card-text {
    flex: 0 0 38px;
    min-height: 38px;
    padding: 0 6px;
    font-size: 13px;
    line-height: 1.1;

    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
  }
} */

/* =========================================================
   MÓVIL - CARDS 2 X 2
   DEJAR AL FINAL DEL ARCHIVO CSS
========================================================= */

@media screen and (max-width: 640px) {
  .section-cards {
    width: 100%;
    padding: 22px 12px 30px;
  }

  .section-heading {
    width: 100%;
    margin-bottom: 18px;
    text-align: center;
  }

  .section-heading h1 {
    font-size: 24px;
    line-height: 1.15;
    text-align: center;
  }

  .section-description {
    font-size: 13px;
    text-align: center;
    margin-top: 8px;
  }

  #cards {
    width: 100% !important;
    max-width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    margin: 0 auto;
  }

  #cards > .card {
    width: 100% !important;
    max-width: none !important;
    height: 160px !important;
    margin: 0 !important;
    border-radius: 12px;
  }

  .card a {
    width: 100%;
    height: 100%;
  }

  .card-image {
    padding: 8px !important;
    min-height: 0;
  }

  .card-image img {
    width: 100%;
    height: 105px !important;
    max-height: 105px !important;
    object-fit: contain;
  }

  .card-text {
    flex: 0 0 36px !important;
    min-height: 36px !important;
    padding: 0 5px !important;
    display: flex !important;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 12px;
    line-height: 1.1;
  }
}
