* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  display: grid;
  place-content: center;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: #1e1e1e;
  color: #fff;
  opacity: 0.8;
  background-image: radial-gradient(#2e2e2e 1px, #1e1e1e 1px);
  background-size: 10px 10px;
  font-family: "Open Sans", sans-serif;
}

.flipbook {
  width: 990px;
  height: 700px;
  visibility: hidden;
}

.black {
  background-color: #000;
  border-radius: 8px;
}

.shadow-right {
  width: 100%;
  max-width: 600px;
  mask-image: linear-gradient(to left, black 80%, transparent 120%);
  -webkit-mask-image: linear-gradient(to left, black 80%, transparent 120%);
}

.shadow-left {
  width: 100%;
  max-width: 600px;
  mask-image: linear-gradient(to right, black 80%, transparent 120%);
  -webkit-mask-image: linear-gradient(to right, black 80%, transparent 120%);
}

.page img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: auto;
  border-radius: 8px;
  user-select: none;
  -webkit-user-drag: none;
}

.book {
  position: relative;
  width: 990px;
  margin: 0 auto;
  --text-w: clamp(300px, 34vw, 700px);
  z-index: 1000;
}

.botones {
  position: fixed;
  top: 50%;
  left: 0;
  width: 100%;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  z-index: -9999;
}

button {
  border: 2px solid #fff;
  background-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 10px 20px;
  border-radius: 500px;
  cursor: pointer;
  margin: 10px;
  transition: 0.3s ease-in-out;
  width: 100px;
  height: 100px;
  font-family: "Open Sans", sans-serif;
}

button:hover {
  background-color: #fff;
  color: #1e1e1e;
}

.text {
  position: absolute;
  display: grid;
  place-content: center;
  width: var(--text-w);
  border: 2px solid #fff;
  border-radius: 16px;
  padding: 24px;
  top: 90px;
  left: calc(460px - var(--text-w));
  z-index: 9999;
  pointer-events: auto;
}

.text h3 {
  margin-bottom: 20px;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 20px;
  letter-spacing: 1px;
  text-align: left;
}

.alineado-izquierda { margin-right: auto; }
.alineado-centro { margin: 0 auto; }

.text p {
  font-size: 15px;
  line-height: 19px;
  margin-bottom: 20px;
}

.logo img {
  height: 32px;
  position: absolute;
  left: calc(460px - (var(--text-w) / 2));
  top: 40px;
  transform: translateX(-50%);
  margin: 0;
}

.logo a.logo-biobio {
  position: absolute;
  left: calc(460px - (var(--text-w) / 2));
  top: -5px; 
  transform: translateX(-50%);
  z-index: 10001;
  display: block;
}

.logo a.logo-biobio img {
  position: static;
  transform: none;
  left: auto;
  top: auto;
  height: 25px;
  margin: 0;
  filter: brightness(0) invert(1);
}

.text a {
  display: block;
  text-align: left;
  margin-bottom: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  margin-left: 45px;
  position: relative;
}

.text a:hover { text-decoration: underline; }

.text a:hover::before {
  content: "";
  position: absolute;
  left: -50px; 
  top: 50%;
  transform: translateY(-50%) rotate(45deg); 
  width: 20px; 
  height: 20px;
  border-top: 2px solid rgba(255, 255, 255, 0.59);
  border-right: 2px solid rgba(255, 255, 255, 0.59);
}

a.inactivo {
  pointer-events: none !important; 
  cursor: default !important;
  color: #888888 !important; 
  opacity: 0.5 !important; 
  text-decoration: none !important; 
}

.covers-track a.inactivo {
  pointer-events: none !important; 
  cursor: default;
}

.covers-track a.inactivo img {
  filter: grayscale(100%) opacity(60%) !important; 
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 999999;
  overflow: auto;
}

#modalImage {
  display: block;
  margin: 0;
  position: absolute;
  top: 20px; 
  left: 50%;
  transform-origin: center center;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
}

#modalImage.dragging { cursor: grabbing; }
.close { display: none; }
.mobile-carousel { display: none; }


.covers-container {
  position: fixed;
  bottom: 0px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px; 
  z-index: 9999;
  pointer-events: none; 
}

.covers-wrapper, .covers-container button {
  pointer-events: auto; 
}

.covers-wrapper {
  flex: none;
  width: calc(100vw - 220px);
  max-width: 1050px; 
  margin: 0;
  overflow: hidden;
  touch-action: pan-y;
  padding: 20px 0 0 0;
  margin-top: -px;
}

.covers-track {
  opacity: 1;
  display: flex;
  gap: 40px;
  transition: transform 0.4s ease-in-out;
  align-items: flex-end;
  justify-content: flex-start;
  height: auto;
}

.covers-track a {
  flex: 0 0 140px;
  width: 140px;
  display: block;
  margin: 0;
  transform: translateY(65%);
  opacity: 1;
  position: relative;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s ease;
}

.covers-track:hover a {
  transform: translateY(70%); 
}

.covers-track a:hover {
  transform: translateY(60%) scale(1.05); 
  z-index: 10;
}

.covers-track img {
  width: 150px;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.6);
}

.covers-container button {
  width: 80px;
  height: 80px;
  padding: 5px;
  margin: 0;
  font-size: 13px;
  flex-shrink: 0;
  position: relative; 
  z-index: 100;
  bottom: auto;
  transform: translateY(68px); 
}

.covers-container button:first-of-type { left: auto; }
.covers-container button:last-of-type { right: auto; }

@media only screen and (max-width: 1270px) {

  .botones {
    display: none;
  }
}

@media only screen and (max-width: 1200px) {
  
  .flipbook,
  .text {
    display: none ;
  }

  .botones{
    visibility: hidden;
    opacity: 0;
    pointer-events: none
  }

  .book {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
  }

  .botones {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
  }

  .logo {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: static;
    height: 80px;
    width: 100%;
    margin: 0;
    z-index: 10000;
  }
  
  .logo img {
    position: static; 
    margin: 0;
    left: auto;
    top: auto;
    transform: none;
  }

  .logo a.logo-biobio {
    position: static;
    transform: none;
    margin-bottom: -5px;
  }

  .mobile-carousel {
    display: flex;
    width: 100vw;
    height: calc(100vh - 200px); 
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .mobile-carousel img {
    flex: 0 0 100%;
    width: 00vw;
    height: 100%;
    object-fit: contain;
    scroll-snap-align: start;
  }
  
  .page-counter {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    z-index: 99999;
  }

  .covers-wrapper {
      width: calc(100vw - 140px); 
  }

  .covers-container button {
      width: 50px;
      height: 50px;
      font-size: 9px;
      transform: translateY(55px); 
  }
}