@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;700&display=swap');

body,
html {
  background-color: #829db3;
  margin: 0;
  height: 0;
  scroll-behavior: initial;
}

/*Header*/

.header {
  position: relative;
  height: 100px;
  overflow: hidden;
  width: 100%;
  border-bottom: solid 2px #404040;
  background-color: rgba(11, 48, 76, 0.6);

}

.header video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  z-index: -1;
  filter: brightness(0.5);
}

.logo,
nav {
  position: relative;
  z-index: 1;
}

.logo {
  position: absolute;
  top: 1px;
  left: 20px;
  z-index: 1;
}

.log img {
  width: 100px;
  transition: transform 0.3s ease;
}


:root {
  background: rgb(15, 23, 42)
}

/* === NAVEGACIÓN === */
nav {
  position: absolute;
  top: 30px;
  right: 30px;
  z-index: 1;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 30px;
  margin: 0;
  padding: 0;
}

.nav-links li {
  transition: transform 0.2s ease;
}

.nav-links li:hover {
  transform: scale(1.1);
}

.nav-links a {
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  font-size: 18px;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: #aad8ff;
  /* Azul claro al pasar el mouse */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Playfair Display', serif;
  background: linear-gradient(to bottom, var(--blue-light), #caf0f8);
  color: var(--blue-dark);
  min-height: 100vh;
  overflow-x: hidden;
}

.shelf-3 { /* Estilos para la estantería de libros */
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  padding: 40px;
  gap: 30px;
  position: relative;
  z-index: auto;
}

main.shelf-3 {
  min-height: calc(50vh - 130px); /* Ajusta según el alto del header + footer */
  padding-bottom: 60px; /* espacio para que el footer no se solape */
}


.book { /* Estilos para cada libro */
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.3s ease;
  margin-right: 4.2vw;
  z-index: 1;
}

.book:hover {
  transform: scale(1.05);
}

.book img {
  width: 120px;
  height: 180px;
  box-shadow: 2px 4px 10px var(--shadow);
  border-radius: 4px;
}


/* MODAL */
.book-open-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  perspective: 2000px;
}

.book-open {
  display: flex;
  width: 80%;
  max-width: 900px;
  background: var(--paper);
  border-radius: 10px;
  box-shadow: 0 10px 30px var(--shadow);
  animation: openBook 0.5s ease forwards;
  position: relative;
  z-index: 5000;
}

.book-open.closing {
  animation: crumplePaper 0.6s ease forwards;
}

@keyframes openBook { /* Animación de apertura del libro */
  from {
    transform: scale(0.8) rotateY(-20deg);
    opacity: 0;
  }

  to {
    transform: scale(1) rotateY(0);
    opacity: 1;
  }
}

@keyframes crumplePaper { /* Animación de cierre del libro */
  0% {
    transform: scale(1) rotate(0) skew(0);
    opacity: 1;
    filter: blur(0);
  }

  30% {
    transform: scale(0.95) rotate(2deg) skew(3deg);
    filter: blur(1px);
  }

  60% {
    transform: scale(0.7) rotate(-5deg) skew(-3deg);
    filter: blur(2px);
  }

  100% {
    transform: scale(0.3) rotate(10deg) skew(10deg);
    opacity: 0;
    filter: blur(4px);
  }
}
 
.page { /* Estilos para las páginas del libro */
  width: 50%;
  padding: 30px;
  position: relative;
  z-index: 999;
}

.page.left {
  background: #d5d3bf;
  border-right: 5px solid #ccc;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 5px;
}

.page.left img {
  max-width: 300px;
  height: 300px;
  border-radius: 8px;
}

.page.right {
  background: #c7ab75 url('https://www.transparenttextures.com/patterns/paper-fibers.png');
  background-size: cover;
  border-left: 2px dashed #eadcbf;
  padding: 30px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
  font-family: 'Georgia', serif;
  color: #333;
  border-radius: 0 8px 8px 0;
}

.page.right h2 {
  font-size: 2em;
  margin-bottom: 10px;
}

.page.right .author {
  font-style: italic;
  color: #555;
  margin-bottom: 15px;
}

.page.right .description {
  font-size: 1em;
  line-height: 1.6;
}

.buy-btn {
  margin-top: 20px;
  padding: 12px;
  background-color: #c7ab75;
  border: none;
  color: white;
  font-size: 1em;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.buy-btn:hover {
  background: #918244;
}

.close-btn {
  position: absolute;
  top: 30px;
  right: 40px;
  font-size: 2.5em;
  color: white;
  cursor: pointer;
}

.book-open { /* Estilos para el libro abierto */
  display: flex;
  width: 80%;
  max-width: 900px;
  background: var(--paper);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transform-style: preserve-3d;
  animation: bookFlipOpen 0.8s ease forwards;
  perspective: 1500px;
  position: relative;
  transform-origin: left center;
}

@keyframes bookFlipOpen { /* Animación de volteo del libro */
  0% {
    transform: rotateY(90deg) scale(0.8);
    opacity: 0;
  }

  60% {
    transform: rotateY(-20deg) scale(1.02);
    opacity: 1;
  }

  100% {
    transform: rotateY(0deg) scale(1);
  }
}

.footer {
    background: rgba(11, 48, 76, 0.7);
    color: #ffffff84;
    text-align: center;
    width: 100%;
    padding: 20px;
    margin-top: 40px;
    position: static;
}

#book-container { /* Contenedor para los libros */
  display: flex;
  flex-wrap: wrap;  /* permite que los libros pasen a la siguiente línea si no caben */
  gap: 16px;        /* espacio entre libros */
  justify-content: center; /* opcional, para centrar la fila */
}
