/* ==========================================================================
   BFF E-BROCHURE FLIPBOOK - immersive fullscreen viewer
   Full viewport book, no toolbar - drag/swipe flips, floating counter
   Mobile portrait -> premium "rotate screen" notice
   ========================================================================== */
:root {
  --fb-navy: #101a3a;
  --fb-navy-2: #1e2a5a;
  --fb-gold: #d4a853;
  --fb-gold-2: #f3c969;
  --fb-bg: #eef0f4;
  --fb-ink: #1b2340;
  --fb-muted: #6b7280;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
.fb-body {
  font-family: 'Poppins', system-ui, sans-serif;
  color: var(--fb-ink);
  background:
    radial-gradient(1400px 700px at 50% -20%, rgba(212, 168, 83, 0.12), transparent 60%),
    radial-gradient(1000px 600px at 50% 115%, rgba(16, 26, 58, 0.10), transparent 60%),
    linear-gradient(180deg, #f5f6f9 0%, var(--fb-bg) 100%);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

/* ---------- Floating overlay: back (top-left) + brand (top-right) ---------- */
.fb-back {
  position: fixed; top: 16px; left: 16px; z-index: 40;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 600; text-decoration: none;
  color: var(--fb-navy); background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(16, 26, 58, 0.12);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(16, 26, 58, 0.10);
  transition: 0.25s;
}
.fb-back:hover { background: var(--fb-navy); color: var(--fb-gold-2); }
.fb-brand {
  position: fixed; top: 16px; right: 16px; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(10px);
  border: 1px solid rgba(16, 26, 58, 0.10);
  box-shadow: 0 6px 18px rgba(16, 26, 58, 0.10);
}
.fb-brand img { height: 30px; width: auto; }
.fb-brand span { display: flex; flex-direction: column; line-height: 1.1; }
.fb-brand b { font: 700 0.82rem 'Playfair Display', serif; color: var(--fb-navy); }
.fb-brand small { font-size: 0.58rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--fb-gold); font-weight: 700; }

/* ---------- Stage: full viewport ---------- */
.fb-stage {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  overflow: hidden;
  touch-action: none;
}
.fb-book-wrap {
  position: relative;
  transform-origin: center center;
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1);
  will-change: transform;
  opacity: 0;
}
.fb-book-wrap.is-ready { opacity: 1; transition: opacity 0.6s ease, transform 0.35s cubic-bezier(.2,.8,.2,1); }
.fb-book-wrap.is-panning { transition: none; cursor: grabbing; }
.fb-book-wrap.can-pan { cursor: grab; }

/* Book - ambient floor shadow */
.fb-book { position: relative; }
.fb-book::after {
  content: ""; position: absolute; left: 4%; right: 4%; bottom: -32px; height: 52px;
  background: radial-gradient(ellipse at center, rgba(16, 26, 58, 0.34), transparent 68%);
  filter: blur(12px); z-index: -1; pointer-events: none;
}
/* Spine seam (two-page spread) */
.fb-book.is-spread::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 70px;
  transform: translateX(-50%); z-index: 5; pointer-events: none;
  background: linear-gradient(90deg,
    rgba(0,0,0,0) 0%, rgba(0,0,0,0.10) 42%, rgba(0,0,0,0.26) 50%, rgba(0,0,0,0.10) 58%, rgba(0,0,0,0) 100%);
}

/* Page */
.fb-page {
  background: #fff;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04);
}
.fb-page img, .fb-page canvas {
  width: 100%; height: 100%; display: block; object-fit: cover;
  pointer-events: none; -webkit-user-drag: none;
}
.fb-page.fb-cover { box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12), inset 0 0 30px rgba(0,0,0,0.08); }
.fb-page.--left::after, .fb-page.--right::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 36px; pointer-events: none;
}
.fb-page.--left::after  { right: 0; background: linear-gradient(90deg, rgba(0,0,0,0), rgba(0,0,0,0.10)); }
.fb-page.--right::after { left: 0;  background: linear-gradient(270deg, rgba(0,0,0,0), rgba(0,0,0,0.10)); }
.stf__parent { margin: 0 auto; }

/* ---------- Page counter pill (bottom-center, auto-fade) ---------- */
.fb-count {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 40;
  padding: 9px 20px; border-radius: 999px;
  background: rgba(16, 26, 58, 0.88); color: #fff;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 10px 26px rgba(16, 26, 58, 0.3);
  backdrop-filter: blur(8px);
  transition: opacity 0.4s ease;
}
.fb-count.is-faded { opacity: 0.35; }
/* One-time swipe hint - loads ke baad kuch der */
.fb-hint {
  position: fixed; bottom: 70px; left: 50%; transform: translateX(-50%); z-index: 40;
  padding: 8px 18px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.9); color: var(--fb-navy);
  border: 1px solid rgba(212, 168, 83, 0.5);
  font-size: 0.75rem; font-weight: 600;
  box-shadow: 0 8px 22px rgba(16, 26, 58, 0.14);
  opacity: 0; pointer-events: none;
  transition: opacity 0.5s ease;
}
.fb-hint i { color: var(--fb-gold); margin-right: 6px; }
.fb-hint.is-shown { opacity: 1; }

/* ---------- Loader ---------- */
.fb-loader {
  position: fixed; inset: 0; z-index: 70;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: var(--fb-bg);
  transition: opacity 0.5s ease, visibility 0.5s;
}
.fb-loader.is-hidden { opacity: 0; visibility: hidden; }
.fb-loader-book { display: flex; gap: 6px; }
.fb-loader-book span {
  width: 14px; height: 54px; border-radius: 3px;
  background: linear-gradient(180deg, var(--fb-gold-2), var(--fb-gold));
  transform-origin: bottom center;
  animation: fbPulse 1.1s ease-in-out infinite;
}
.fb-loader-book span:nth-child(2) { animation-delay: 0.15s; background: linear-gradient(180deg, var(--fb-navy-2), var(--fb-navy)); }
.fb-loader-book span:nth-child(3) { animation-delay: 0.3s; }
@keyframes fbPulse { 0%, 100% { transform: scaleY(0.55); opacity: 0.6; } 50% { transform: scaleY(1); opacity: 1; } }
.fb-loader-txt { margin: 0; font-size: 0.92rem; font-weight: 500; color: var(--fb-ink); }
.fb-loader-bar { width: min(280px, 70vw); height: 6px; border-radius: 999px; background: rgba(16, 26, 58, 0.1); overflow: hidden; }
.fb-loader-bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--fb-gold), var(--fb-gold-2)); transition: width 0.25s ease; }
.fb-loader small { font-size: 0.72rem; color: var(--fb-muted); letter-spacing: 0.1em; }

/* ---------- Error ---------- */
.fb-error {
  position: fixed; inset: 0; z-index: 71;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  text-align: center; padding: 24px; background: var(--fb-bg);
}
.fb-error[hidden] { display: none; }
.fb-error i { font-size: 2.4rem; color: #c0392b; margin-bottom: 6px; }
.fb-error h3 { margin: 0; font: 700 1.3rem 'Playfair Display', serif; color: var(--fb-navy); }
.fb-error p { margin: 0 0 10px; color: var(--fb-muted); max-width: 420px; font-size: 0.9rem; }
.fb-btn-solid {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; border-radius: 999px;
  background: var(--fb-navy); color: #fff; text-decoration: none; font-weight: 600; font-size: 0.88rem;
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 767.98px) {
  .fb-brand { display: none; }
  .fb-back { padding: 9px 12px; }
  .fb-back span { display: none; }
  .fb-count { bottom: 16px; padding: 8px 16px; font-size: 0.72rem; }
  .fb-hint { bottom: 60px; font-size: 0.7rem; }
}
/* Landscape phone - tiny chrome, bada book */
@media (max-width: 991.98px) and (orientation: landscape) and (max-height: 500px) {
  .fb-brand { display: none; }
  .fb-back { top: 10px; left: 10px; padding: 7px 10px; }
  .fb-count { bottom: 10px; padding: 6px 14px; font-size: 0.68rem; }
}
