

/* >>> GOOGLE FONTS <<< */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');


/* >>> BASE GLOBAL <<< */
body {
  font-family: 'Inter', sans-serif;
  background: #f8f9fa;
  margin: 0;
  color: #222;
}

h1 {
  color: #005eb8;
  font-size: 1.8rem;
  margin: 0;
}


/* >>> ENCABEZADO PRINCIPAL <<< */
.header-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
}


/* >>> LOGO DENTRO DEL ENCABEZADO <<< */
.header-content img {
  max-height: 60px;
  width: auto;
}


/* >>> FILTROS DE BÚSQUEDA <<< */
.filtros {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}


/* >>> INPUTS Y SELECTS <<< */
input, 
/* >>> SELECT ESPECÍFICO <<< */
select {
  padding: 0.5rem 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  background-color: #fff;
}


/* >>> SELECT ESPECÍFICO <<< */
select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='gray' height='16' viewBox='0 0 24 24' width='16' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}


/* >>> FOCUS DEL SELECT <<< */
select:focus {
  outline: none;
  border-color: #005eb8;
  box-shadow: 0 0 0 2px rgba(0, 94, 184, 0.2);
}


/* >>> CONTADOR DE RESULTADOS <<< */
.result-count {
  text-align: center;
  margin: 1rem 0;
  font-weight: 500;
  color: #444;
}


/* >>> TABLA GENERAL <<< */
table {
  width: 90%;
  margin: auto;
  border-collapse: collapse;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  border-radius: 6px;
  overflow: hidden;
  background: white;
}


/* >>> CELDAS DE TABLA <<< */
th, td {
  padding: 0.75rem 1rem;
  text-align: left;
}


/* >>> ENCABEZADO DE TABLA <<< */
thead {
  background: #eaeaea;
}


/* >>> LINKS DE DESCARGA <<< */
td a {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 0.3rem 0.6rem;
  background-color: #f0f0f0;
  border-radius: 5px;
  text-decoration: none;
  transition: all 0.2s ease;
  color: #333;
  font-size: 0.95rem;
}


/* >>> LINKS DE DESCARGA (HOVER) <<< */
td a:hover {
  background-color: #e1e1e1;
  transform: translateY(-1px);
}

/* >>> FIX: uniformidad visual de descargas (solo escritorio) <<< */
td:nth-child(3) {
  white-space: normal;
  word-break: break-word;
  max-width: 300px;
}

td:nth-child(3) a {
  display: inline-block;
  margin: 2px 4px 2px 0;
  white-space: nowrap;
}
/* <<< END FIX >>> */



/* >>> PROPORCIONES ENTRE COLUMNAS <<< */
th:nth-child(1), td:nth-child(1) {
  width: 25%;
  max-width: 25%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

th:nth-child(2), td:nth-child(2) {
  width: 15%;
  max-width: 15%;
  text-align: center;
}

th:nth-child(3), td:nth-child(3) {
  width: 60%;
  max-width: 60%;
}
/* <<< END PROPORCIONES >>> */


/* >>> GRUPO DE ENCABEZADO <<< */
tr.group-header {
  background: #eaeaea;
  font-weight: bold;
  text-transform: uppercase;
  padding: 0.5rem;
  border-top: 2px solid #ccc;
}


/* >>> PIE DE PÁGINA <<< */
footer {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.9rem;
  color: #666;
}


/* >>> DETALLE DEL FOOTER <<< */
footer span {
  font-size: 0.7em;
  vertical-align: super;
}


/* >>> MENSAJE DE INFO VACÍO <<< */
.mensaje-info {
  text-align: center;
  margin-top: 0.5rem;
  font-size: 1rem;
  color: #444;
}


/* >>> MENSAJE DE INFO VACÍO (ICONO) <<< */
.mensaje-info::before {
  content: "❓ ";
  font-size: 1.2rem;
  margin-right: 0.25rem;
}


/* >>> MENSAJE DE INFO VACÍO (LINK) <<< */
.mensaje-info a {
  color: #005eb8;
  font-weight: 500;
  text-decoration: underline;
}


/* >>> CAJA MENSAJE VACÍO <<< */
.mensaje-vacio-box {
  max-width: 600px;
  margin: 2rem auto 4rem auto;
  background: #f0f4f8;
  border: 1px solid #cce0f5;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  text-align: center;
  color: #333;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}


/* >>> CAJA MENSAJE VACÍO (LINK) <<< */
.mensaje-vacio-box a {
  color: #005eb8;
  font-weight: 500;
  text-decoration: underline;
}

/* Mobile responsive */

/* >>> RESPONSIVE (TABLET) <<< */
@media (max-width: 768px) {
  /* >>> FILTROS DE BÚSQUEDA <<< */
  .filtros {
    flex-direction: column;
    align-items: center;
  }

  /* >>> INPUTS Y SELECTS <<< */
  input, 
  /* >>> SELECT ESPECÍFICO <<< */
  select {
    width: 90%;
  }

  table, thead, tbody, th, td, tr {
    display: block;
    width: 100%;
  }

  /* >>> ENCABEZADO DE TABLA <<< */
  thead {
    display: none;
  }

  tr {
    margin-bottom: 1.2rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 1rem;
    background: white;
  }

  td {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border: none;
    border-bottom: 1px solid #eee;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
  }

  td:last-child {
    border-bottom: none;
  }

  td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #888;
    margin-bottom: 0.1rem;
  }

  /* >>> LINKS DE DESCARGA <<< */
  td a {
    margin: 0.1rem 0;
    word-break: break-word;
    max-width: 100%;
  }

  /* >>> FILTROS DE BÚSQUEDA <<< */
  .filtros {
    padding-top: 0.5rem;
    gap: 0.5rem;
  }

  /* >>> INPUTS Y SELECTS <<< */
  input, 
  select {
    max-width: 500px;
  }

  /* >>> FIX PROPORCIONES <<< */
  td:nth-child(1),
  td:nth-child(2),
  td:nth-child(3) {
    max-width: 100% !important;
    width: auto !important;
  }
}



/* >>> RESPONSIVE (MOBILE) <<< */
@media (max-width: 400px) {
  h1 {
    font-size: 1.2rem;
    text-align: center;
  }

  
/* >>> ENCABEZADO PRINCIPAL <<< */
.header-content {
    flex-direction: column;
    align-items: center;
  }
}

header {
  margin-top: -10rem;
}


/* Logo link y efecto */

/* >>> EFECTO EN EL LOGO <<< */
.header-content a {
  display: inline-block;
}


/* >>> EFECTO HOVER LOGO <<< */
.header-content a:hover {
  opacity: 0.85;
}


/* >>> ESTILO LOGO <<< */
.logo {
  cursor: pointer;
}


/* >>> HOVER LOGO <<< */
.logo:hover {
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}

/* Animación para las filas de tabla */

/* >>> ANIMACIÓN FADEIN <<< */
#tablaLibrerias tbody tr {
  animation: fadeIn 0.3s ease-in;
}


/* >>> KEYFRAMES <<< */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* >>> TOP BANNER PUBLICITARIO <<< */
.top-banner {
  position: relative;
  top: 0;
  left: 0;
  width: 100%;
  height: 40vh;
  background: 
    linear-gradient(rgba(0,0,0,0.45), rgba(0,0,0,0.45)),
    url("https://amproweb.com/support/librerias/header.jpg") center/cover no-repeat;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  z-index: 10;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  padding: 1.2rem 1rem;
}

.top-banner h2,
.top-banner p {
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}



.top-banner-content {
  max-width: 900px;
}

.top-banner h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  margin: 0 0 0.5rem;
}

.top-banner p {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  opacity: 0.9;
}

.banner-btn {
  display: inline-block;
  background: white;
  color: #005eb8;
  padding: 0.6rem 1.4rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.25s ease;
}

.banner-btn:hover {
  background: #f0f0f0;
  transform: translateY(-2px);
}


/* reserva de alto para que el header no quede oculto */
.top-banner-spacer { height: 30vh; }

