/* ==========================================================================
   LIDO GRILL — LUXURY DIGITAL FLIPBOOK VIEWER
   Design System: Obsidian Slate, Champagne Gold & Lido Bordeaux
   ========================================================================== */

:root {
  --bg-obsidian: #0b0f17;
  --bg-midnight: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --accent-gold: #d4af37;
  --accent-gold-light: #f3e5ab;
  --accent-gold-hover: #e5c158;
  --accent-bordeaux: #8b0000;
  --accent-crimson: #b22222;
  --text-primary: #f8fafc;
  --text-muted: #94a3b8;
  --border-gold-subtle: rgba(212, 175, 55, 0.22);
  --border-glass: rgba(255, 255, 255, 0.08);
  --glass-dock: rgba(11, 15, 23, 0.82);
  --glass-blur: blur(16px);
  --shadow-luxury: 0 25px 60px -15px rgba(0, 0, 0, 0.85);
  --header-height: 64px;
  --dock-height: 56px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body.flipbook-body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-obsidian);
  background-image: 
    radial-gradient(circle at 50% 25%, rgba(21, 29, 45, 0.75) 0%, rgba(11, 15, 23, 0.98) 75%),
    linear-gradient(to bottom, rgba(139, 0, 0, 0.05), transparent 40%);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   TOPBAR HEADER — LIDO GRILL LUXURY SYSTEM
   ========================================================================== */
.fb-header {
  height: var(--header-height);
  background: rgba(11, 15, 23, 0.94);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: relative;
  z-index: 50;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
}

.fb-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1.5px;
  background: linear-gradient(90deg, transparent 0%, rgba(212, 175, 55, 0.35) 15%, rgba(178, 34, 34, 0.85) 50%, rgba(212, 175, 55, 0.35) 85%, transparent 100%);
  pointer-events: none;
}

/* Brand Identity */
.fb-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease;
}

.fb-brand:hover {
  transform: translateY(-1px);
}

.fb-brand-logo-wrap {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.25) 0%, transparent 70%);
}

.fb-brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-gold);
  object-fit: cover;
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.3);
}

.fb-brand-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.fb-brand-headline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fb-brand-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.fb-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1.5px 7px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.16);
  border: 1px solid rgba(212, 175, 55, 0.4);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fef08a;
  text-transform: uppercase;
}

.fb-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  display: inline-block;
  animation: fbPulseDot 2s infinite ease-in-out;
}

@keyframes fbPulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.fb-brand-sub {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent-gold);
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

/* Central Segmented Tabs (Carta Principal / Bebidas) */
.fb-tabs-nav {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(212, 175, 55, 0.22);
  padding: 4px;
  border-radius: 999px;
  gap: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45), inset 0 1px 2px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.fb-tab-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px;
  border-radius: 999px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.24s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.fb-tab-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.fb-tab-item.active {
  background: linear-gradient(135deg, #8b0000 0%, #b22222 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 3px 14px rgba(178, 34, 34, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.fb-tab-item i {
  font-size: 0.88rem;
  color: var(--accent-gold);
  transition: transform 0.2s ease;
}

.fb-tab-item:hover i {
  transform: scale(1.1);
}

.fb-tab-item.active i {
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.fb-tab-full {
  display: inline;
}

.fb-tab-short {
  display: none;
}

/* Header Actions */
.fb-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fb-btn-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  white-space: nowrap;
}

.fb-btn-link:hover {
  background: rgba(212, 175, 55, 0.12);
  border-color: rgba(212, 175, 55, 0.38);
  color: var(--accent-gold-light);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Mode Button */
.fb-btn-mode {
  background: rgba(17, 24, 39, 0.7);
  border-color: rgba(255, 255, 255, 0.12);
}

.fb-btn-mode i {
  color: var(--accent-gold);
}

/* PDF Luxury Gold Button */
.fb-btn-gold {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.18) 0%, rgba(184, 150, 40, 0.08) 100%);
  border-color: rgba(212, 175, 55, 0.45);
  color: #fef08a;
}

.fb-btn-gold i {
  color: #f59e0b;
}

.fb-btn-gold:hover {
  background: linear-gradient(135deg, #d4af37 0%, #aa8425 100%);
  color: #0b0f17;
  font-weight: 600;
  border-color: #d4af37;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.45);
}

.fb-btn-gold:hover i {
  color: #0b0f17;
}

/* Signature Lido Bordeaux Reservar Mesa CTA */
.fb-btn-reservar {
  background: linear-gradient(135deg, #b22222 0%, #8b0000 100%);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff !important;
  font-weight: 600;
  position: relative;
  box-shadow: 0 0 0 1px rgba(178, 34, 34, 0.4), 0 4px 16px rgba(178, 34, 34, 0.45);
  animation: fbAuraPulse 3s infinite;
}

@keyframes fbAuraPulse {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(178, 34, 34, 0.4), 0 4px 16px rgba(178, 34, 34, 0.45);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(178, 34, 34, 0.2), 0 6px 22px rgba(178, 34, 34, 0.7);
  }
}

.fb-btn-reservar:hover {
  background: linear-gradient(135deg, #c52929 0%, #9e0505 100%);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff !important;
  transform: translateY(-1.5px);
  box-shadow: 0 0 0 4px rgba(178, 34, 34, 0.35), 0 8px 25px rgba(178, 34, 34, 0.75);
}

.fb-btn-reservar i {
  color: #ffd700;
}

/* Home Link */
.fb-btn-home {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}

.fb-btn-home:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   VIEWPORT & FLIPBOOK STAGE
   ========================================================================== */
.fb-stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 20px 40px;
  min-height: 0;
}

.fb-container-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.fb-book-container {
  display: none; /* revealed once initialized */
  box-shadow: var(--shadow-luxury);
  border-radius: 4px;
  position: relative;
}

/* Spine gradient / 3D shading on center fold */
.fb-book-container::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 28px;
  transform: translateX(-50%);
  background: linear-gradient(to right, 
    rgba(0,0,0,0) 0%, 
    rgba(0,0,0,0.18) 45%, 
    rgba(0,0,0,0.3) 50%, 
    rgba(0,0,0,0.18) 55%, 
    rgba(0,0,0,0) 100%
  );
  pointer-events: none;
  z-index: 15;
}

/* Single page on mobile: hide spine shadow */
.fb-single-mode.fb-book-container::after {
  display: none;
}

/* Floating Navigation Chevrons */
.fb-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-gold-subtle);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 30;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.fb-nav-arrow:hover:not(:disabled) {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--accent-gold);
  color: #ffffff;
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

.fb-nav-arrow:disabled {
  opacity: 0.2;
  cursor: not-allowed;
  pointer-events: none;
}

.fb-arrow-prev {
  left: 20px;
}

.fb-arrow-next {
  right: 20px;
}

/* ==========================================================================
   LOADING OVERLAY
   ========================================================================== */
.fb-loading-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg-obsidian);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 40;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.fb-loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.fb-spinner-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  margin-bottom: 24px;
}

.fb-spinner-circle {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid rgba(212, 175, 55, 0.15);
  border-top-color: var(--accent-gold);
  border-right-color: var(--accent-gold);
  animation: fb-spin 1s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
}

.fb-spinner-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--accent-gold);
}

@keyframes fb-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.fb-loading-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
}

.fb-loading-status {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.fb-progress-bar-container {
  width: 220px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.fb-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-bordeaux), var(--accent-gold));
  border-radius: 999px;
  transition: width 0.2s ease;
}

/* ==========================================================================
   FLOATING BOTTOM DOCK CONTROLS
   ========================================================================== */
.fb-dock {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  height: var(--dock-height);
  background: var(--glass-dock);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-gold-subtle);
  border-radius: 999px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65), 0 0 15px rgba(212, 175, 55, 0.1);
  z-index: 60;
  transition: all 0.3s ease;
}

.fb-dock-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fb-dock-btn:hover:not(:disabled) {
  background: rgba(212, 175, 55, 0.2);
  color: var(--accent-gold-light);
  transform: scale(1.1);
}

.fb-dock-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.fb-dock-sep {
  width: 1px;
  height: 22px;
  background: var(--border-glass);
  margin: 0 4px;
}

.fb-page-counter {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  padding: 0 8px;
  white-space: nowrap;
}

.fb-page-sep-de {
  display: inline;
}

.fb-page-sep-slash {
  display: none;
}

.fb-page-input {
  width: 36px;
  height: 28px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  color: #fff;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s ease;
}

.fb-page-input:focus {
  border-color: var(--accent-gold);
  background: rgba(255, 255, 255, 0.12);
}

.fb-zoom-label {
  font-size: 0.75rem;
  color: var(--accent-gold);
  font-weight: 600;
  min-width: 42px;
  text-align: center;
}

/* ==========================================================================
   HELP MODAL & SHORTCUTS TOAST
   ========================================================================== */
.fb-hint-toast {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(17, 24, 39, 0.92);
  border: 1px solid var(--border-gold-subtle);
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 55;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.fb-hint-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.fb-hint-toast kbd {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--accent-gold-light);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE & TABLETS)
   ========================================================================== */

/* Tablet & iPad Portrait / Landscape (max-width: 1024px) */
@media (max-width: 1024px) {
  .fb-header {
    padding: 0 16px;
  }

  .fb-stage {
    padding: 16px 20px;
  }

  .fb-nav-arrow {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }

  .fb-arrow-prev { left: 12px; }
  .fb-arrow-next { right: 12px; }
}

/* Mobile & Tablet Screens (max-width: 768px) */
@media (max-width: 768px) {
  :root {
    --header-height: 54px;
    --dock-height: 46px;
  }

  body.flipbook-body {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    position: fixed;
    width: 100%;
  }

  .fb-header {
    height: var(--header-height);
    padding: 0 10px;
    gap: 8px;
    overflow: hidden;
  }

  .fb-brand {
    flex-shrink: 0;
    gap: 8px;
  }

  .fb-brand-logo-wrap {
    width: 34px;
    height: 34px;
  }

  .fb-brand-logo {
    width: 32px;
    height: 32px;
  }

  .fb-brand-title {
    font-size: 0.92rem;
    letter-spacing: 0.8px;
  }

  .fb-brand-badge,
  .fb-brand-sub {
    display: none !important;
  }

  /* Segmented tabs compact */
  .fb-tabs-nav {
    flex-shrink: 0;
    padding: 3px 4px;
    gap: 3px;
  }

  .fb-tab-item {
    padding: 5px 11px;
    font-size: 0.76rem;
    gap: 5px;
  }

  .fb-tab-full {
    display: none !important;
  }

  .fb-tab-short {
    display: inline !important;
  }

  /* Actions compact circular buttons */
  .fb-header-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .fb-btn-link {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0 !important;
    border-radius: 50% !important;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .fb-btn-text,
  .fb-btn-link span {
    display: none !important;
  }

  .fb-stage {
    padding: 4px 6px;
    touch-action: pan-x pan-y;
  }

  /* Floating navigation chevrons */
  .fb-nav-arrow {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
    background: rgba(11, 15, 23, 0.75);
    z-index: 25;
  }

  .fb-arrow-prev { left: 6px; }
  .fb-arrow-next { right: 6px; }

  /* Floating bottom dock on mobile */
  .fb-dock {
    bottom: 12px;
    max-width: calc(100vw - 16px);
    padding: 0 6px;
    gap: 3px;
    height: 42px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.75);
    box-sizing: border-box;
  }

  .fb-dock-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    font-size: 0.8rem;
    -webkit-tap-highlight-color: transparent;
  }

  .fb-page-counter {
    font-size: 0.76rem;
    gap: 3px;
    padding: 0 2px;
  }

  .fb-page-lbl,
  .fb-page-sep-de {
    display: none !important;
  }

  .fb-page-sep-slash {
    display: inline !important;
  }

  .fb-page-input {
    width: 24px;
    height: 22px;
    font-size: 0.75rem;
    padding: 0 1px;
    border-radius: 4px;
  }

  .fb-dock-sep {
    height: 16px;
    margin: 0 2px;
  }

  .fb-dock-sep.hide-mobile,
  .fb-dock-btn.hide-mobile {
    display: none !important;
  }

  .fb-zoom-label {
    display: inline-block;
    font-size: 0.68rem;
    min-width: 30px;
    color: var(--accent-gold);
    cursor: pointer;
    text-align: center;
  }

  .fb-dock-btn.active-rotate {
    background: rgba(212, 175, 55, 0.25) !important;
    color: var(--accent-gold-light) !important;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
    transform: rotate(90deg);
  }

  /* Helper hint toast on mobile */
  .fb-hint-toast {
    bottom: 68px;
    padding: 8px 14px;
    font-size: 0.74rem;
    white-space: nowrap;
    border-radius: 999px;
  }
}

/* Standard Mobile Phones (max-width: 480px) */
@media (max-width: 480px) {
  .fb-header {
    padding: 0 8px;
    gap: 6px;
  }

  /* Clean logo circle on mobile gives full room to switcher and all 4 action buttons */
  .fb-brand-info {
    display: none !important;
  }

  .fb-tabs-nav {
    padding: 2.5px 3px;
    gap: 2px;
  }

  .fb-tab-item {
    padding: 5px 9px;
    font-size: 0.74rem;
    gap: 5px;
  }

  .fb-header-actions {
    gap: 5px;
  }

  .fb-btn-link {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    font-size: 0.78rem;
  }

  .fb-dock {
    bottom: 10px;
    max-width: calc(100vw - 12px);
    padding: 0 5px;
    gap: 2px;
    height: 40px;
  }

  .fb-dock-btn {
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;
    font-size: 0.74rem;
  }

  .fb-page-input {
    width: 22px;
    height: 20px;
    font-size: 0.72rem;
  }

  .fb-zoom-label {
    font-size: 0.65rem;
    min-width: 26px;
  }

  .fb-dock-sep {
    height: 14px;
    margin: 0 1px;
  }
}

/* Small smartphones (iPhone SE, Galaxy A series, max-width: 360px) */
@media (max-width: 360px) {
  .fb-header {
    padding: 0 5px;
    gap: 4px;
  }

  .fb-brand-logo-wrap {
    width: 30px;
    height: 30px;
  }

  .fb-brand-logo {
    width: 28px;
    height: 28px;
  }

  .fb-tab-item {
    padding: 4px 7px;
    font-size: 0.70rem;
    gap: 4px;
  }

  .fb-tab-item i {
    font-size: 0.76rem;
  }

  .fb-header-actions {
    gap: 3px;
  }

  .fb-btn-link {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    font-size: 0.72rem;
  }

  .fb-dock {
    bottom: 6px;
    max-width: calc(100vw - 8px);
    padding: 0 3px;
    gap: 1.5px;
    height: 38px;
  }

  .fb-dock-btn {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    font-size: 0.70rem;
  }

  .fb-page-input {
    width: 20px;
    height: 19px;
    font-size: 0.68rem;
  }

  .fb-zoom-label {
    font-size: 0.60rem;
    min-width: 24px;
  }
}

/* Touch screen improvements */
@media (hover: none) and (pointer: coarse) {
  .fb-dock-btn,
  .fb-nav-arrow,
  .fb-tab-item,
  .fb-btn-link {
    cursor: default;
    -webkit-tap-highlight-color: transparent;
  }

  .fb-dock-btn:active,
  .fb-nav-arrow:active {
    transform: scale(0.92);
  }
}

/* Smartphone in Landscape Orientation (Max height 500px) */
@media (max-height: 500px) and (orientation: landscape) {
  :root {
    --header-height: 42px;
    --dock-height: 36px;
  }

  .fb-header {
    height: var(--header-height);
    padding: 0 8px;
  }

  .fb-brand-name,
  .fb-brand-subtitle {
    display: none;
  }

  .fb-brand-logo {
    width: 28px;
    height: 28px;
  }

  .fb-tab-item {
    padding: 3px 8px;
    font-size: 0.72rem;
  }

  .fb-btn-link {
    padding: 3px 8px;
    min-width: 30px;
    min-height: 30px;
  }

  .fb-stage {
    padding: 2px 8px;
  }

  .fb-dock {
    bottom: 4px;
    height: var(--dock-height);
    padding: 0 6px;
    background: rgba(11, 15, 23, 0.70);
    backdrop-filter: blur(8px);
  }

  .fb-dock-btn {
    width: 28px;
    height: 28px;
    font-size: 0.78rem;
  }

  .fb-page-counter {
    font-size: 0.72rem;
  }

  .fb-page-input {
    width: 26px;
    height: 22px;
    font-size: 0.72rem;
  }

  .fb-nav-arrow {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }
}

/* ==========================================================================
   ULTRA-HD MOBILE / TABLET TOUCH READER WITH PANZOOM & ROTATION
   ========================================================================== */
.fb-mobile-wrapper {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 20;
  touch-action: none; /* Handled smoothly in JS without browser rubber-band */
}

.fb-mobile-viewport {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.fb-mobile-page-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  transition: transform 0.1s ease-out;
}

.fb-mobile-page-container.is-animating {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.fb-mobile-canvas {
  display: block;
  border-radius: 6px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.85), 0 0 1px rgba(212, 175, 55, 0.4);
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  pointer-events: none;
  transition: opacity 0.15s ease;
  transform: translateZ(0);
}

.fb-mobile-canvas.fb-canvas-fade {
  opacity: 0.25;
}

.fb-dock-btn.active-fit {
  background: rgba(212, 175, 55, 0.25) !important;
  color: var(--accent-gold-light) !important;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

/* ==========================================================================
   THUMBNAILS DRAWER / BOTTOM SHEET
   ========================================================================== */
.fb-thumbs-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(11, 15, 23, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-gold-subtle);
  border-radius: 20px 20px 0 0;
  padding: 16px 20px 24px;
  z-index: 90;
  transform: translateY(105%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
  max-height: 60vh;
  max-height: 60dvh;
  display: flex;
  flex-direction: column;
}

.fb-thumbs-drawer.is-open {
  transform: translateY(0);
}

.fb-thumbs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  color: var(--accent-gold-light);
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.fb-thumbs-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.fb-thumbs-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  overflow-y: auto;
  padding-bottom: 10px;
}

.fb-thumb-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  border: 1.5px solid transparent;
  transition: all 0.2s ease;
}

.fb-thumb-item:hover,
.fb-thumb-item.active {
  border-color: var(--accent-gold);
  background: rgba(212, 175, 55, 0.1);
}

.fb-thumb-img {
  width: 100%;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.fb-thumb-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.fb-thumb-item.active .fb-thumb-label {
  color: var(--accent-gold-light);
  font-weight: 700;
}


