/* ===== COMMON ===== */

.brochure-section {
  position: relative;
  z-index: 1;
}

/* Desktop: landscape double-page */
.brochure-wrapper {
  position: relative;
  width: min(70rem, 100%);
  aspect-ratio: 16 / 5;
  max-width: 100%;
  margin-inline: auto;
}

.brochure-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.back-img {
  object-fit: contain;
  background: #f5f5f7;
}

/* covers */
.brochure-cover {
  position: absolute;
  inset: 0;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #e5e5ea;
  box-shadow: 0 18px 40px rgba(15,23,42,0.45);
  display: none;
}
.brochure-cover.active {
  display: block;
}

/* desktop book */
.brochure-book {
  position: absolute;
  inset: 0;
  margin: auto;
  border-radius: 0.75rem;
  overflow: hidden;
  background: linear-gradient(135deg,#ffffffee,#f3f4f6);
  box-shadow: 0 18px 40px rgba(15,23,42,0.45);
  transform-style: preserve-3d;
  perspective: 120rem;
  display: none;
}

.brochure-book .sheet {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 0.85s cubic-bezier(0.19,1,0.22,1);
}

.brochure-book .sheet:nth-child(1)  { z-index: 15; }
.brochure-book .sheet:nth-child(2)  { z-index: 14; }
.brochure-book .sheet:nth-child(3)  { z-index: 13; }
.brochure-book .sheet:nth-child(4)  { z-index: 12; }
.brochure-book .sheet:nth-child(5)  { z-index: 11; }
.brochure-book .sheet:nth-child(6)  { z-index: 10; }
.brochure-book .sheet:nth-child(7)  { z-index: 9;  }
.brochure-book .sheet:nth-child(8)  { z-index: 8;  }
.brochure-book .sheet:nth-child(9)  { z-index: 7;  }
.brochure-book .sheet:nth-child(10) { z-index: 6;  }
.brochure-book .sheet:nth-child(11) { z-index: 5;  }
.brochure-book .sheet:nth-child(12) { z-index: 4;  }
.brochure-book .sheet:nth-child(13) { z-index: 3;  }
.brochure-book .sheet:nth-child(14) { z-index: 2;  }
.brochure-book .sheet:nth-child(15) { z-index: 1;  }

.brochure-book .sheet.turned {
  transform: translateX(-3%) rotateY(-180deg) scale(0.985);
}

.brochure-book .page {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  backface-visibility: hidden;
}
.brochure-book .page.left  { left: 0; }
.brochure-book .page.right { right: 0; }

/* mobile book - full width single page */
.brochure-mobile-book {
  display: none;
  position: relative;
  width: 100%;
  background: linear-gradient(135deg,#ffffffee,#f3f4f6);
  box-shadow: 0 10px 22px rgba(15,23,42,0.35);
  border-radius: 0.5rem;
  overflow: hidden;
  margin: 0 auto;
}

.brochure-mobile-page {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brochure-mobile-page img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* buttons */
.brochure-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 999px;
  border: none;
  background: #ffffffdd;
  color: #111827;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 12px 24px rgba(15,23,42,0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s;
  z-index: 30;
}
.brochure-btn.next { right: 0.75rem; }
.brochure-btn.prev { left: 0.75rem; }

.brochure-btn:hover {
  transform: translateY(-50%) translateY(-2px) scale(1.05);
  box-shadow: 0 18px 32px rgba(15,23,42,0.55);
  background: linear-gradient(135deg,#22c1c3,#fdbb2d);
  color: #020617;
}

.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  border: none;
  background: #ffffffdd;
  color: #111827;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 10px 20px rgba(15,23,42,0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s;
  z-index: 25;
}
.nav-btn.prev { left: 0.5rem; }
.nav-btn.next { right: 0.5rem; }

.nav-btn:hover {
  transform: translateY(-50%) translateY(-1px) scale(1.05);
  box-shadow: 0 14px 26px rgba(15,23,42,0.55);
  background: linear-gradient(135deg,#6366f1,#ec4899);
  color: #f9fafb;
}

.brochure-mobile-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: none;
  background: #ffffffdd;
  color: #111827;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 10px 20px rgba(15,23,42,0.4);
  transition: transform 0.2s ease;
  z-index: 25;
}
.brochure-mobile-nav.prev { left: 0.4rem; }
.brochure-mobile-nav.next { right: 0.4rem; }

.brochure-mobile-nav:hover {
  transform: translateY(-50%) scale(1.1);
  background: linear-gradient(135deg,#6366f1,#ec4899);
  color: #f9fafb;
}

.brochure-mobile-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.2rem;
  height: 2.2rem;
  z-index: 35;
}

/* ===== DESKTOP (> 768px) ===== */
@media (min-width: 769px) {
  .brochure-mobile-book,
  .brochure-mobile-nav,
  .brochure-mobile-close {
    display: none !important;
  }
}

/* ===== MOBILE (≤ 768px): SINGLE PAGE FULL SCREEN ===== */
@media (max-width: 768px) {
  .brochure-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: auto;
    height: auto;
  }

  /* hide desktop book */
  .brochure-book,
  .nav-btn {
    display: none !important;
  }

  /* show mobile book as full-width card */
  .brochure-mobile-book {
    display: block;
  }

  /* single full-screen page */
  .brochure-mobile-page {
    width: 100%;
    aspect-ratio: 9 / 16;
    position: relative;
  }

  /* nav buttons on mobile */
  .brochure-mobile-nav {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
  }

  .brochure-mobile-nav.prev { left: 0.3rem; }
  .brochure-mobile-nav.next { right: 0.3rem; }
}
