/* ==========================================================================
   SBJ CATALOGUE 2026 - 3D LUXURY FLIPBOOK STYLESHEET
   136-Page Interactive Showcase with Live Product Search & Direct Jump
   ========================================================================== */

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f6f7fa;
  --bg-studio-gradient: radial-gradient(ellipse at 50% 38%, #ffffff 0%, #f4f6f9 55%, #e6ebf1 100%);
  --brand-red: #d91f26;
  --brand-red-dark: #b8141a;
  --brand-gold: #e5a93c;
  --brand-gold-dark: #c0871d;
  --text-primary: #191c21;
  --text-secondary: #636b78;
  --text-muted: #9aa1b0;
  
  --ui-bg: rgba(255, 255, 255, 0.92);
  --ui-border: rgba(0, 0, 0, 0.08);
  --ui-shadow: 0 10px 32px rgba(0, 0, 0, 0.07), 0 2px 8px rgba(0, 0, 0, 0.04);
  --ui-blur: blur(20px);
  
  --book-aspect: 0.7265; /* 1275 / 1755 */
  --book-shadow-ambient: 0 32px 64px -14px rgba(18, 28, 45, 0.22), 0 16px 28px -8px rgba(18, 28, 45, 0.12);
  --page-corner-radius: 4px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-primary);
  background: var(--bg-studio-gradient);
  user-select: none;
  -webkit-user-select: none;
}

/* ==========================================================================
   APP CONTAINER & STUDIO BACKDROP
   ========================================================================== */
.app-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-studio-gradient);
}

.studio-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.5) 0%, rgba(220, 226, 235, 0.3) 65%, rgba(195, 204, 217, 0.45) 100%);
  mix-blend-mode: multiply;
  opacity: 0.75;
  z-index: 1;
}

/* ==========================================================================
   TOP DESIGNER HEADER TOOLBAR
   ========================================================================== */
.header-bar {
  position: absolute;
  top: 14px;
  left: 20px;
  right: 20px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: var(--ui-bg);
  backdrop-filter: var(--ui-blur);
  -webkit-backdrop-filter: var(--ui-blur);
  border: 1px solid var(--ui-border);
  border-radius: 16px;
  box-shadow: var(--ui-shadow);
  z-index: 100;
  transition: opacity 0.3s ease, transform 0.3s ease;
  gap: 16px;
}

.header-bar.autohide {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.sbj-logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #e52d27 0%, #b31217 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(217, 31, 38, 0.35);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.brand-tag {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(217, 31, 38, 0.1);
  color: var(--brand-red);
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: 0.8px;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ==========================================================================
   GLOBAL PRODUCT SEARCH BAR & LIVE DROPDOWN
   ========================================================================== */
.search-center-section {
  position: relative;
  flex: 1;
  max-width: 440px;
  min-width: 200px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--ui-border);
  border-radius: 24px;
  padding: 0 12px;
  height: 38px;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.search-input-wrapper:focus-within {
  background: #ffffff;
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(217, 31, 38, 0.15), 0 4px 14px rgba(0, 0, 0, 0.08);
}

.search-icon-svg {
  width: 16px;
  height: 16px;
  fill: var(--text-secondary);
  flex-shrink: 0;
  margin-right: 8px;
}

.search-input-field {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-size: 12.5px;
  color: var(--text-primary);
  font-weight: 500;
}

.search-input-field::placeholder {
  color: var(--text-muted);
}

.search-kbd-badge {
  font-size: 10px;
  font-family: monospace;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.search-clear-btn {
  background: transparent;
  border: none;
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-clear-btn:hover {
  color: var(--text-primary);
}

/* Search Dropdown Results */
.search-results-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  max-height: 420px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: var(--ui-blur);
  -webkit-backdrop-filter: var(--ui-blur);
  border: 1px solid var(--ui-border);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 200;
  display: none;
  flex-direction: column;
}

.search-results-dropdown.open {
  display: flex;
}

.search-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.02);
  border-bottom: 1px solid var(--ui-border);
  letter-spacing: 0.6px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.search-result-item:hover,
.search-result-item.selected {
  background: rgba(217, 31, 38, 0.06);
}

.search-item-thumb {
  width: 36px;
  height: 50px;
  aspect-ratio: var(--book-aspect);
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
  background: #f0f0f0;
}

.search-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-item-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.search-item-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-item-page-badge {
  font-size: 10px;
  font-weight: 800;
  background: var(--brand-red);
  color: #ffffff;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.search-item-category {
  font-size: 10px;
  font-weight: 700;
  color: var(--brand-gold-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-item-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-highlight {
  background: rgba(217, 31, 38, 0.15);
  color: var(--brand-red);
  font-weight: 800;
  border-radius: 2px;
  padding: 0 2px;
}

.search-empty-state {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ==========================================================================
   HEADER ACTIONS & BUTTONS
   ========================================================================== */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  outline: none;
  text-decoration: none;
}

.icon-btn:hover {
  background: rgba(0, 0, 0, 0.07);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.icon-btn:active {
  transform: translateY(1px) scale(0.97);
}

.icon-btn.active {
  background: rgba(217, 31, 38, 0.1);
  color: var(--brand-red);
  border-color: rgba(217, 31, 38, 0.2);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.btn-divider {
  width: 1px;
  height: 24px;
  background: var(--ui-border);
  margin: 0 4px;
}

/* ==========================================================================
   STAGE / VIEWPORT FOR 3D FLIPBOOK
   ========================================================================== */
.viewport-stage {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 2600px;
  perspective-origin: 50% 50%;
  overflow: hidden;
  z-index: 10;
}

.zoom-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: 50% 50%;
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
  will-change: transform;
}

.zoom-wrapper.zoomed {
  cursor: grab;
  cursor: -webkit-grab;
}

.zoom-wrapper.grabbing {
  cursor: grabbing;
  cursor: -webkit-grabbing;
}

/* ==========================================================================
   3D BOOK WRAPPER & GEOMETRY
   ========================================================================== */
.book-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.book-ground-shadow {
  position: absolute;
  bottom: -32px;
  left: 2%;
  right: 2%;
  height: 52px;
  background: radial-gradient(ellipse at 50% 50%, rgba(18, 28, 45, 0.3) 0%, rgba(18, 28, 45, 0.12) 55%, transparent 75%);
  filter: blur(16px);
  pointer-events: none;
  z-index: -2;
  transition: all 0.4s ease;
  transform-origin: 50% 50%;
}

.book-ground-shadow.flipping {
  transform: scaleY(1.25) scaleX(0.98);
  opacity: 0.9;
}

.book-spine-crease {
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: 50%;
  width: 24px;
  transform: translateX(-50%);
  background: linear-gradient(to right,
    rgba(0, 0, 0, 0.32) 0%,
    rgba(0, 0, 0, 0.1) 25%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(0, 0, 0, 0.1) 75%,
    rgba(0, 0, 0, 0.32) 100%
  );
  pointer-events: none;
  z-index: 50;
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.08);
}

.book-spine-crease::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 8px;
  background: linear-gradient(to bottom, #f2f3f5, #d2d5dc);
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 4px 4px 2px 2px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
}

.book-spine-crease::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 8px;
  background: linear-gradient(to top, #f2f3f5, #d2d5dc);
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 2px 2px 4px 4px;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.18);
}

/* In Single Page Mode & Mobile Mode, spine divider sits on the LEFT edge of the page */
.book-wrapper.mobile-mode .book-spine-crease,
.book-wrapper.single-page-mode .book-spine-crease,
.book-spine-crease.spine-left {
  left: 0 !important;
  transform: translateX(-50%) !important;
  width: 20px !important;
  display: block !important;
  background: linear-gradient(to right,
    rgba(10, 10, 12, 0.42) 0%,
    rgba(20, 20, 25, 0.22) 25%,
    rgba(255, 255, 255, 0.35) 50%,
    rgba(20, 20, 25, 0.12) 75%,
    transparent 100%
  ) !important;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15) !important;
}

.book-wrapper.mobile-mode .book-spine-crease::before,
.book-wrapper.single-page-mode .book-spine-crease::before,
.book-spine-crease.spine-left::before {
  top: -3px;
  width: 14px;
  height: 7px;
}

.book-wrapper.mobile-mode .book-spine-crease::after,
.book-wrapper.single-page-mode .book-spine-crease::after,
.book-spine-crease.spine-left::after {
  bottom: -3px;
  width: 14px;
  height: 7px;
}

.book-wrapper.single-page-mode .book-page-panel.left-panel {
  display: none !important;
}

.book-wrapper.single-page-mode .book-page-panel.right-panel {
  border-radius: var(--page-corner-radius);
}

.book-wrapper.single-page-mode .book-edge.left {
  display: block !important;
  left: -7px !important;
  opacity: 1 !important;
}

.book-wrapper.single-page-mode .right-panel .page-spine-shadow {
  display: block !important;
  left: 0 !important;
  width: 44px !important;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.22) 0%, rgba(0, 0, 0, 0.08) 50%, transparent 100%) !important;
}

.flipbook-container {
  position: relative;
  display: flex;
  transform-style: preserve-3d;
  box-shadow: var(--book-shadow-ambient);
  border-radius: var(--page-corner-radius);
  background: #ffffff;
}

.book-edge {
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 8px;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.3s ease, width 0.3s ease;
}

.book-edge.left {
  left: -7px;
  background: repeating-linear-gradient(
    to bottom,
    #ffffff,
    #ffffff 2px,
    #e2e4e8 2px,
    #e2e4e8 4px
  );
  border-left: 1px solid #d4d8de;
  border-radius: 3px 0 0 3px;
  box-shadow: -3px 4px 12px rgba(0, 0, 0, 0.1);
}

.book-edge.right {
  right: -7px;
  background: repeating-linear-gradient(
    to bottom,
    #ffffff,
    #ffffff 2px,
    #e2e4e8 2px,
    #e2e4e8 4px
  );
  border-right: 1px solid #d4d8de;
  border-radius: 0 3px 3px 0;
  box-shadow: 3px 4px 12px rgba(0, 0, 0, 0.1);
}

.book-page-panel {
  position: relative;
  overflow: hidden;
  background: #ffffff;
  transform-style: preserve-3d;
  cursor: pointer;
}

.book-page-panel.left-panel {
  border-radius: var(--page-corner-radius) 0 0 var(--page-corner-radius);
}

.book-page-panel.right-panel {
  border-radius: 0 var(--page-corner-radius) var(--page-corner-radius) 0;
}

.page-img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.page-spine-shadow {
  position: absolute;
  top: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 5;
}

.left-panel .page-spine-shadow {
  right: 0;
  width: 52px;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.24) 0%, rgba(0, 0, 0, 0.08) 40%, transparent 100%);
}

.right-panel .page-spine-shadow {
  left: 0;
  width: 52px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.24) 0%, rgba(0, 0, 0, 0.08) 40%, transparent 100%);
}

.page-edge-highlight {
  position: absolute;
  top: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 6;
}

.left-panel .page-edge-highlight {
  left: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.8);
}

.right-panel .page-edge-highlight {
  right: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.8);
}

/* ==========================================================================
   3D FLIPPING LEAF (PAGE TURN ANIMATION)
   ========================================================================== */
.flipping-leaf {
  position: absolute;
  top: 0;
  bottom: 0;
  transform-style: preserve-3d;
  z-index: 35;
  will-change: transform;
  pointer-events: auto;
  cursor: grab;
}

.flipping-leaf.turn-right-to-left {
  right: 0;
  transform-origin: 0% 50%;
  border-radius: 0 var(--page-corner-radius) var(--page-corner-radius) 0;
}

.flipping-leaf.turn-left-to-right {
  left: 0;
  transform-origin: 100% 50%;
  border-radius: var(--page-corner-radius) 0 0 var(--page-corner-radius);
}

.leaf-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #ffffff;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
}

.leaf-face.front {
  z-index: 2;
  transform: rotateY(0deg);
}

.leaf-face.back {
  z-index: 1;
  transform: rotateY(180deg);
}

.leaf-lighting-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.04s linear;
}

.leaf-face.front .leaf-lighting-overlay {
  background: linear-gradient(to right, rgba(0,0,0,0.45) 0%, rgba(255,255,255,0.28) 28%, rgba(0,0,0,0.12) 70%, rgba(0,0,0,0.35) 100%);
}

.leaf-face.back .leaf-lighting-overlay {
  background: linear-gradient(to left, rgba(0,0,0,0.45) 0%, rgba(255,255,255,0.28) 28%, rgba(0,0,0,0.12) 70%, rgba(0,0,0,0.35) 100%);
}

.page-cast-shadow {
  position: absolute;
  top: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 25;
  opacity: 0;
  transition: opacity 0.04s linear;
}

.page-cast-shadow.left-cast {
  left: 0;
  right: 50%;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.48) 0%, rgba(0, 0, 0, 0.16) 40%, transparent 80%);
}

.page-cast-shadow.right-cast {
  left: 50%;
  right: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.48) 0%, rgba(0, 0, 0, 0.16) 40%, transparent 80%);
}

/* Corner Peel Zones */
.corner-peel-zone {
  position: absolute;
  width: 60px;
  height: 60px;
  pointer-events: auto;
  cursor: pointer;
  z-index: 20;
}

.corner-peel-zone.bottom-right {
  bottom: 0;
  right: 0;
}

.corner-peel-zone.bottom-left {
  bottom: 0;
  left: 0;
}

.corner-dog-ear {
  position: absolute;
  width: 38px;
  height: 38px;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.corner-peel-zone.bottom-right .corner-dog-ear {
  bottom: 0;
  right: 0;
  background: linear-gradient(135deg, transparent 50%, rgba(0, 0, 0, 0.1) 50%, rgba(255, 255, 255, 0.95) 54%, #e2e4e8 100%);
  border-radius: 0 0 var(--page-corner-radius) 0;
  box-shadow: -2px -2px 6px rgba(0, 0, 0, 0.08);
}

.corner-peel-zone.bottom-left .corner-dog-ear {
  bottom: 0;
  left: 0;
  background: linear-gradient(225deg, transparent 50%, rgba(0, 0, 0, 0.1) 50%, rgba(255, 255, 255, 0.95) 54%, #e2e4e8 100%);
  border-radius: 0 0 0 var(--page-corner-radius);
  box-shadow: 2px -2px 6px rgba(0, 0, 0, 0.08);
}

.corner-peel-zone:hover .corner-dog-ear {
  width: 52px;
  height: 52px;
  box-shadow: -4px -4px 12px rgba(0, 0, 0, 0.16);
}

/* Side Navigation Arrows */
.nav-arrow-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--ui-bg);
  backdrop-filter: var(--ui-blur);
  -webkit-backdrop-filter: var(--ui-blur);
  border: 1px solid var(--ui-border);
  box-shadow: var(--ui-shadow);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 60;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  outline: none;
}

.nav-arrow-btn.prev-btn {
  left: 28px;
}

.nav-arrow-btn.next-btn {
  right: 28px;
}

.nav-arrow-btn:hover {
  background: #ffffff;
  color: var(--brand-red);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.nav-arrow-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.nav-arrow-btn.disabled {
  opacity: 0.25;
  pointer-events: none;
}

.nav-arrow-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* ==========================================================================
   BOTTOM DESIGNER CONTROLS TOOLBAR
   ========================================================================== */
.footer-bar {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  height: 58px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  background: var(--ui-bg);
  backdrop-filter: var(--ui-blur);
  -webkit-backdrop-filter: var(--ui-blur);
  border: 1px solid var(--ui-border);
  border-radius: 18px;
  box-shadow: var(--ui-shadow);
  z-index: 100;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.footer-bar.autohide {
  opacity: 0;
  transform: translate(-50%, 20px);
  pointer-events: none;
}

.page-scrubber-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-scrubber {
  -webkit-appearance: none;
  appearance: none;
  width: 160px;
  height: 6px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.page-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--brand-red);
  box-shadow: 0 2px 6px rgba(217, 31, 38, 0.4);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.page-scrubber::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.page-indicator-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  min-width: 100px;
  text-align: center;
}

.page-number-input {
  width: 44px;
  height: 28px;
  text-align: center;
  border: 1px solid var(--ui-border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.95);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  outline: none;
}

.page-number-input:focus {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 2px rgba(217, 31, 38, 0.15);
}

.autoplay-indicator {
  position: relative;
  width: 22px;
  height: 22px;
  display: none;
}

.autoplay-indicator.active {
  display: block;
}

.autoplay-indicator svg {
  transform: rotate(-90deg);
  width: 22px;
  height: 22px;
}

.autoplay-circle-bg {
  stroke: rgba(0, 0, 0, 0.08);
  fill: none;
  stroke-width: 2.5;
}

.autoplay-circle-progress {
  stroke: var(--brand-red);
  fill: none;
  stroke-width: 2.5;
  stroke-dasharray: 56.5;
  stroke-dashoffset: 56.5;
  transition: stroke-dashoffset 0.1s linear;
}

/* ==========================================================================
   THUMBNAILS & DIRECTORY DRAWER (SLIDE-UP TRAY)
   ========================================================================== */
.thumbnails-drawer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 300px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: var(--ui-blur);
  -webkit-backdrop-filter: var(--ui-blur);
  border-top: 1px solid var(--ui-border);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.14);
  z-index: 150;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.thumbnails-drawer.open {
  transform: translateY(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  border-bottom: 1px solid var(--ui-border);
  gap: 16px;
}

.drawer-nav-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.drawer-tab-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
}

.drawer-tab-btn.active {
  background: var(--brand-red);
  color: #ffffff;
}

.drawer-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-close-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

.drawer-content-pane {
  flex: 1;
  overflow: hidden;
  display: none;
}

.drawer-content-pane.active {
  display: flex;
}

/* Thumbnails Scroll Container */
.thumbnails-scroll-container {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
}

.thumbnails-scroll-container::-webkit-scrollbar {
  height: 6px;
}

.thumbnails-scroll-container::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}

.thumbnail-card {
  position: relative;
  flex: 0 0 auto;
  height: 180px;
  aspect-ratio: var(--book-aspect);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  background: #f4f4f4;
}

.thumbnail-card:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.thumbnail-card.active {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(217, 31, 38, 0.35), 0 8px 20px rgba(0, 0, 0, 0.18);
  transform: translateY(-4px);
}

.thumbnail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumbnail-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.8);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

.thumbnail-title-tag {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 4px 6px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.75), transparent);
  color: #ffffff;
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Table of Contents Grid Pane */
.toc-grid-container {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  padding: 16px 24px;
  overflow-y: auto;
}

.toc-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toc-card-item:hover {
  border-color: var(--brand-red);
  background: rgba(217, 31, 38, 0.04);
  transform: translateY(-1px);
}

.toc-card-item.active {
  border-color: var(--brand-red);
  background: rgba(217, 31, 38, 0.08);
}

.toc-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.toc-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toc-category {
  font-size: 10px;
  font-weight: 600;
  color: var(--brand-gold-dark);
}

.toc-page-pill {
  font-size: 11px;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-primary);
  padding: 3px 8px;
  border-radius: 12px;
  flex-shrink: 0;
}

.toc-card-item:hover .toc-page-pill {
  background: var(--brand-red);
  color: #ffffff;
}

/* ==========================================================================
   HELP & SHORTCUTS MODAL
   ========================================================================== */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 30, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 90%;
  max-width: 480px;
  background: #ffffff;
  border-radius: 20px;
  padding: 24px 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-overlay.open .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
}

.key-badge {
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: monospace;
}

/* Toast Message */
.toast-notice {
  position: absolute;
  top: 86px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: rgba(20, 24, 33, 0.92);
  color: #ffffff;
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 500;
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 250;
}

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

/* ==========================================================================
   RESPONSIVE LAYOUT & MOBILE BREAKPOINTS
   ========================================================================== */
@media (max-width: 960px) {
  .brand-subtitle,
  .brand-tag {
    display: none;
  }
}

@media (max-width: 860px) {
  .header-bar {
    top: 10px;
    left: 10px;
    right: 10px;
    height: 52px;
    padding: 0 12px;
    gap: 8px;
  }

  .search-center-section {
    max-width: none;
    flex: 1;
  }

  .search-kbd-badge {
    display: none;
  }

  .nav-arrow-btn {
    display: none;
  }

  .footer-bar {
    bottom: 12px;
    height: 52px;
    gap: 8px;
    padding: 0 14px;
    width: calc(100% - 24px);
    max-width: 480px;
    justify-content: space-between;
  }

  .page-scrubber {
    width: 90px;
  }

  .thumbnails-drawer {
    height: 240px;
  }

  .thumbnail-card {
    height: 140px;
  }

  .book-wrapper.mobile-mode .book-spine-crease,
  .book-wrapper.single-page-mode .book-spine-crease {
    display: block !important;
    left: 0 !important;
    transform: translateX(-50%) !important;
  }

  .book-wrapper.mobile-mode .book-edge.left,
  .book-wrapper.single-page-mode .book-edge.left {
    display: block !important;
    left: -7px !important;
    opacity: 1 !important;
  }

  .book-wrapper.mobile-mode .flipbook-container,
  .book-wrapper.single-page-mode .flipbook-container {
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.15);
  }

  .book-wrapper.mobile-mode .book-page-panel.left-panel,
  .book-wrapper.single-page-mode .book-page-panel.left-panel {
    display: none !important;
  }

  .book-wrapper.mobile-mode .book-page-panel.right-panel,
  .book-wrapper.single-page-mode .book-page-panel.right-panel {
    border-radius: var(--page-corner-radius);
  }

  .book-wrapper.mobile-mode .right-panel .page-spine-shadow,
  .book-wrapper.single-page-mode .right-panel .page-spine-shadow {
    display: block !important;
    left: 0 !important;
    width: 44px !important;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.22) 0%, rgba(0, 0, 0, 0.08) 50%, transparent 100%) !important;
  }
}

@media (max-width: 540px) {
  .brand-section .brand-text {
    display: none;
  }

  .btn-divider {
    display: none;
  }

  .page-scrubber {
    display: none;
  }

  .page-indicator-text {
    min-width: 70px;
    font-size: 12px;
  }
}
