* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: 'Lato', sans-serif;
  background-color: #C5B7D8;
  color: #333;  
}
.container {  
  display: flex;
  flex-wrap: wrap;
  max-width: 1200px;  
  margin: 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
}
.text-section {
  flex: 1 1 500px;
}
.menu-section {    
    width: 100%;
    height: 60px;
    margin-top: 20px;
}
.menu-section .btn {
    padding: 8px 22px;
}
.menu-section .buttons {
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.text-section h1 {
  font-size: 4rem;
  margin-bottom: 20px;
  color: white;  
}
.subtitle {
  font-size: 2rem;
  margin-bottom: 40px;
  color: white;  
}
.buttons {
  display: flex;
  gap: 20px;
}
.btn {
  text-decoration: none;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: bold;
  transition: background 0.3s ease;
}
.comprar {  
  background: linear-gradient(to right, #7E6BA0, #E3BFD6);
  color: white;
}

.comprar:hover {
  opacity: 0.9;
}
.iniciar {
  background: linear-gradient(to right, #7E6BA0, #E3BFD6);
  color: white; 
}
.descargar:hover {
  background-color: #f7f7f7;
}
.image-section {
  flex: 1 1 300px;
  display: flex;
  justify-content: center;
}
.image-section img {   
  width: 350px;
  height: auto; 
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
  margin-top: 1px; /* ajusta este valor según el alto del subtítulo */
}

.main {
  background-color: white;
  color: black;  
  margin-top: 120px;
  display: grid;
  grid-template-areas:
    "sinopsis ficha"
    "comment form";
  grid-template-columns: 1fr 1fr;
  gap: 90px;
  padding: 80px;
}
.main h2 {
  font-weight: 400;
  padding-bottom: 10px;
}
.sinopsis-libro {
  grid-area: sinopsis;
  text-align: justify;
}
.ficha-libro {
  grid-area: ficha;
}
.comment-libro {
  grid-area: comment;
}
.form-pdf-libro {
  grid-area: form;
  flex-direction: column; /*solo para boton de PDF*/
  align-items: center;
  text-align: center;
}

.form-pdf-libro h2 {
  text-align: center;
  margin-bottom: 1.8rem;
}
form {
  background: #f7f4ff;
  border-radius: 0.3rem;
  padding: 1.3rem;
  width: 80%;
  margin: 2rem auto;
  box-shadow: 12px 12px 5px 0px rgba(0, 0, 0, 0.08);
}
input {
  width: 100%;
  background: #f5f5f5;
  border: 0;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 10px;
  border: 1px solid #eee;
}
.btn2 {
  width: 100%;
  padding: 12px;
  border: 0;
  background: #c3b6e2;
  font-size: 1.1em;
  color: #fff;
  text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.4);
  box-shadow: 0px 3px 0px #ac9ad7;
  margin-top: 1.2rem;
  border-radius: 0.25rem;
}
.btn2:hover {
  color: #fff;
  background: #8a70c6;
  border-color: #a18cd1;
}
.iniciar:hover {
  color: #fff;
  background: #8a70c6;
  border-color: #a18cd1;
}
.form-control {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  line-height: 1.25;
  color: #55595c;
  background-color: #f9f9f9;
  background-image: none;
  -webkit-background-clip: padding-box;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0.25rem;
}
.form-pdf-libro .btn2 {
  cursor: pointer;
} 
.margin-below {
  margin-bottom: 1.2rem;
}
.form-control:focus {
  border-color: #7743ff;
  box-shadow: inset 0 1px 1px rgba(45, 45, 45, 0.07),
    0 0 8px rgba(129, 129, 129, 0.6);
}
/*@media (max-width: 905px) {
  .container {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
  }
  .menu-section {
    order: -1;
  }}*/

@media (max-width: 768px) {
  .main {
    margin-top: 45px;   
    gap: 40px;
    padding: 35px 20px;
    grid-template-areas:
      "sinopsis"
      "ficha"
      "comment"
      "form";
    grid-template-columns: 1fr;
  }
  .main p {
    text-align: left;
  }
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
  }
  .menu-section {
    order: -2;
  }
  .text-section {    
    flex: none;
    width: 100%;
  }
  .text-section h1 {
    font-size: 2.2rem;
  }
  .subtitle {
    font-size: 1.2rem;
    margin-bottom: 30px;
  }
  .buttons {
    flex-direction: column;
    gap: 15px;
    align-items: center;
  }
  .btn {
    width: 80%;
    padding: 14px;
  }
  .image-section {
    flex: none;
    width: 100%;
    margin-top: 30px;
  }
  .image-section img {
    max-height: 350px;
    width: auto;
    max-width: 90%;
  }
}

@media (max-width: 480px) {
  .menu-section {
    order: -2;
    height: 20px;
    margin-top: 10px;
  }  
  .image-section {
    order: -1;
  }
  .image-section img {   
    width: auto;
    max-width: 50%;
  }
  .text-section h1 {
    font-size: 1.8rem;
    text-align: center;
  }
  .subtitle {
    font-size: 1rem;
  }
  .btn {
    font-size: 1rem;
  }
  .menu-section {    
      height: 20px;
}
  .iniciar {
    width: 90px;
  }
  form {  
    padding: 1.3rem;
    width: 100%; 
}
.form-pdf-libro h2 {
    text-align: left; 
}
  
}
