* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "Crimson Text", serif;
  background: #e6d5f5;
  overflow: hidden;
}

/* Corazones */
#hearts {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.floating-heart {
  position: absolute;
  bottom: -50px;
  font-size: 30px;
  color: #c85a6e;
  opacity: 0;
  animation: float 10s linear infinite;
}

@keyframes float {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-100vh) rotate(360deg);
    opacity: 0;
  }
}

/* Libro */
.book {
  position: relative;
  width: 350px;
  height: 500px;
  transition: transform 0.5s;
  z-index: 10;
}

.paper {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  perspective: 1500px;
}

.front,
.back {
  background: #fffef7;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  transform-origin: left;
  transition: transform 0.5s;
  border-radius: 0 10px 10px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.front {
  z-index: 1;
  backface-visibility: hidden;
  border-left: 3px solid #d4a89a;
}

.back {
  z-index: 0;
}

.front-content,
.back-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 50px 40px;
  position: relative;
}

.back-content {
  transform: rotateY(180deg);
}

/* Efecto de voltear página */
.flipped .front,
.flipped .back {
  transform: rotateY(-180deg);
}

/* Portada */
.cover-page {
  background: #e6d5f5;
  border-radius: 0 10px 10px 0;
  align-items: center;
  justify-content: center;
}

.cover-page img {
  max-width: 70%;
  max-height: 70%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  margin-bottom: 20px;
}

.cover-text {
  color: white;
  font-family: "Dancing Script", cursive;
  font-size: 1.3rem;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
  animation: pulse-text 2s infinite;
}

@keyframes pulse-text {
  0%, 100% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
}

/* Contenido páginas */
h1, h2 {
  font-family: "Dancing Script", cursive;
  color: #c85a6e;
  text-align: center;
  margin-bottom: 20px;
}

h1 {
  font-size: 3rem;
}

h2 {
  font-size: 2.3rem;
}

.divider {
  width: 120px;
  height: 3px;
  background: linear-gradient(to right, transparent, #ffc9e3, transparent);
  margin: 0 auto 25px;
}

/* Página solo con corazón */
.heart-only {
  justify-content: center;
  align-items: center;
}

.heart-only .heart {
  position: static;
  transform: none;
  animation: pulse-center 2s infinite;
}

.heart-only .heart svg {
  width: 120px;
  height: 120px;
}

/* Página de reserva */
.reservation-page {
  justify-content: center;
}

.reservation-page h3 {
  font-family: "Dancing Script", cursive;
  font-size: 2.8rem;
  color: #c85a6e;
  text-align: center;
  margin-bottom: 35px;
}

.reservation-details {
  display: flex;
  flex-direction: column;
  gap: 25px;
  margin-bottom: 35px;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 1.15rem;
  color: #4a4a4a;
}

.detail-item .icon {
  width: 28px;
  height: 28px;
  fill: #c85a6e;
  flex-shrink: 0;
}

.signature-final {
  text-align: center;
  font-style: italic;
  margin-top: auto;
  text-indent: 0 !important;
  font-size: 1.05rem;
}

.signature-final span {
  font-family: "Dancing Script", cursive;
  font-size: 1.5rem;
  color: #c85a6e;
  display: block;
  margin-top: 8px;
}

.intro {
  font-size: 1.15rem;
  line-height: 1.8;
  color: #6b5b6b;
  text-align: center;
  font-style: italic;
}

.heart {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  animation: pulse 2s infinite;
}

.heart svg {
  width: 50px;
  height: 50px;
  fill: #c85a6e;
  filter: drop-shadow(0 3px 8px rgba(200, 90, 110, 0.4));
}

.heart-only .heart {
  position: static;
  transform: none;
  animation: pulse-center 2s infinite;
}

.heart-only .heart svg {
  width: 120px;
  height: 120px;
}

@keyframes pulse {
  0%, 100% {
    transform: translateX(-50%) scale(1);
  }
  50% {
    transform: translateX(-50%) scale(1.1);
  }
}

@keyframes pulse-center {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

p {
  font-size: 1rem;
  line-height: 1.6;
  color: #4a4a4a;
  text-align: justify;
  margin-bottom: 12px;
  text-indent: 20px;
}

p em {
  color: #c85a6e;
  font-size: 1.1rem;
}

.signature {
  text-align: right;
  font-style: italic;
  margin-top: 20px;
  text-indent: 0 !important;
}

.signature span {
  font-family: "Dancing Script", cursive;
  font-size: 1.4rem;
  color: #c85a6e;
  display: block;
  margin-top: 5px;
}

/* Botones */
button {
  border: none;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  margin: 0 20px;
  transition: all 0.3s;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  color: #c85a6e;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
}

button svg {
  width: 24px;
  height: 24px;
}

button:hover {
  background: white;
  transform: scale(1.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

button:focus {
  outline: none;
}

/* Orden de páginas */
#p1 {
  z-index: 2;
}

#p2 {
  z-index: 1;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 20px 10px;
  }

  .book {
    width: 90vw;
    max-width: 320px;
    height: 450px;
  }

  .front-content,
  .back-content {
    padding: 35px 25px;
  }

  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 2rem;
  }

  .reservation-page h3 {
    font-size: 2.2rem;
    margin-bottom: 25px;
  }

  .detail-item {
    font-size: 1rem;
    gap: 12px;
  }

  .detail-item .icon {
    width: 24px;
    height: 24px;
  }

  .cover-page img {
    max-width: 80%;
    max-height: 75%;
  }

  .cover-text {
    font-size: 1.1rem;
  }

  .heart-only .heart svg {
    width: 100px;
    height: 100px;
  }

  button {
    width: 45px;
    height: 45px;
    font-size: 20px;
    margin: 0 10px;
  }

  button svg {
    width: 20px;
    height: 20px;
  }

  p {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .book {
    width: 95vw;
    max-width: 280px;
    height: 400px;
  }

  .front-content,
  .back-content {
    padding: 30px 20px;
  }

  h1 {
    font-size: 2.2rem;
  }

  h2 {
    font-size: 1.8rem;
  }

  .reservation-page h3 {
    font-size: 2rem;
    margin-bottom: 20px;
  }

  .reservation-details {
    gap: 20px;
    margin-bottom: 25px;
  }

  .detail-item {
    font-size: 0.95rem;
    gap: 10px;
  }

  .detail-item .icon {
    width: 22px;
    height: 22px;
  }

  .heart-only .heart svg {
    width: 80px;
    height: 80px;
  }

  button {
    width: 40px;
    height: 40px;
    margin: 0 8px;
  }

  button svg {
    width: 18px;
    height: 18px;
  }

  p {
    font-size: 0.9rem;
    line-height: 1.5;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .book {
    width: 500px;
    height: 600px;
  }

  .front-content,
  .back-content {
    padding: 60px 45px;
  }

  h1 {
    font-size: 3.2rem;
  }

  h2 {
    font-size: 2.5rem;
  }

  .reservation-page h3 {
    font-size: 3rem;
  }

  .detail-item {
    font-size: 1.25rem;
  }

  .detail-item .icon {
    width: 30px;
    height: 30px;
  }
}
