/* ====== Estilos globales ====== */
* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f3f4f6;
  color: #222;
}

header {
  background: rgba(20, 33, 61, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  border-bottom: 4px solid #fca311;
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0;
  margin: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  -webkit-transition: all 0.3s ease;
}

header.scrolled {
  background: rgba(20, 33, 61, 0.95);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.navbar-jabrascan {
  background-color: transparent;
  padding: 1rem 2.2rem 1.25rem 2.2rem;
  overflow: visible;
}

.navbar-jabrascan .navbar-nav {
  gap: 0.7rem;
}

.navbar-jabrascan .nav-item {
  margin-bottom: 0.2rem;
  margin-right: 0.2rem;
  margin-left: 0.2rem;
}

.navbar-jabrascan .nav-separator {
  align-self: center;
}

.navbar-jabrascan .nav-search.form-control {
  min-width: 220px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(252, 163, 17, 0.4);
  color: #fff;
  margin-right: 0.5rem;
  margin-left: 0.2rem;
}

.nav-search::placeholder {
  color: rgba(255, 255, 255, 0.8);
}

.nav-search:focus {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-color: rgba(252, 163, 17, 0.8);
  box-shadow: 0 0 0 0.15rem rgba(252, 163, 17, 0.25);
}

.navbar-jabrascan .navbar-brand {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  gap: 0.75rem;
}

.navbar-jabrascan .navbar-brand:hover,
.navbar-jabrascan .navbar-brand:focus {
  color: #fca311;
}

.navbar-jabrascan .navbar-brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(252, 163, 17, 0.8);
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.navbar-jabrascan .brand-text {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.1;
}

.navbar-jabrascan .nav-link {
  color: #fca311;
  font-weight: bold;
  transition: all 0.3s ease;
  -webkit-transition: all 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  position: relative;
}

.navbar-jabrascan .nav-link.active {
  color: #fff;
  background: rgba(252, 163, 17, 0.2);
  text-shadow: 0 0 8px #fca311;
  transform: scale(1.05);
  -webkit-transform: scale(1.05);
}

.navbar-jabrascan .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 3px;
  background: #fca311;
  border-radius: 2px;
  box-shadow: 0 0 10px #fca311;
}

.navbar-jabrascan .nav-link:hover,
.navbar-jabrascan .nav-link:focus {
  color: #fff;
  background: rgba(252, 163, 17, 0.1);
  text-shadow: 0 0 5px #fca311;
  transform: scale(1.03);
  -webkit-transform: scale(1.03);
}

.navbar-jabrascan .nav-link.inactive {
  display: none;
}

.navbar-jabrascan .nav-item.position-relative {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
  padding-bottom: 0.25rem;
}

.navbar-jabrascan .dropdown-menu {
  background: #0f1a33;
  border: 1px solid rgba(252, 163, 17, 0.3);
  border-radius: 0.75rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  padding: 0.5rem;
}

.navbar-jabrascan .dropdown-menu::before {
  content: "";
  position: absolute;
  top: -10px;
  right: 1.5rem;
  width: 18px;
  height: 10px;
  background: linear-gradient(135deg, transparent 50%, #0f1a33 50%), linear-gradient(225deg, transparent 50%, #0f1a33 50%);
  filter: drop-shadow(0 -2px 2px rgba(0, 0, 0, 0.35));
}

.navbar-jabrascan .dropdown-item {
  color: #fca311;
  font-weight: 600;
  border-radius: 0.5rem;
  padding: 0.6rem 1rem;
  transition: all 0.3s ease;
  -webkit-transition: all 0.3s ease;
}

.navbar-jabrascan .dropdown-item:hover,
.navbar-jabrascan .dropdown-item:focus {
  background: rgba(252, 163, 17, 0.2);
  color: #fff;
  transform: translateX(4px);
  -webkit-transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(252, 163, 17, 0.3);
}

.navbar-jabrascan .dropdown-item:active {
  background: rgba(252, 163, 17, 0.3);
}

.navbar-jabrascan .dropdown-toggle.show {
  color: #fff;
  background: rgba(252, 163, 17, 0.2);
  border-radius: 0.5rem;
}

.navbar-jabrascan .dropdown-divider {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.navbar-toggler {
  border-color: rgba(255, 255, 255, 0.3);
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.15rem rgba(252, 163, 17, 0.4);
}

/* ====== Buscador en navbar ====== */
.nav-search.form-control {
  min-width: 220px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(252, 163, 17, 0.4);
  color: #fff;
}

.nav-search::placeholder {
  color: rgba(255, 255, 255, 0.8);
}

.nav-search:focus {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-color: rgba(252, 163, 17, 0.8);
  box-shadow: 0 0 0 0.15rem rgba(252, 163, 17, 0.25);
}

@media (max-width: 991px) {
  .nav-search.form-control {
    min-width: 100%;
    margin-bottom: 0.5rem;
  }
}

/* ====== Main container ====== */
main {
  padding-top: 1rem;
}

/* ====== Paginación ====== */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.pagination-container .page-btn {
  border: 1px solid rgba(252, 163, 17, 0.4);
  background: rgba(20, 33, 61, 0.15);
  color: #fca311;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-container .page-btn:hover {
  background: rgba(252, 163, 17, 0.2);
  color: #fff;
}

.pagination-container .page-btn.active {
  background: rgba(252, 163, 17, 0.3);
  color: #14213d;
  font-weight: 700;
}

.pagination-container .page-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ====== Indicador adulto (badge 18+) ====== */
.indicador-adulto {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid red;
  background-color: white;
  color: red;
  font-size: 0.7em;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

.imagen-contenedor {
  position: relative;
  display: inline-block;
}

.imagen-contenedor:not(.adulto) .indicador-adulto {
  display: none;
}

/* ====== Etiquetas y utilidades ====== */
.etiqueta {
  font-size: 0.8em;
  border-radius: 50px;
  background: blue;
  color: white;
  padding: 0 20px;
  font-weight: bold;
}

.clave {
  display: none;
}

.obra {
  font-weight: bold;
  color: #deb887;
}

.book-latest-chapter {
  place-self: flex-end;
}

.libro-item {
  cursor: pointer;
}

/* ====== Lista de libros / cards ====== */
.book-list {
  justify-content: center;
}

.book-card,
.book-card-main {
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-transition: -webkit-transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.book-card-main:hover {
  transform: translateY(-5px) scale(1.03);
  -webkit-transform: translateY(-5px) scale(1.03);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.book-card-main .card-img-top {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

.book-card-main .imagen-contenedor {
  position: relative;
  width: 100%;
}

.book-card-main .card-title {
  color: #14213d;
  font-weight: 600;
  font-size: 1rem;
}

.book-card-main .card-body {
  font-size: 0.9rem;
  padding: 1rem;
}

.book-author {
  color: #666;
  font-size: 0.9em;
  margin: 0 0 0.5em 0;
}

.book-author-title {
  font-weight: bold;
}

.book-author-name {
  width: 100%;
  font-size: 0.85rem;
  color: #666;
}

.book-sinopsis {
  font-size: 0.98em;
  color: #444;
}

.book-estado {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
}

/* Estados de libro */
.book-estado.En.progreso,
.book-estado.bg-success {
  background-color: #198754 !important;
  color: white;
}

.book-estado.Pausado,
.book-estado.bg-warning {
  background-color: #ffc107 !important;
  color: #000;
}

.book-estado.Finalizado,
.book-estado.bg-secondary {
  background-color: #6c757d !important;
  color: white;
}

/* ====== Ficha / detalle de libro ====== */
.book-detail {
  display: flex;
  gap: 2em;
  align-items: flex-start;
  margin-bottom: 2em;
  background: #fff;
  padding: 2em 1.5em;
  border-radius: 12px;
  box-shadow: 0 2px 10px #0001;
}

.book-detail .cover {
  width: 180px;
  border-radius: 6px;
  box-shadow: 0 4px 12px #0002;
}

/* ====== Lista de capítulos ====== */
.chapter-list {
  background: #fff;
  padding: 1.5em;
  border-radius: 12px;
  box-shadow: 0 2px 10px #0001;
}

.chapter-list h2 {
  margin-top: 0;
}

.chapter-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.chapter-list li {
  margin-bottom: 0.6em;
}

.chapter-list a {
  color: #14213d;
  text-decoration: none;
  font-size: 1.07em;
  transition: color 0.2s;
  -webkit-transition: color 0.2s;
}

.chapter-list a:hover {
  color: #fca311;
}

/* ====== Footer ====== */
footer {
  text-align: center;
  color: #888;
  font-size: 0.95em;
  padding: 2em 0 1em 0;
  margin-top: 4em;
}

/* ====== Carrusel Personalizado ====== */
.custom-carousel {
  position: relative;
  width: 100%;
  margin: 0 auto 2rem;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  background: #222;
  mask-image: radial-gradient(white, black);
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  /* fix recortes en iOS */
}


.custom-carousel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(.77, 0, .18, 1);
  -webkit-transition: -webkit-transform 0.5s cubic-bezier(.77, 0, .18, 1);
}

.custom-carousel-item {
  min-width: 100%;
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  height: 450px;
}

.custom-carousel-item .imagen-contenedor {
  flex: 0 0 auto;
  width: 28%;
  min-width: 180px;
  max-width: 280px;
  position: relative;
  height: 100%;
}

.custom-carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 18px 0 0 18px;
}

.carousel-info-overlay {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(90deg, rgba(20, 33, 61, 0.98) 0%, rgba(20, 33, 61, 0.95) 100%);
  color: #fff;
  padding: 1.2em 1.5em 1em 1.5em;
  border-radius: 0 18px 18px 0;
  gap: 0.6em;
  position: relative;
}

.carousel-info-title {
  font-size: 1.6em;
  font-weight: bold;
  margin: 0;
  cursor: pointer;
}

.carousel-info-sinopsis {
  font-size: 1em;
  color: #e0e0e0;
  margin: 0.5em 0 0.7em 0;
  line-height: 1.3;
  font-style: italic;
  max-height: 4.2em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
}

.carousel-info-row,
.carousel-info-row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6em;
}

.carousel-info-label {
  font-weight: bold;
  color: #fca311;
  margin-right: 0.4em;
}

.carousel-chapter-badge {
  position: absolute;
  bottom: 1em;
  right: 1em;
  background: rgba(20, 33, 61, 0.95);
  border: 2px solid rgba(252, 163, 17, 0.7);
  border-radius: 8px;
  padding: 0.6em 1em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 10;
  max-width: calc(100% - 2em);
}

.carousel-chapter-badge-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4em;
  font-size: 0.9em;
  white-space: nowrap;
}

.carousel-chapter-badge-info span {
  color: #fff;
}

.carousel-chapter-badge-info .cap {
  color: #fca311;
  font-weight: bold;
  font-size: 1.1em;
}

.carousel-chapter-badge-info .fecha {
  color: #ccc;
  font-size: 0.85em;
}

.carousel-chapter-badge-info .tag-capitulo {
  font-size: 0.7em;
  padding: 0.3em 0.6em;
  border-radius: 4px;
  font-weight: bold;
}

.carousel-chapter-badge-info .tag-capitulo.hoy {
  background-color: #28a745;
  color: #fff;
}

.carousel-chapter-badge-info .tag-capitulo.nuevo {
  background-color: #fca311;
  color: #14213d;
}

.custom-carousel-controls {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  transform: translateY(-50%);
  -webkit-transform: translateY(-50%);
  padding: 0 1rem;
}

.custom-carousel-btn {
  background: rgba(20, 33, 61, 0.1) !important;
  border: 2px solid rgba(252, 163, 17, 0.7) !important;
  color: #fca311 !important;
  font-size: 1.5rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50% !important;
  cursor: pointer;
  pointer-events: all;
  transition: all 0.3s ease !important;
  -webkit-transition: all 0.3s ease !important;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.custom-carousel-btn:hover,
.custom-carousel-btn:focus {
  background: rgba(252, 163, 17, 0.8) !important;
  color: #14213d !important;
  border-color: rgba(252, 163, 17, 0.9) !important;
  transform: scale(1.1);
  -webkit-transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(252, 163, 17, 0.5);
}

.custom-carousel-btn:active {
  transform: scale(0.95) !important;
  -webkit-transform: scale(0.95) !important;
}

.custom-carousel-btn:focus-visible {
  outline: 3px solid #fca311;
  outline-offset: 3px;
}

.custom-carousel-btn i {
  font-size: 1.2rem;
  pointer-events: none;
}

/* Posicionamiento específico de los botones */
.custom-carousel-btn.prev {
  margin-left: 0.5rem;
}

.custom-carousel-btn.next {
  margin-right: 0.5rem;
}

/* ====== Estado libro ====== */
.Activo {
  color: #20B2AA;
  font-weight: bold;
}

.Finalizado {
  color: #ff4500;
  font-weight: bold;
}

.Cancelado {
  color: #871F78;
  font-weight: bold;
}

.Pausado,
.Hiatus {
  color: #a9a9a9;
  font-weight: bold;
}

/* ====== Enlaces a capítulos (PDF) ====== */
.pdf-link {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  text-decoration: none;
  color: inherit;
  padding: 6px 4px;
  border-radius: 4px;
  transition: background 0.2s ease;
  -webkit-transition: background 0.2s ease;
}

.pdf-link:hover {
  background: #f0f0f0;
}

.pdf-link span:first-child {
  text-align: left;
}

.pdf-link span:last-child {
  text-align: right;
}

/* ====== Buscador ====== */
.buscador {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  background: #ffebcd;
}

.buscador select,
.buscador input,
.buscador button {
  padding: 0.5em;
  font-size: 1em;
}

.buscador-left,
.buscador-center,
.buscador-right {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ====== Efecto lupa ====== */
/* En escritorio: hover; en móvil: active/touch */
/*.lupa {
  position: relative;
  display: inline-block;
  overflow: hidden;
  cursor: zoom-in;
}
.lupa img {
  display: block;
  transition: transform 0.3s ease;
  -webkit-transition: -webkit-transform 0.3s ease;
}*/
@media (hover: hover) {
  .lupa:hover img {
    transform: scale(2);
    -webkit-transform: scale(2);
  }
}

/* fallback táctiles */
.lupa:active img {
  transform: scale(2);
  -webkit-transform: scale(2);
}

/* ====== Responsivo ====== */
@media (max-width: 900px) {
  .book-card-main {
    max-width: 100%;
  }
}

@media (max-width: 700px) {
  .book-detail {
    flex-direction: column;
    align-items: center;
  }

  .book-detail .cover {
    width: 100%;
    max-width: 230px;
  }

  .book-card,
  .book-detail,
  .chapter-list {
    width: 100%;
  }

  /* Ajustar carrusel para pantallas pequeñas */
  .custom-carousel-item {
    min-height: 280px;
    height: auto;
  }

  .custom-carousel-item .imagen-contenedor {
    width: 40%;
    min-width: 150px;
  }

  .custom-carousel-item img {
    border-radius: 18px 0 0 18px;
  }

  .carousel-info-overlay {
    font-size: 0.85em;
    padding: 0.8em 1em;
    justify-content: flex-start;
  }

  .carousel-info-title {
    font-size: 1.3em !important;
  }

  .carousel-info-sinopsis {
    font-size: 0.9em !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    max-height: 2.6em !important;
  }

  .pdf-link {
    flex-direction: column;
    align-items: flex-start;
  }

  .pdf-link span {
    flex: 1 1 100%;
    text-align: left;
  }
}

@media (max-width: 576px) {

  /* Ajustar carrusel para móviles pequeños */
  .custom-carousel-item {
    min-height: 250px;
    height: auto;
  }

  .custom-carousel-item .imagen-contenedor {
    width: 38%;
    min-width: 130px;
  }

  .carousel-info-overlay {
    font-size: 0.75em;
    padding: 0.6em 0.8em;
    justify-content: flex-start;
  }

  .carousel-info-title {
    font-size: 1.2em !important;
  }

  .carousel-info-sinopsis {
    font-size: 0.85em !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
  }

  .carousel-info-row,
  .carousel-info-row-tags {
    font-size: 0.9em !important;
    gap: 0.4em !important;
  }

  .navbar-jabrascan {
    padding: 0.75rem 1rem;
  }

  .navbar-jabrascan .navbar-brand {
    font-size: 1.6rem;
  }

  .navbar-jabrascan .navbar-brand-logo {
    width: 36px;
    height: 36px;
  }
}

/* ====== Fixes varios iOS ====== */
/* Corrige issues de scroll suave en contenedores largos */
@supports (-webkit-touch-callout: none) {

  .carousel,
  .chapter-list,
  .book-detail {
    -webkit-overflow-scrolling: touch;
  }
}

/*estilos añadidos para mostrar en pantallas pequeñas*/
/* Lista oculta por defecto */
.lista-libros {
  display: none;
  list-style: none;
  padding: 0;
  margin: 0;
}

.item-libro {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1em;
  border-bottom: 1px solid #ccc;
  padding-bottom: 1em;
  cursor: pointer;
}

.item-libro img {
  max-height: 8em;
}

.portada {
  width: 80px;
  height: auto;
  margin-right: 10px;
  object-fit: cover;
}

.info-libro {
  margin-left: 0.5em;
}

.info-libro p {
  margin: 0 0 5px;
}

.info-libro strong {
  font-size: 1.1em;
}

/* Media query: tablets y móviles en iOS */
@media only screen and (max-width: 1200px) {
  body.ios .lista-libros {
    display: block;
  }

  /* Oculta cualquier .libro-item y .book-card-main */
  body.ios .book-list,
  body.ios .libro-item,
  body.ios .book-card-main,
  body.ios .book-card-main.libro-item {
    display: none !important;
  }
}

/*fin estilos para mostrar en pantallas pequeñas*/
/*etiquetas para los capitulos en el  main*/
.tag-capitulo {
  padding: 4px 8px;
  border-radius: 12px;
  font-family: sans-serif;
  font-size: 0.9em;
  color: #FFFFFF;
  display: inline-block;
}

.tag-capitulo.hoy {
  background-color: #28a745;
}

.tag-capitulo.nuevo {
  background-color: #007bff;
}

.hoy-book,
.hoy-book .card {
  border: 2px solid transparent !important;
  border-radius: 12px !important;
}

/* Solo parpadea en pantallas grandes (PC) */
@media (min-width: 768px) {
  .tag-capitulo.hoy {
    animation: parpadeo 2s infinite;
  }

  @keyframes parpadeo {

    0%,
    100% {
      opacity: 1;
    }

    50% {
      opacity: 0.4;
    }
  }

  .hoy-book > article.card {
    animation: bordeParpadeante 2s infinite;
  }

  @keyframes bordeParpadeante {

    0%,
    100% {
      border-color: rgba(40, 167, 69, 0.6) !important;
      /* verde difuminado */
      box-shadow: 0 0 12px rgba(40, 167, 69, 0.5) !important;
    }

    50% {
      border-color: rgba(40, 167, 69, 0.2) !important;
      box-shadow: 0 0 6px rgba(40, 167, 69, 0.2) !important;
    }
  }
}

/*fin etiquetas para los capitulos*/
.chapter-list-ultimos {
  background: #fff;
  padding: 1.5em;
  border-radius: 12px;
  box-shadow: 0 2px 10px #0001;
}

.chapter-list-ultimos h2 {
  margin-top: 0;
}

.chapter-list-ultimos ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.chapter-list-ultimos li {
  margin-bottom: 0.6em;
}

.chapter-list-ultimos a {
  color: #14213d;
  text-decoration: none;
  font-size: 1.07em;
  transition: color 0.2s;
  -webkit-transition: color 0.2s;
}

.chapter-list-ultimos a:hover {
  color: #fca311;
}

.ultcap-chapter {
  justify-content: flex-start;
}

.ultcap-chapter span {
  margin: 0 0.1em 0 0.1em;
  display: block;
}

.book-chapters-list ul li {
  display: flex;
  align-items: right;
  gap: 0.5em;
  /* Espacio entre los spans */
  white-space: nowrap;
  /* Evita el salto de línea */
  overflow: hidden;
  /* Oculta el contenido que se desborda */
}

.book-chapters-list ul li span:last-child {
  flex: 1;
  /* Ocupa el espacio restante */
  overflow: hidden;
  text-overflow: ellipsis;
  /* Muestra "..." si el texto es muy largo */
  white-space: nowrap;
  max-width: 400px;
}

/* Oculta elementos con esta clase en pantallas menores a 768px */
@media screen and (max-width: 768px) {
  .hide-on-mobile {
    display: none !important;
  }
  .book-chapters-list ul li span:last-child {
    overflow: visible;
  }

  /* Botones del carrusel más pequeños en móviles */
  .custom-carousel-btn {
    width: 2.5rem !important;
    height: 2.5rem !important;
    font-size: 1rem !important;
  }

  .custom-carousel-btn i {
    font-size: 0.9rem !important;
  }

  .custom-carousel-controls {
    padding: 0 0.5rem;
  }

  /* Ajustar tamaño de fuentes en carrusel para móvil */
  .carousel-info-title {
    font-size: 1.3em !important;
  }

  .carousel-info-row,
  .carousel-info-row-tags {
    font-size: 0.85em !important;
  }

  .carousel-info-overlay {
    padding: 0.8em 1em !important;
  }

  /* Ajustar el badge del último capítulo en móvil */
  .carousel-chapter-badge {
    bottom: 0.5em !important;
    right: 0.5em !important;
    padding: 0.4em 0.7em !important;
    font-size: 0.85em !important;
  }

  .carousel-chapter-badge-info {
    font-size: 0.8em !important;
    gap: 0.3em !important;
  }

  .carousel-chapter-badge-info .cap {
    font-size: 1em !important;
  }
}

/* Reemplazado por utilidades Bootstrap: usar d-none d-xl-block en HTML */

/* Estilos responsive para el último capítulo leído */
@media (max-width: 991px) {

  /* Ocultar en vista colapsada para evitar problemas de posicionamiento */
  .main-ultimoCapituloleido {
    display: none !important;
  }

  .navbar-jabrascan .nav-item.position-relative {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    padding-bottom: 0;
    position: relative;
  }

  .navbar-jabrascan .nav-item.position-relative .nav-link {
    padding-left: 0.5rem;
  }
}

/*ultimo capitulo leido*/
.main-ultimoCapituloleido {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 0.55rem;
  color: rgba(252, 163, 17, 0.65);
  padding: 0;
  margin-top: 0.1rem;
  background: transparent;
  border-radius: 0;
  z-index: 1;
  pointer-events: none;
  line-height: 1;
  font-weight: 300;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Ocultar cuando está vacío */
.main-ultimoCapituloleido:empty {
  display: none;
}

/*dropdown nav*/
.dropdown-mainnav {
  position: relative;
  display: inline-block;
}

.dropbtn-mainnav {
  background-color: transparent;
  border: none;
  cursor: pointer;
  font-size: inherit;
  padding: 0;
  color: #fff;
}

.dropdown-mainnav-content {
  display: none;
  position: absolute;
  background-color: #f9f9f9;
  min-width: 160px;
  z-index: 1;
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
}

.dropdown-mainnav-content a {
  color: black;
  padding: 10px 16px;
  text-decoration: none;
  display: block;
}

.dropdown-mainnav-content a:hover {
  background-color: #f1f1f1;
}

.dropdown-mainnav:hover .dropdown-mainnav-content {
  display: block;
}

/*loader*/
.loader {
  text-align: center;
  font-size: 1.2rem;
  color: #555;
  margin-bottom: 1rem;
  animation: parpadeo 1s infinite;
}

@keyframes parpadeo {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

canvas#graficaObras {
  display: block;
  width: 100% !important;
  height: auto !important;
  max-width: 100%;
}

/* ====== Estilos para cards de últimos capítulos ====== */
.chapter-card {
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border-radius: 0.5rem;
  background: white;
  overflow: hidden;
}

.chapter-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  border-color: #fca311;
}

.chapter-card .card-body {
  padding: 1.25rem;
  min-height: 200px;
}

.chapter-card .card-title {
  color: #14213d;
  font-weight: 600;
  line-height: 1.2;
  font-size: 0.95rem;
}

.chapter-card .card-text {
  color: #666;
  font-size: 0.85rem;
  line-height: 1.4;
}

.chapter-card .badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.4rem 0.6rem;
}

.chapter-card .btn-primary {
  background-color: #fca311;
  border-color: #fca311;
  color: #14213d;
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
}

.chapter-card .btn-primary:hover {
  background-color: #e8920d;
  border-color: #e8920d;
  color: #14213d;
  transform: none;
  box-shadow: 0 2px 4px rgba(252, 163, 17, 0.3);
}

/* Estilos para la paginación */
#pagination .btn {
  margin: 0 0.2rem;
  min-width: 2.5rem;
}

#pagination .btn-warning {
  background-color: #fca311;
  border-color: #fca311;
  color: #14213d;
}

#pagination .btn-outline-warning {
  border-color: #fca311;
  color: #fca311;
}

#pagination .btn-outline-warning:hover {
  background-color: #fca311;
  border-color: #fca311;
  color: #14213d;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .chapter-card .card-body {
    padding: 1rem;
    min-height: 180px;
  }

  .chapter-card .card-title {
    font-size: 0.9rem;
  }
}

@media (max-width: 576px) {
  .chapter-card .card-body {
    padding: 0.875rem 0.75rem;
    min-height: 160px;
  }

  .chapter-card .card-title {
    font-size: 0.85rem;
  }

  .chapter-card .btn-primary {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  #pagination .btn {
    min-width: 2rem;
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
  }

  #pagination .mx-2 {
    margin-left: 0.5rem !important;
    margin-right: 0.5rem !important;
  }

}

.brand-iconos {
  margin-left: 0.5rem;
  transition: opacity 0.3s ease;
  background: transparent;
  border: none;
}
.user-avatar {
  max-width: 4em;
}
/* Evita problemas de fondo en móvil */
/* Ajustes SOLO en móvil (pantallas <= 768px) */
@media (max-width: 768px) {
  body {
    background-attachment: scroll !important; /* evita glitches en móvil */
  }

  .brand-iconos {
    font-size: 0.9em;   /* más pequeño en móvil */
    margin-left: 0.3rem;
  }
  .user-avatar {
    max-width: 3em;
  }
  .carousel-info-row-tags {
    display: none;
  }
}
@media (max-width: 991px) {
  .navbar-jabrascan {
    padding: 0.7rem 0.7rem 0.7rem 0.7rem;
  }

  .navbar-jabrascan .navbar-nav {
    gap: 0.2rem;
  }

  .navbar-jabrascan .nav-search.form-control {
    min-width: 100%;
    margin-bottom: 0.5rem;
    margin-right: 0;
    margin-left: 0;
  }

  .navbar-jabrascan .nav-item {
    margin-bottom: 0.3rem;
    margin-right: 0.1rem;
    margin-left: 0.1rem;
  }

  .carousel-info-row-tags {
    display: none;
  }
}
