body {
  background-color: rgb(232, 215, 248);
  font-family: Arial, sans-serif;
  margin-top: 160px; /* dejamos espacio para la top-bar */  

}
/* body del index.html */
.body{ 
  font-family: Arial, Helvetica, sans-serif;
  background-image: url("../image/fondo.png"); /* ruta del fondo*/
  background-size: cover; /* Asegura que la imagen cubra todo el elemento */
  background-repeat: no-repeat; /* Evita que la imagen se repita */
  background-attachment: fixed; /* Fija la imagen para que no se mueva al hacer scroll */
  background-position: center; /* Centra la imagen */
  margin-top: 0px !important;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
}

main{
  margin-top: 150px;
}

/* Botones */
button{
    border: none; 
    color: black; 
    padding: 10px 10px; 
    cursor: pointer; 
    border-radius: 10px;
    background-color: #007bff; 
    margin: 5px;               
}

button:hover{
  background-color: #ffca2c;
  transform: scale(1.03);    
}

.menu-botones {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 🔹 3 columnas iguales */
  gap: 20px; /* separación entre botones */
  width: 80%;
  margin: 50px auto;
  text-align: center;
  margin: auto;
}

.boton {
  width: 80%;
  padding: 15px;
  background: #f5b027;
  border: 2PX solid black;
  border-radius: 10px;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
  transition: transform 0.2s, background 0.3s;
  margin: 10px auto;
}

.boton img {
  width: 20%;
  max-width: 50px;
}

.boton:hover {
  transform: scale(1.05);
  background: #ffca2c;
  border: 3px solid black;
  border-radius: 20px;
  color: black;
  background-color: rgba(183, 4, 4, 0.8);
  opacity: 0.8;  
}

/* Responsive: en móvil se ve en una sola columna */
@media (max-width: 768px) {
  .menu-botones {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}


/*----------------------------------------------------PAGINA PRINCIPAL----------------------------------------*/

/*------------CAMBIO DE PASSWORD--------------------*/
/* -------------- FORMULARIO ------------------ */
.formPass {
    max-width: 400px;
    margin: 20px auto;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 10px;
    background-color: #f9f9f9;
}

.formPass-group {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.formPass-group label {
    width: 150px;
    margin-right: 10px;
    text-align: right;
}

.input-peq {
    width: 200px;
    padding: 5px;
    box-sizing: border-box;
}

.pass-container {
    position: relative;
    display: inline-block;
}

.toggle-pass {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 18px;
    user-select: none;
    opacity: 0.7;
}

.toggle-pass:hover {
    opacity: 1;
}

button.volver {
    width: 100px;
    margin-bottom: 20px;
}

input[type="submit"] {
    padding: 8px 15px;
    cursor: pointer;
}

/*---------------------------------------------FIN CAMBIO DE PASSWORD----------------------------------------*/

/*------------------- VENTANA EMERGENTE DE BUSCAR LIBRO---------*/
#popup {
    display: none;
    position: fixed; 
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0; 
    background-color: rgba(0,0,0,0.5); 
    z-index: 10; 
}
.contenido { 
    background: white; 
    width: 300px; 
    margin: 10% auto; 
    padding: 20px; 
    border-radius: 10px; 
    text-align: center; 
    box-shadow: 0 0 10px rgba(0,0,0,0.3); 
}
/*----------------input de entrada de datos en ventana buscar libro---------*/
.inputt { 
    padding: 8px; 
    width: 80%; 
}
/*------------------------------------------------------------------FIN PRINCIPAL-----------------------------*/


/* MOVIL */ 
@media (max-width:768px){
  .contenido {
    margin-top: 200px;
  }
}





/*-----------------------------ESTILOS DE LA TOP-BAR-------------------------------------*/
/* --- BARRA SUPERIOR --- */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 130px;
    background: url("../image/top-barr.png") no-repeat center / cover;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    box-sizing: border-box;
}

/* --- LOGO (IZQUIERDA) --- */
.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Busca el logo y sustituye/añade esto */
.logo-container img.logo {
    width: 150px !important;  /* Fuerza el ancho */
    max-width: 150px !important;
    height: auto !important;  /* Mantiene la proporción */
    object-fit: contain;      /* Evita que se deforme */
    display: block;
}
.logo-container button.logo {
    background: transparent;
    border: none;
    color: red;
    font-size: 30px;
    font-family: 'Patrick Hand', cursive;
    cursor: pointer;
    text-shadow: 1px 1px 2px black;
}

/* --- LINKS (DERECHA EN PC) --- */
.top-bar .links {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: -60px;
}

.top-bar .links a, 
.top-bar .links .dropbtn {
    color: black;
    padding: 8px 12px;
    text-decoration: none;
    font-size: 16px;
    /* Intentamos cargar Montserrat, si no está, usamos la fuente por defecto del sistema (sans-serif) */
    font-family: 'Montserrat', sans-serif; 
    font-size: 16px; /* A veces 17px es demasiado grande para menús de móvil */
    letter-spacing: 0.5px; /* Mejora la legibilidad al reducir la fuente */
    font-weight: 700;
    border-radius: 20px;
    white-space: nowrap;
    background: transparent;
    border: none;
    cursor: pointer;
}


.top-bar .links a:hover, 
.top-bar .links .dropbtn:hover {
    background-color: #575757;
    color: red;
}

.top-bar .links a.active, 
.top-bar .links .dropbtn.active {
    background-color: #f5b027 !important;
    border: 2px solid black;
    color: red !important;
}

/* --- DROPDOWN AJUSTES --- */
.dropdown { position: relative; }
.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background: white;
    min-width: 200px;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0,0,0,0.2);
    z-index: 2000;
}
.dropdown-content a {
    display: block;
    color: black !important;
    background: #90D5FF;
    border-radius: 0;
    text-align: left;
}
.dropdown:hover .dropdown-content { display: block; }

/* --- ICONO HAMBURGUESA (CORREGIDO) --- */
.hamburger {
    display: none; /* Oculto en PC */
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 5px;
}

.hamburger span {
    display: block;
    height: 3px;
    width: 30px;
    background: black; /* Color de las rayitas */
    border-radius: 3px;
    transition: 0.3s;
}







/* --- RESPONSIVE (MÓVIL) --- */
/* --- RESPONSIVE PROFESIONAL (MÓVIL) --- */
@media screen and (max-width: 850px) {
    .hamburger {
        display: flex;
        margin-right: 15px;
    }

    .top-bar .links {
        display: none; 
        position: absolute;
        top: 130px; 
        right: 10px; 
        width: 250px; 
        background: rgba(255, 255, 255, 0.98);
        border-radius: 15px;
        border: 1px solid #ddd;
        flex-direction: column;
        padding: 10px 0; /* Un poco menos de padding vertical */
        box-shadow: 0 10px 25px rgba(0,0,0,0.3);
        z-index: 999;
        box-sizing: border-box; /* IMPORTANTE: incluye el padding en el ancho */
    }

    /* Mostrar menú con animación */
    .top-bar.responsive .links {
        display: flex;
        animation: fadeIn 0.3s ease-out;
    }

    /* Estilo de los links dentro del panel */
    .top-bar .links a, 
    .top-bar .links .dropbtn {
        width: calc(100% - 40px); /* Restamos el padding lateral */
        padding: 12px 20px;
        text-align: left;
        border-radius: 8px; /* Pequeño redondeo interno */
        margin: 2px 20px; /* Centra el bloque dentro del contenedor */
        color: #333;
        display: block; /* Asegura que ocupen toda la fila */
        box-sizing: border-box;
    }

    .top-bar .links a:hover,
    .top-bar .links .dropbtn:hover {
        background: #f0f0f0;
        color: red;
    }
}

/* --- CORRECCIÓN FINAL PARA MÓVIL --- */
@media screen and (max-width: 850px) {
    /* Forzamos el logo a un tamaño pequeño en móvil */
    .logo-container img.logo {
        width: 80px !important;    /* Tamaño pequeño específico para móvil */
        height: auto !important;
        margin-left: 0 !important;
        margin-top: 0 !important;
        display: block !important;
    }

    /* Aseguramos que el contenedor no se estire */
    .logo-container {
        flex-shrink: 0 !important;
    }
}




@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}





/* --- Base (por defecto: oculto para móvil) --- */
.nav-links {
  display: none;
  flex-direction: row;
  position: absolute;
  top: 60px;
  right: 10px;
  background: rgba(0, 64, 128, 0.95);
  padding: 15px;
  border-radius: 0 0 8px 8px;
  z-index: 1000;
}
.nav-links.active {
  display: flex;
}
.nav-links a {
  text-decoration: none;
  font-weight: bold;
  color: #444;
  font-size: 18px;
  position: relative;
  transition: color 0.3s, transform 0.3s;
  white-space: nowrap;   /* evita que las palabras se partan */  
}
.nav-links a:hover {
  color: #ffcc00;
  transform: scale(1.15);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 0;
  height: 2px;
  background: #ffcc00;
  transition: width 0.3s;
}
.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}
nav a.active {
  color: red; /* color rojo al estar en la pagina activa */
}

.contenedor-libros {/* espacio listado libros almacen*/
  display:grid; 
  grid-template-columns:repeat(4,1fr); 
  gap:15px; width:100%; 
  margin-top:20px; 
  justify-content:center; }

.contenedor {
  width: auto;
  height: 500px;
  background-color: lightblue;
  border: 5px solid black;
  justify-content: center
}

/* Estilos generales para inputs */
input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 12px 20px;
  margin: 8px 0;
  display: block; /* para que margin auto funcione si quieres centrar */
  border: 1px solid #ccc;
  border-radius: 5px;
  box-sizing: border-box;
  background-color: white; /* fondo blanco */
  color: black; /* texto negro */
  font-size: 16px;
}

/* Placeholder visible */
input::placeholder {
  color: gray;
  opacity: 1;
}

/* Botón Login en el modal */
button[type="submit"] {
  background-color: #04aa6d;
  color: white;
  border: none;
}

button[type="reset"] {
  background-color: #f44336;
  color: white;
  border: none;
}

button.volver {
    width: 100px;
    margin-bottom: 20px;
}

/* Extra styles for the cancel button */
.cancelbtn {
  width: auto;
  padding: 10px 18px;
  background-color: #f44336;
}

img.avatar {
  display: block; /* importante para centrar con margin auto */
  margin: 0 auto; /* centra horizontalmente */
  width: 50%;
  border: 1px solid black; /* borde de la imagen 'avatar' policia */
  border-radius: 20px;
}

.marco img {
  width: 10%;
  border: 6px solid transparent;
  border-radius: 20px;
  background: linear-gradient(135deg, #ffcc00, #ff6f00);
  padding: 6px;
  box-shadow: 0 4px 20px rgba(255, 111, 0, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.marco img:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 25px rgba(255, 111, 0, 0.6);
}

.container {
  padding: 16px;
}
.container2 {/* contendor de resultado en listPedidos.php*/
  display: flex;
  align-items: center;
  justify-content: center;
  --hue: 220deg;
  --width: 2rem;
  --accent-hue: 22deg;
  --duration: 0.6s;
  --easing: cubic-bezier(1, 0, 1, 1);
}
span.psw {
  float: right;
  padding-top: 16px;
}






/*ANIMACION ZOOM RECUADRO EMERGENTE TOMA DE DATOS DNI CONTRASEÑA */

.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 70px;  /* espacio para top bar */
  left: 0;
  right: 0;
  margin: 0 auto;
  width: 90vw;
  max-width: 350px;
  max-height: calc(100vh - 80px);
  background-color: rgba(0, 0, 0, 0.4);
  overflow-y: auto;
  padding: 10px 0;
  box-sizing: border-box;
}

.modal-content {
  background-color: #fefefe;
  margin: 0 auto;
  border: 5px solid #888;
  width: 100%;  /* ocupa todo el ancho del modal */
  max-height: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  padding: 20px;
  overflow-y: auto;
}

/* The Close Button (x) */
.close {
  position: absolute;
  right: 25px;
  top: 0;
  color: #f5ac3f;
  font-size: 80px;
  font-weight: bold;
}

.close:hover,
.close:focus {
  color: red;
  cursor: pointer;/* cambiamos el tipo de cursor a una 'mano' */
}

/*Animación de zoom  */
.animate {
  -webkit-animation: animatezoom 2s; /* compatibilidad con navegadores antiguos */
  animation: animatezoom 2s;/* Navegadores modernos */
}
.bodyFicha{
    background-color: lightblue;
    margin-top: 150px;
}

/* ---- RESPONSIVO ---- */
@media (max-width: 768px) {
  .modal {
      width: auto;
  }
}


@-webkit-keyframes animatezoom { /* animación para navegadores antiguos */
  from {
    -webkit-transform: scale(0);
  }
  to {
    -webkit-transform: scale(1);
  }
}

@keyframes animatezoom { /* animación para navegadores modernos */
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}

/* cambia los estilos para apertura y cierre del modal o ventan emergente */
@media screen and (max-width: 300px) {
  span.psw {
    display: block;
    float: none;
  }
  .cancelbtn {
    width: 100%;
  }
}
/* ********************************************************************************************* */

/*ESTILOS PARA EL LOADER*/

/* Overlay y loader centrado */
#overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
}

#loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  animation: spin 1.5s linear infinite;
  z-index: 9999;
}

@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}
/* Overlay2 con spinner ofertas.php */
#overlay2 {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    flex-direction: column;
    color: #00ff00;
    font-family: Arial, sans-serif;
}

/* ********************************************************************************************** */
/* -----------------------stilos espacio buscar libro-----------------*/
.grid-libros {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 columnas iguales */
  gap: 25px;
  justify-content: center;
  justify-items: center;
  align-items: start;
  padding: 30px;
  overflow: visible;/*Permitir que la tarjeta “flote” sobre la grid*/
  margin: 20px 0;
}

/*-------------------------------------------ESPACIO HISTÓRICO CLIENTE---------------------------------------*/
.tablaHistorico {
  width: 100%;
  border-collapse: collapse;
  font-family: Arial, sans-serif;
  font-size: 14px;
}

/* Encabezados */
.tablaHistorico th {
  background-color: #4a4a4a;
  color: #fff;
  padding: 10px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #333;
}

/* Celdas */
.tablaHistorico td {
  padding: 8px 10px;
  border-bottom: 1px solid red;
}

/* Filas alternas */
.tablaHistorico tr:nth-child(even) {
  background-color: #f6f6f6;
}

/* Hover */
.tablaHistorico tr:hover {
  background-color: #eaeaea;
  transition: background 0.2s ease;
}

/* ---- RESPONSIVO ---- */
@media (max-width: 768px) {
  .tablaHistorico {
      width: 100%;
  }
}




/*-------------------------------------------FIN ESPACIO HISTÓRICO CLIENTE------------------------------------*/

/*-------------------------------------------ESPACIO CUENTAS DEL AGENTE---------------------------------------*/
 
/* CONTENEDOR DE LA TABLA */
.tablaCuentas {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 20px auto;
  font-family: Arial, sans-serif;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0px 4px 10px rgba(0,0,0,0.1);
}

/* CABECERA */
.tablaCuentas th {
  background: #2d67b1;       /* azul profesional (puedo cambiarlo) */
  color: white;
  padding: 12px 15px;
  text-align: left;
  font-size: 15px;
  font-weight: bold;
}

/* CELDAS */
.tablaCuentas td {
  padding: 10px 15px;
  border-bottom: 1px solid #e5e5e5;
  font-size: 14px;
}

/* ÚLTIMA FILA SIN BORDE */
.tablaCuentas tr:last-child td {
  border-bottom: none;
}

/* FILA PAR (efecto color zebra) */
.tablaCuentas tr:nth-child(even) {
  background: #f7f9fc;
}

/* EFECTO HOVER */
.tablaCuentas tr:hover {
  background: #e8f1ff;
  transition: 0.2s;
}

/* OPCIONAL: CENTRAR COLUMNAS NUMÉRICAS */
.tablaCuentas td.numero {
  text-align: center;
}

/* OPCIONAL: CELDAS IMPORTANTES */
.tablaCuentas td.resaltado {
  font-weight: bold;
  color: #1a4f8a;
}

/*-------------------------------------------------FIN ESPACIO CUENTAS DEL AGENTE------------------------------*/

/* -------------------------------- ESPACIO MOSTRAR LIBROS BUSCADOS PARA PEDIR-------------------------------- */
.caja {
  position: relative;
  overflow: auto;
  max-width: 280px; 
  width: 100%;
  border: 2px solid #ccc;
  border-radius: 10px;
  padding: 15px;
  background-color: #f8f8f8;
  box-shadow: 5px 5px 10px rgba(0,0,0,0.3); 
  transition: transform 0.45s cubic-bezier(0.25, 0.8, 0.25, 1), 
              box-shadow 0.45s cubic-bezier(0.25, 0.8, 0.25, 1);
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
  z-index: 1;
  cursor: pointer; /* indica que se puede clicar */
  height: auto;
  min-height: 500px;
}

.caja:hover {
  box-shadow: 0 10px 30px rgba(255,255,200,0.5), 0 0 25px rgba(255,255,150,0.3);
  transform: scale(1.2); /* zoom más notable */
  box-shadow: 
      0 15px 35px rgba(255, 255, 200, 0.6),   /* sombra principal */
      0 0 40px rgba(255, 255, 180, 0.4),      /* resplandor */
      0 0 60px rgba(255, 255, 150, 0.3);      /* brillo difuso */
}


/* ---- CONTENIDO DENTRO DE LA TARGETA---- */
.caja img {
  display: block;
  margin: 10px auto;
  box-shadow: 5px 5px 10px rgba(0,0,0,0.75);
  border-radius: 5px;
}

h3 {
  margin: 5px 0;
  font-size: 1rem;
}
/*--------------------------- DESPLEGABLE ARGUMENTO DEL LIBRO-------------------------*/
details {
  margin-top: 10px;
}

/* ---- Animación de apertura del argumento ---- */
.caja details[open] p {
  animation: slideFadeIn 0.4s ease forwards;
}

.caja details summary {
  list-style: none;
  cursor: pointer;
  font-weight: bold;
  text-align: center;
}

.caja details summary::marker {
  display: none;
}

/* ---- ANIMACIÓN DE ENTRADA ---- */
@keyframes fadeInUp {
  from {
      opacity: 0;
      transform: translateY(20px);
  }
  to {
      opacity: 1;
      transform: translateY(0);
  }
}

/* ------------ANIMACION DE ENTRADA DE CUADROS DE LIBROS  A PANTALLA EN FORMA ESCALONADA ------------------------ */
.caja:nth-child(1) { animation-delay: 0.1s; }
.caja:nth-child(2) { animation-delay: 0.2s; }
.caja:nth-child(3) { animation-delay: 0.3s; }
.caja:nth-child(4) { animation-delay: 0.4s; }
.caja:nth-child(5) { animation-delay: 0.5s; }
.caja:nth-child(6) { animation-delay: 0.6s; }

/* ---- RESPONSIVO ---- */
@media (max-width: 768px) {
  .grid-libros {
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}
/* efecto fade */
@keyframes slideFadeIn {
  from {
      opacity: 0;
      transform: translateY(-8px);
  }
  to {
      opacity: 1;
      transform: translateY(0);
  }
}
.whatsappd button {
  background-color:#25D366; 
  color: white; font-size: large;
  padding: 10px 20px; border: none; 
  border-radius: 10px; cursor: pointer; }
.whatsappd button:hover { 
  background-color:#1EBE57;
 }
/* ---------------------------------ESTILOS DEL LOADER O ANIMACION DE ESPERA --------------------------- */

#loader {
  position: fixed !important;  /* asegura que ignora contenedores relativos */
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none; /* oculto por defecto */
  justify-content: center;
  align-items: center;
  z-index: 999999; /* por encima de todo 
  background: rgba(255, 255, 255, 0.2);*/
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#loader.active {
  display: flex;
  opacity: 1;
  visibility: visible;
}

.loader-ring {/*animacion  loader de espera*/
  width: 70px;
  height: 70px;
  border: 6px solid transparent;
  border-top: 6px solid #25D366;
  border-right: 6px solid #25D366;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;

}

#spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(0,255,0,0.2);
    border-top: 6px solid #00ff00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}
/* EFECTO ROTACION DEL SPINER */
@keyframes spin {
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}

/*---------------------------------------------------- ESPACIO FICHA CLIENTE----------------------------------------------*/

/* ESTILOS BASICOS DEL MODAL O VENTANA EMERGENTE PARA PEDIDOS*/
.modal1 {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
}

.modal1-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 20px;
  width: 300px;
  border-radius: 10px;
  text-align: center;
}


.boton1{
    background-color: #30cc2e;
}
.boton2{
    background-color: red;
}
/*---------------------------------------------ESPACIO MENU-REVISTAS----------------------------------------*/
/* Contenedor principal */
.revistas-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  padding: 20px;
  box-sizing: border-box;
}

/* Tarjeta de revista */
.revista-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  width: 200px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  overflow: hidden;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  padding: 12px;
}

/* Imagen de la revista */
.revista-card img {
  width: 100%;
  border-radius: 10px;
  transition: transform 0.3s ease;
}

/* Texto debajo de la imagen */
.revista-card p {
  margin-top: 10px;
  font-family: 'Segoe UI', sans-serif;
  font-size: 17px;
  color: #333;
  transition: color 0.3s ease;
}

/* Efecto hover (animación) */
.revista-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.25);
}
.revista-card:hover img {
  transform: scale(1.05);
}
.revista-card:hover p {
  color: #007bff;
}

/* Adaptación para móviles */
@media (max-width: 768px) {
  .revistas-container {
      gap: 16px;
  }
  .revista-card {
      width: 45%; /* 2 por fila */
  }
}

/*---------------------------------------------FIN ESPACIO MENU-REVISTAS--------------------------------*/

/*---------------------------------------------INICIO ESPACIO OFERTAS--------------------------------------*/
.card {
  background: #fff; 
  border-radius: 8px; 
  padding: 12px; 
  box-shadow: 0 2px 6px rgba(0,0,0,0.2); 
  display:flex; 
  flex-direction:column; 
  align-items:flex-start; 
  height:500px; width:100%; 
  box-sizing:border-box; 
  font-family: Arial, sans-serif; 
  height: auto;
  }
.card img {
  width:40%; 
  height:auto; 
  max-height:200px; 
  object-fit:cover; 
  border-radius:4px; 
  margin-bottom:10px; 
  position:relative; }
.card h3 {
  margin:3px 0; 
  font-size:14px; 
  line-height:1.2;
  word-break: break-word; /*controla cómo se rompen las palabras en una línea cuando el texto es demasiado largo para caber en su contenedor. */
  }
.card button {
  margin-top:10px; 
  padding:5px 12px; 
  cursor:pointer; }

/*---------------------------------------------FIN ESPACIO OFERTAS-----------------------------------------*/



/*---------------------------------------------ESPACIO AÑADIR AGENTE------------------------------------*/
/* Botón volver */
.volver {
  width: 100px;
  margin: 0 0 20px 20px;
  padding: 8px;
  cursor: pointer;
  border-radius: 5px;
  border: none;
  background-color: #f5b027;
  color: #000;
  font-weight: bold;
}

.volver:hover {
    background-color: #e0a017;
}

/* Formulario */
.form {
  max-width: 1500px;
  margin: 0 auto 50px auto;
  padding: 20px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

fieldset {
  border: none;
}
table {
  width: 100%;
  border-collapse: collapse;
}


th, td {
  padding: 8px;
  text-align: left;
}

th {
  background-color: #f2f2f2;
}
input[type="text"], select, textarea, input[type="password"] {
  width: 100%;
  padding: 6px 8px;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 5px;
}
textarea {
  resize: vertical;
  min-height: 60px;
}

/* Fecha de alta más visible */
input.fecha-alta {
  font-size: 1.1rem;
  font-weight: bold;
  text-align: center;
  width: 200px;
}

/* Botón enviar */
input[type="submit"] {
  display: inline-block;
  padding: 10px 20px;
  background-color: #f5b027;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  margin-top: 15px;
}

input[type="submit"]:hover {
  background-color: #e0a017;
}
/* Contenedor para input + ojo */
.pass-container {
  position: relative;
}

.toggle-pass {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 18px;
  user-select: none;
  opacity: 0.7;
}

.toggle-pass:hover {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
  table, tr, td, th {
      display: block;
      width: 100%;
  }

  th {
      margin-top: 15px;
  }

  td input, td select, td textarea {
      width: 100%;
      margin-top: 5px;
  }

  .volver {
      margin-left: auto;
      margin-right: auto;
      display: block;
  }
}

/*---------------------------------------------FIN ESPACIO AÑADIR AGENTE--------------------------------*/

/*---------------------------------------------ESPACIO INSERTAR LIBRO--------------------------------*/

form {
  background: white;
  padding: 10px 20px;
  max-width: 500px;
  margin: auto;
  border-radius: 12px;
  box-shadow: 0 0 12px rgba(0,0,0,0.1);
    
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  width: 120px;
  padding: 8px 8px;
  vertical-align: top;
  font-weight: bold;
  font-size: 12px;
  color: #444;
}

td {
  padding: 10px 0;
}

/* ===== INPUTS ===== */
input[type="text"],
input[type="date"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 8px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 12px;
  transition: 0.2s;
  box-sizing: border-box;
}

input[type="radio"] {
  margin-right: 6px;
}

input:focus, textarea:focus, select:focus {
  border-color: #4a90e2;
  outline: none;
  box-shadow: 0 0 4px rgba(74,144,226,0.4);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

/* ===== COLORES DINÁMICOS (PHP) ===== */
.ok     { background-color: #dcfca2 !important; }
.error  { background-color: #ffb3b3 !important; }

/* ===== BOTÓN ===== */
input[type="submit"] {
  background: #4a90e2;
  color: white;
  padding: 8px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  margin-top: 5px;
  transition: 0.2s;
}

input[type="submit"]:hover {
  background: #357ac8;
}

/* Imagen de portada */
.portada {
  max-height: 140px;
  display: block;
  margin-bottom: 10px;
}


/* estilos para el formulario de entrada de datos de libros nuevos */
.formulario {
width: 100%;
max-width: 500px;
margin: 80px auto;
padding: 30px 25px;
background: #fff8e1; /* fondo cálido */
border-radius: 15px;
box-shadow: 0 4px 20px rgba(0,0,0,0.15);
text-align: center;
font-family: 'Poppins', sans-serif;
}

.formulario h2 {
color: #f5b027;
margin-bottom: 25px;
}

.campo {
margin-bottom: 20px;
text-align: left;
}

.campo label {
display: block;
margin-bottom: 8px;
font-weight: 600;
color: #444;
}

.campo input {
width: 100%;
padding: 12px;
border: 2px solid #f5b027;
border-radius: 8px;
font-size: 16px;
outline: none;
transition: all 0.3s ease;
}

.campo input:focus {
border-color: #ffca2c;
box-shadow: 0 0 5px rgba(245,176,39,0.5);
}

/*  Responsive */
@media (max-width: 768px) {
.formulario {
    padding: 20px;
}
}

/*---------------------------------------------FIN ESPACIO INSERTAR LIBRO---------------------------------------------*/

/*---------------------------------------------ESPACIO LIBROS PENDIENTES DE RECIBIR------------------------------------*/

/* =================== TABLA DE RESULTADOS =================== */


/* la caja de cada tabla */
.tabla-box{
  border:1px solid #ddd;
  border-radius:10px;
  padding:10px;
  overflow:auto;      /* evita que algo se salga */
  box-sizing:border-box;
  /*width: 150%;*/
}

/* colores de la tabla segun agente*/
/* Colores por agente */
.agente-3 td { background-color: #f8d7da; } /* rojo suave */
.agente-4 td { background-color: #d4edda; } /* verde suave */
.agente-5 td { background-color: #d1ecf1; } /* azul suave */


/* asegurar que nada se salga */
table, tr, td{
  box-sizing:border-box;
  max-width:100%;
  box-shadow:0 2px 6px rgba(0,0,0,0.08);
}

table{
width:100%;
border-collapse:collapse;

}

th,td{
padding:8px;
border:1px solid #ddd;
}

/* linea de estado */

.estado-pendiente{
border-left:6px solid #f0ad4e; /* amarillo */
}

.estado-almacen{
border-left:6px solid #5bc0de; /* azul */
}




/* MOVIL */ 
@media (max-width:768px){
  .thead {
    display: none; /* SOLO en móvil */
  }

.tabla-box {
    overflow-x: auto;       /* Permite scroll si la tabla es más ancha */
    width: 100%;            /* Ocupa todo el contenedor */
    border-left: 6px solid #000; /* tu color */
     
}

.tabla-box table {
    width: 100%;        /*    La tabla ocupa el 100% del div */
    table-layout: fixed;    /* Forzar columnas iguales y no romper */
    word-wrap: break-word;  /* Que el texto largo se parta */
    border-collapse: collapse;
}

.tabla-box th,
.tabla-box td {
    padding: 8px;
    text-align: left;
    word-break: break-word; /* rompe palabras largas */
}


table thead{
display:none;
}

table, tbody{
display:block;
width:100%;
}

tr{
display:block;
margin-bottom:15px;
border:1px solid #ddd;
border-radius:8px;
background:white;
padding:10px;
}

/* cada celda se convierte en fila */
td{
display:flex;
gap:10px;
border:none;
padding:6px 0;
word-break:break-word;
}

/* etiqueta */
td::before{
content:attr(data-label);
font-weight:bold;
min-width:110px;
flex-shrink:0;
color:#444;
}
/* colores de la tabla en funcion del agente*/
    /* Aplica el fondo directamente a los td */
    tr.agente-3 td { background-color: #f8d7da; }
    tr.agente-4 td { background-color: #d4edda; }
    tr.agente-5 td { background-color: #d1ecf1; }


}



/*---------------------------------------------FIN ESPACIO  LIBROS PENDIENTES DE RECIBIR--------------------------------*/

/*---------------------------------------------ESPACIO  LISTADO PEDIDOS-------------------------------------------------*/
table {
  border-collapse: collapse;
 
}

th {
  background-color: #f2f2f2;
  color: #333;
  font-weight: bold;
}

tr:nth-child(even) {
  background-color: #fafafa;
}

tr:nth-child(odd) {
  background-color: #ffffff;
}

td, th {
  padding: 8px;
  border: 1px solid #ddd;
}
.togglesw {
  display: none;
}
.switch {
  --shadow-offset: calc(var(--width) / 20);
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  width: var(--width);
  height: calc(var(--width) / 2.5);
  border-radius: var(--width);
  box-shadow: inset 10px 10px 10px hsl(var(--hue) 20% 80%),
    inset -10px -10px 10px hsl(var(--hue) 20% 93%);
}

.button {
  position: absolute;
  z-index: 1;
  width: 55%;
  height: 80%;
  left: 5%;
  border-radius: 100px;
  background-image: linear-gradient(160deg, hsl(var(--hue) 20% 95%) 40%, hsl(var(--hue) 20% 65%) 70%);
  transition: all var(--duration) var(--easing);
  box-shadow: 2px 2px 3px hsl(var(--hue) 18% 50% / 80%),
      2px 2px 6px hsl(var(--hue) 18% 50% / 40%),
      10px 20px 10px hsl(var(--hue) 18% 50% / 40%),
      20px 30px 30px hsl(var(--hue) 18% 50% / 60%);
}

.button::before, 
.button::after {
  content: '';
  position: absolute;
  top: 10%;
  width: 41%;
  height: 80%;
  border-radius: 100%;
}

.button::before {
  left: 5%;
  box-shadow: inset 1px 1px 2px hsl(var(--hue) 20% 85%);
  background-image: linear-gradient(-50deg, hsl(var(--hue) 20% 95%) 20%, hsl(var(--hue) 20% 85%) 80%);
}

.button::after {
  right: 5%;
  box-shadow: inset 1px 1px 3px hsl(var(--hue) 20% 70%);
  background-image: linear-gradient(-50deg, hsl(var(--hue) 20% 95%) 20%, hsl(var(--hue) 20% 75%) 80%);
}

.togglesw:checked ~ .button {
  left: 40%;
}

fieldset{
  width: 750px;
  border-radius: 7px;
  border-color: darkgoldenrod; 
}
/* POSICIONAMIETO EN PANTALLA DE LOS FIELDSET (izquierda Y LA TABLA (derecha)*/
.contenedor-flex {
  display: flex;
  gap: 20px;               /* separación entre columnas */
  align-items: flex-start; /* top-aligned */
  width: 100%;
}

.bloque-left {
  flex: 1;                 /* ocupa mitad izquierda */
}

.bloque-left fieldset {
  margin-bottom: 15px;     /* separación vertical entre fieldsets */
}

.bloque-right {
  flex: 1;                 /* ocupa mitad derecha */
}

.bloque-right table {
  width: 100%;
  border-collapse: collapse;
}

.bloque-right th, .bloque-right td {
  padding: 8px;
  text-align: left;
}
/*---------------------------------------------FIN ESPACIO  LISTADO PEDIDOS---------------------------------------------*/
/*---------------------------------------------INICIO ESPACIO  NOMINAS--------------------------------------------------*/
/* ------------------- VARIABLES DE COLOR ------------------- */
:root {
  --bg: #f0f2f5;
  --modal-bg: #fff;
  --text: #333;
  --text-light: #555;
  --input-bg: #f7f7f7;
  --primary: #6a5af9;
  --primary-grad: linear-gradient(135deg, #6a5af9, #877aff);
}

/* ------------------- BOTÓN ABRIR MODAL ------------------- */
.open-modal-btn {
  padding: 12px 20px;
  background: var(--primary-grad);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: 0.3s;
}

.open-modal-btn:hover {
  transform: translateY(-2px);
}

/* ------------------- MODAL ------------------- */
.modal2 {
  display: none; /* IMPORTANTE: debe estar oculto al inicio */
  position: fixed;
  z-index: 99;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
  z-index: 999999;
}

/* ------------------- CONTENIDO MODAL ------------------- */
.modal2-content {
  background: var(--modal-bg);
  width: 90%;
  max-width: 400px;
  padding: 25px;
  border-radius: 18px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  animation: slideIn .35s ease forwards;
  color: var(--text);
  position: relative;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(40px); }
}

/* ------------------- BOTÓN CERRAR ------------------- */
.close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
  color: var(--text-light);
  transition: 0.3s;
}

.close:hover {
  color: var(--primary);
}

/* ------------------- FORMULARIO ------------------- */
#uploadForm {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Labels */
#uploadForm label {
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 5px;
}

/* Inputs */
#uploadForm input[type="text"],
#uploadForm input[type="file"] {
  padding: 12px;
  border-radius: 10px;
  border: 2px solid #5553;
  background: var(--input-bg);
  color: var(--text);
  cursor: pointer;
  transition: 0.3s;
}

#uploadForm input[type="text"]:focus,
#uploadForm input[type="file"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 5px rgba(106,90,249,0.5);
}

/* ------------------- BOTÓN SUBMIT ------------------- */
#uploadForm button[type="submit"] {
  width: 100%;
  padding: 12px;
  background: var(--primary-grad);
  border: none;
  border-radius: 10px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
}

#uploadForm button[type="submit"]:hover {
  background: linear-gradient(135deg, #877aff, #6a5af9);
  transform: translateY(-2px);
}

/* ------------------- VISTA PREVIA IMAGEN ------------------- */
#preview {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  margin-bottom: 15px;
  border-radius: 10px;
  display: none; /* Se muestra con JS cuando se carga la imagen */
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ------------------- BARRA DE PROGRESO ------------------- */
.progress {
  width: 100%;
  background: #eee;
  height: 20px; /* más gruesa */
  border-radius: 10px;
  margin-top: 15px;
  display: none; 
}

.progress-bar {
  height: 100%; /* ocupa toda la altura del contenedor */
  background: var(--primary);
  width: 0%;
  border-radius: 10px;
  transition: width 0.3s ease;
}


.pdf-container {
  display: flex;
  gap: 25px;
  flex-wrap: wrap;
  margin-top: 20px;
  font-family: Arial, sans-serif;
}

.pdf-column {
  background: #f4f4f8;
  border-radius: 12px;
  padding: 15px 20px;
  width: 240px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.pdf-column h3 {
  margin-top: 0;
  color: #333;
  font-size: 20px;
  border-bottom: 2px solid #ccc;
  padding-bottom: 5px;
}

.pdf-column ul {
  list-style: none;
  padding-left: 0;
  margin-top: 12px;
}

/* Enlaces con imagen */
.pdf-column a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: white;
  color: #0077cc;
  text-decoration: none;
  border-radius: 8px;
  transition: 0.25s;
  border: 1px solid #ddd;
  width: 200px;
}

.pdf-column a:hover {
  background: #0077cc;
  color: white;
  border-color: #0070c9;
}

/* Imagen del icono PDF */
.pdf-icon {
  width: 22px;
  height: 22px;
}
/*---------------------------------------------FIN ESPACIO  NOMINAS-----------------------------------------------------*/