/* ====================================================== */
/*         Estilos GLOBAL (aplicables a todas las pantallas)        */
/* ====================================================== */

/* ===== Botón de Favoritos (Marcador) ===== */
.ib-favorite-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  outline: none;
  overflow: visible;
  -webkit-tap-highlight-color: transparent;
}

/* Forzar transparencia absoluta para evitar fondos heredados */
button.ib-favorite-button,
.ib-favorite-button {
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  outline: none !important;
  appearance: none !important;
}

/* Si hubiera pseudo-elementos con color de fondo, los eliminamos */
button.ib-favorite-button::before,
button.ib-favorite-button::after {
  background: none !important;
  content: none !important;
}

/* Por si algún inline-style aplica fondo verde */
button.ib-favorite-button[style] {
  background: transparent !important;
}

/* Iconos regular y solid dentro del botón de favoritos */
.ib-favorite-button .icon-regular svg,
.ib-favorite-button .icon-solid svg {
  width: 32px;
  height: 32px;
  fill: #1D3557;
  stroke: #1D3557;
  transition: fill 0.3s, stroke 0.3s, transform 0.3s;
  transform-origin: center;
}

/* Hover: agranda un poco y oscurece el ícono */
.ib-favorite-button:hover .icon-regular svg,
.ib-favorite-button:hover .icon-solid svg {
  transform: scale(1.1);
  fill: #102240;
  stroke: #102240;
}

/* Mostrar el SVG solid cuando el botón esté marcado */
.ib-favorite-button[data-added="true"] .icon-regular {
  display: none;
}
.ib-favorite-button[data-added="true"] .icon-solid {
  display: inline-block;
}

/* Cuando NO está marcado, mostrar el SVG regular y ocultar el solid */
.ib-favorite-button[data-added="false"] .icon-regular {
  display: inline-block;
}
.ib-favorite-button[data-added="false"] .icon-solid {
  display: none;
}

/* Quitar cualquier fondo en hover, focus y active */
.ib-favorite-button:hover,
.ib-favorite-button:focus,
.ib-favorite-button:active {
  background: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.modal-login-aviso {
    position: fixed;
    z-index: 11000 !important; /* Más alto que el modal de versículo */
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-login-aviso-content {
    background: #fff;
    padding: 20px 30px;
    border-radius: 8px;
    max-width: 400px;
    text-align: center;
    font-size: 1.1em;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    margin: 250px 0 !important;
    line-height: 2 !important; /* Espacio vertical entre líneas */
}

.modal-login-aviso-content p {
    margin: 20px 0 !important;
}

#modal-login-close {
    padding: 8px 20px;
    border: none;
    background-color: #0073aa;
    color: white;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
}

#modal-login-close:hover {
    background-color: #005177;
}


/* ====================================================== */
/*           Estilos para DESKTOP / TABLET (>=768px)      */
/* ====================================================== */
@media (min-width: 768px) {
  #ib-frontend-container {
    margin-bottom: 20px;
    font-family: "Roboto", sans-serif; 
  }

  /* 🔹 Base: Ajuste de alineación */
  .ib-field {
      display: flex !important;
      align-items: center;
      gap: 5px;
      margin-bottom: 5px;
  }

  /* 🔹 Ajuste para que los títulos no tengan demasiada separación */
  .ib-field label {
      font-weight: bold !important; 
      white-space: nowrap !important; 
      margin-right: 12px !important; /* Ajusta la separación del título con su input */
  }

  /* 🔹 Agregar margen solo a "Libro" y "Capítulo" sin afectar "Testamento" y "Pasaje" */
  .ib-field:nth-child(2) label,
  .ib-field:nth-child(3) label  {
      margin-left: 20px !important;
  }

  .ib-field:first-child {
      flex-grow: 1;
      min-width: 220px;
      max-width: 300px;
  }

  .ib-field:nth-child(2) {
      flex: 0 0 282px;
  }

  /* 🔹 Ajuste del tamaño del input de "Capítulo" */
  .ib-field.small {
      max-width: 85px !important;
  }

  /* 🔹 Ajuste del tamaño de los inputs */
  .ib-field select,
  .ib-field input {
      width: 100% !important;
      height: 40px !important;
      font-size: 18px !important;
      padding: 8px !important;
      border: 2px solid #aaa !important;
      border-radius: 6px !important;
      transition: border-color 0.3s ease-in-out;
      appearance: none !important;
  }

  /* 🔹 Ajustar altura de Tom Select */
  .ts-wrapper {
      width: 100% !important;
      height: 40px !important;
  }

  /* 🔹 Ajustar altura y centrado del control de Tom Select */
  .ts-wrapper .ts-control {
      height: 45px !important;
      font-size: 18px !important;
      display: flex;
      align-items: center;
  }

  /* 🔹 Reducir la separación entre opciones en los dropdowns */
  .ts-dropdown-content .option {
      font-size: 14px !important;
      padding: 6px 10px !important;
  }

  /* 🔹 Asegurar que Pasaje se extienda todo el ancho */
  .ib-field.full-width {
      width: 100% !important;
      max-width: 100% !important;
  }

  /* 🔹 Aumentar el tamaño de la fuente en las opciones desplegables */
  .ts-dropdown .ts-dropdown-content .option {
      font-size: 17px !important;
      padding: 10px 12px !important;
  }

  /* 🔹 Mantener el mismo tamaño de fuente en el input seleccionado */
  .ts-control {
      font-size: 17px !important;
  }

  /* 🔹 Mantener oculto el input interno de Tom Select */
  .ts-control input {
      display: none !important;
  }

  .ib-grid {
      max-width: 750px;
      margin: 0 auto;
      display: flex;
      flex-direction: column;
      gap: 5px;
  }

  .ib-row {
      display: flex;
      align-items: center;
      gap: 8px;
  }

  /* 🔹 Asegurar que el input "Capítulo" no se expanda demasiado */
  .ib-field.small {
      max-width: 85px !important;
  }

  #ib-pasaje {
      width: 100% !important;
  }

  /* 🔹 Ajuste del tamaño de "Capítulo" */
  #ib-capitulo {
      border: 1px solid #aaa !important;
      border-radius: 4px !important;
      max-width: 55px !important;
      width: 55px !important;
      padding: 8px !important;
      height: 45px !important;
      text-align: center;
      font-size: 18px !important;
      margin-top: 5px !important;
      transition: border-color 0.3s ease-in-out;
  }

  #ib-capitulo[readonly] {
      border-color: #ccc !important;
      cursor: pointer !important;
      outline: none !important;
      box-shadow: none !important;
  }

  /* ====================================================== */
  /* Tabla de Capítulos (similar a la de Versículos)        */
  /* ====================================================== */
  #ib-capitulo-table {
    width: 100%;
    margin-top: 5px;
    display: flex;
    justify-content: center;
    cursor: pointer !important;
  }

  #ib-capitulo-table table.chapter-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 8px;
  }

  #ib-capitulo-table table.chapter-table td.chapter-cell {
    width: 35px;
    height: 35px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fdfdfd;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    color: #333;
  }

  #ib-capitulo-table table.chapter-table td.chapter-cell:hover {
    background: #0073aa;
    color: #fff;
  }

  #ib-contenido {
      max-width: 768px;
      margin: 0 auto;
  }

  /* 🔹 Ajustes extra fuera de media query móvil */
  #ib-libro + .ts-wrapper {
      width: 100% !important;
      max-width: 274px !important;
  }

  #ib-libro + .ts-wrapper .ts-control {
      display: flex !important;
      align-items: center !important;
      justify-content: flex-start !important;
      padding: 1px 15px !important;
      line-height: 40px !important;
      overflow: hidden !important;
      white-space: nowrap !important;
  }

  #ib-libro + .ts-wrapper .ts-control input {
      display: inline-block !important;
      width: auto !important;
      height: 100% !important;
      min-width: 1px !important;
      max-width: 100% !important;
      flex-grow: 1 !important;
      opacity: 1 !important;
      border: none !important;
      outline: none !important;
      background: transparent !important;
      font-size: inherit !important;
      color: inherit !important;
      padding: 0 !important;
      text-align: left !important;
      white-space: nowrap !important;
      overflow: hidden !important;
  }

  /* Botones de navegación (Desktop / Tablet) */
  .ib-navigation {
      display: flex !important;
      justify-content: space-between !important;
      align-items: center !important;
      margin: 10px 0 !important;
      padding: 5px 0 !important;
  }

  .ib-nav-btn {
      display: inline-flex !important;
      flex-direction: column !important; /* Para que en desktop también aparezcan en 2 líneas */
      align-items: center !important;
      justify-content: center !important;
      padding: 5px 5px !important;
      font-size: 16px !important;
      font-weight: bold !important;
      color: #fff !important;
      background-color: #005f8d !important;
      border: none !important;
      border-radius: 8px !important;
      transition: background-color 0.3s ease, transform 0.2s ease !important;
      cursor: pointer !important;
      text-transform: uppercase !important;
      min-width: 150px !important;
      text-align: center !important;
  }

  .ib-nav-btn:hover {
      background-color: #0073aa !important;
      transform: translateY(-2px) !important;
  }

  .ib-nav-btn:active {
      transform: translateY(0) !important;
  }

  .ib-nav-text {
      font-size: 14px !important;
      font-weight: bold !important;
      text-transform: uppercase !important;
      opacity: 0.9 !important;
  }

  .ib-nav-abreviatura {
      font-size: 12px !important;
      font-weight: normal !important;
      opacity: 0.7 !important;
      margin-top: 4px !important;
      text-align: center !important;
  }
}

.modal-login-aviso-content {
    background: #fff;
    padding: 20px 30px;
    border-radius: 8px;
    max-width: 600px;
    max-height: 80vh; /* Limita la altura para activar scroll */
    text-align: center;
    font-size: 1.1em;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);

    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.modal-login-aviso-text {
    overflow-y: auto;
    margin-bottom: 20px;
    flex-grow: 1;  /* Ocupa todo el espacio posible para scroll */
}

#modal-login-close {
    padding: 8px 20px;
    border: none;
    background-color: #0073aa;
    color: white;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0; /* No se encoge */
}

#modal-login-close:hover {
    background-color: #005177;
}



/* ====================================================== */
/*           Estilos para MÓVIL (<768px)                 */
/* ====================================================== */
@media (max-width: 767px) {
  #ib-frontend-container {
      margin-bottom: 20px;
      font-family: "Roboto", sans-serif; 
  }

  /* 🔹 Base: Alinear títulos y expandir inputs */
  .ib-grid {
      display: flex;
      flex-direction: column;
      width: 100%;
  }

  .ib-field {
      display: flex;
      align-items: center;
      margin-bottom: 15px;
  }

  /* 🔹 Ajuste para que los títulos no tengan demasiada separación */
  .ib-field label {
      font-weight: bold;
      white-space: nowrap;
      margin-right: 15px !important;
  }

  .ib-field select,
  .ib-field input,
  .ts-wrapper {
      flex-grow: 1;
      width: 100% !important;
      max-width: 100% !important;
      height: 44px !important;
      font-size: 18px !important;
      padding: 10px !important;
      border: 1px solid #aaa !important;
      border-radius: 5px !important;
      transition: border-color 0.3s ease-in-out;
      appearance: none !important;
      background: white !important;
  }

  /* 🔹 Eliminar borde doble en Tom Select */
  .ts-wrapper {
      border: none !important;
      padding: 0 !important;
  }

  .ts-wrapper .ts-control {
      height: 44px !important;
      font-size: 18px !important;
      display: flex;
      align-items: center;
      border: 1px solid #aaa !important;
      border-radius: 5px !important;
      background: white !important;
      padding: 5px 12px !important;
  }

  /* 🔹 Ajustar tamaño de opciones desplegables */
  .ts-dropdown .ts-dropdown-content .option {
      font-size: 18px !important;
      padding: 10px 15px !important;
  }

  /* 🔹 Ajustar la estructura del campo "Libro" */
  #ib-libro + .ts-wrapper {
      flex-grow: 1 !important;
      width: 100% !important;
      max-width: 100% !important;
  }

  /* 🔹 Ajustar alineación del texto dentro de los inputs */
  #ib-libro + .ts-wrapper .ts-control {
      display: flex !important;
      align-items: center !important;
      justify-content: flex-start !important;
      padding: 1px 15px !important;
      line-height: 44px !important;
      overflow: hidden !important;
      white-space: nowrap !important;
      margin-bottom: 10px !important;
  }

  /* 🔹 Mantener oculto el input interno de Tom Select por defecto */
  .ts-control input {
      display: none !important;
      opacity: 1 !important;
  }

  /* 🔹 Mostrar el input interno solo para "Libro" */
  #ib-libro + .ts-wrapper .ts-control input {
      display: inline-block !important;
      color: #333 !important;
      width: auto !important;
      min-width: 1px !important;
      padding: 0 !important;
  }

  /* 🔹 Asegurar que la fila de Pasaje se mantenga en línea */
  .ib-field.full-width {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 5px !important;
  }

  .ib-field.full-width label {
      flex-shrink: 0;
      font-weight: bold;
      white-space: nowrap;
  }

  /* 🔹 Ajustar el input de pasaje con altura fija */
  .ib-field.full-width .ts-control {
      height: 70px !important;
      line-height: 1.6 !important;
      font-size: 18px !important;
      padding: 12px !important;
      border: 1px solid #aaa !important;
      border-radius: 5px !important;
      background: white !important;
      white-space: normal !important;
      overflow: hidden !important;
      text-overflow: ellipsis !important;
      margin-bottom: 5px !important;
  }
  
  /* 🔹 Hacer que SOLO el dropdown de Pasaje abarque todo el ancho del frontend */
  .ib-field.full-width .ts-dropdown {
      width: calc(100vw - 36px) !important;
      max-width: none !important;
      left: 35% !important;
      transform: translateX(-50%) !important;
      position: absolute !important;
      margin-top: 28px !important;
      z-index: 9999 !important;
  }

  /* 🔹 Ajustar tamaño y espaciamiento de las opciones del dropdown de Pasaje */
  .ib-field.full-width .ts-dropdown .ts-dropdown-content .option {
      font-size: 18px !important;
      padding: 12px 20px !important;
      line-height: 1.6 !important;
      word-wrap: break-word !important;
      white-space: normal !important;
  }

  /* 🔹 Ajustar la posición y ancho de los inputs */
  #ib-testamento,
  #ib-libro,
  #ib-capitulo,
  #ib-pasaje {
      width: 100% !important;
      font-size: 18px !important;
  }

  /* 🔹 Asegurar que Capítulo esté debajo de Libro */
  #ib-libro {
      order: 1;
      width: 100% !important;
  }

  #ib-capitulo {
      order: 2;
      text-align: center;
      margin-bottom: 0.5px !important;
      transition: border-color 0.3s ease-in-out;
  }

  #ib-capitulo[readonly] {
      border-color: #aaa !important;
      cursor: pointer !important;
      outline: none !important;
      box-shadow: none !important;
  }

  #ib-pasaje {
      order: 3;
  }

  /* ====================================================== */
  /* Tabla de Capítulos (similar a la de Versículos)        */
  /* ====================================================== */
  #ib-capitulo-table {
    width: 100%;
    margin-top: 5px;
    display: flex;
    justify-content: center;
    cursor: pointer !important;
  }

  #ib-capitulo-table table.chapter-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 8px;
  }

  #ib-capitulo-table table.chapter-table td.chapter-cell {
    width: 35px;
    height: 35px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fdfdfd;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    color: #333;
  }

  #ib-capitulo-table table.chapter-table td.chapter-cell:hover {
    background: #0073aa;
    color: #fff;
  }

  #ib-contenido {
      max-width: 100%;
  }
  
  .ib-citation:hover {
    text-decoration: underline;
}

  /* ================= Botones de navegación en Móvil ================= */
  .ib-navigation {
      display: flex !important;
      justify-content: space-between !important;
      align-items: center !important;
      margin: 10px 0 !important;
      padding: 5px 0 !important;
  }

  /* Revertimos a flex-direction: column para que se vea el texto en 2 líneas */
  .ib-nav-btn {
      display: inline-flex !important;
      flex-direction: column !important; /* Texto en 2 líneas */
      align-items: center !important;
      justify-content: center !important;
      padding: 4px 4px !important;
      font-size: 16px !important;
      font-weight: bold !important;
      color: #fff !important;
      background-color: #005f8d !important;
      border: none !important;
      border-radius: 8px !important;
      transition: background 0.3s ease !important, transform 0.2s ease !important;
      cursor: pointer !important;
      text-transform: uppercase !important;
      min-width: 120px !important;
      text-align: center !important;
  }

  .ib-nav-btn:hover {
      background-color: #0073aa !important;
      transform: translateY(-2px) !important;
  }

  .ib-nav-btn:active {
      transform: translateY(0) !important;
  }

  .ib-nav-text {
      font-size: 14px !important;
      font-weight: bold !important;
      text-transform: uppercase !important;
      opacity: 0.9 !important;
  }

  .ib-nav-abreviatura {
      font-size: 12px !important;
      font-weight: normal !important;
      opacity: 0.7 !important;
      margin-top: 4px !important;
      text-align: center !important;
  }

  /* Orden específico para los botones, si se requiere */
  #btn-anterior, #btn-anterior-bajo {
      order: 1;
  }

  #btn-siguiente, #btn-siguiente-bajo {
      order: 2;
  }
  
  .modal-login-aviso-content {
    margin: 0 15px;  /* margen lateral para que no toque bordes */
    max-width: calc(100% - 30px); /* ajustar ancho máximo al 100% menos márgenes */
    padding: 20px 15px; /* reducir un poco padding horizontal */
  }
}


/* ───────────────────────────────────────────────────── */
/* TomSelect: forzar siempre centrado vertical, sin salto */
/* ───────────────────────────────────────────────────── */
.ts-wrapper .ts-control,
.ts-wrapper .ts-control .item,
.ts-wrapper .ts-control .placeholder {
  /* fijamos altura exacta igual a la del input */
  height: 44px !important;
  /* quitamos cualquier padding extra */
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  /* alineamos el contenido verticalmente */
  display: flex !important;
  align-items: center !important;
  /* evitamos cambios de line-height */
  line-height: normal !important;
}

/* También anulamos estilos que TomSelect aplica sólo en foco */
.ts-wrapper .ts-control.ts-control-focus {
  /* por si mete box-shadow o padding distinto */
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  box-shadow: none !important;
}

.rs {
  color: #b22222; /* solo rojo */
  font-style: normal; /* NO forzar cursiva aquí */
}

/* Si dentro del texto en rojo hay <i> o <em>, ellos sí hacen la cursiva */
.rs i,
.rs em {
  font-style: italic;
}

#ib-texto h1,
#ib-texto h2,
#ib-texto h3 {
    line-height: 0.5 !important;      /* Ajusta a lo que desees */
    margin-bottom: 1em !important;   /* Reduce margen inferior */
    margin-bottom: 1em !important;
    text-indent: 0 !important;
}


