/* 3D catalog flipbook — luxury viewer (StPageFlip) */

/* StPageFlip core layout (from library) */
.stf__parent {
  position: relative;
  display: block;
  box-sizing: border-box;
  transform: translateZ(0);
  touch-action: pan-y;
}

.stf__wrapper {
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.stf__parent canvas {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
}

.stf__block {
  position: absolute;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  perspective: 2000px;
}

.stf__item {
  display: none;
  position: absolute;
  transform-style: preserve-3d;
}

.stf__outerShadow,
.stf__innerShadow,
.stf__hardShadow,
.stf__hardInnerShadow {
  position: absolute;
  left: 0;
  top: 0;
}

/* Catalog page shell — flipbook needs room inside the site viewer */
.shell--catalog .fargah-viewer__screen {
  overflow: visible;
}

.shell--catalog .fargah-viewer__screen > .motion-particles,
.shell--catalog .fargah-viewer__screen > .motion-grid,
.shell--catalog .fargah-viewer__screen > .motion-vignette,
.shell--catalog .fargah-viewer__screen > .motion-cursor-glow {
  display: none;
}

.shell--catalog .fargah-viewer__screen > main {
  z-index: 4;
}

/* Header — match home overlay menu on dark catalogue stage */
.shell--catalog .fargah-header--overlay {
  background: rgba(5, 5, 8, 0.72) !important;
  border-bottom-color: rgba(212, 175, 90, 0.15) !important;
}

.shell--catalog .fargah-header--overlay .fargah-nav > li > a {
  color: rgba(240, 237, 230, 0.82);
}

.shell--catalog .fargah-header--overlay .fargah-nav > li > a:hover,
.shell--catalog .fargah-header--overlay .fargah-nav > li > a.active {
  color: #e4c47a;
}

.shell--catalog .fargah-header--overlay.fargah-header--scrolled {
  background: rgba(5, 5, 8, 0.95) !important;
  border-bottom-color: rgba(212, 175, 90, 0.22) !important;
}

.shell--catalog .fargah-header--overlay .header-icon-btn,
.shell--catalog .fargah-header--overlay .theme-toggle,
.shell--catalog .fargah-header--overlay .locale-toggle,
.shell--catalog .fargah-header--overlay .locale-dropdown__trigger {
  color: rgba(240, 237, 230, 0.82);
}

.shell--catalog .fargah-header--overlay .header-icon-btn:hover,
.shell--catalog .fargah-header--overlay .theme-toggle:hover,
.shell--catalog .fargah-header--overlay .locale-toggle:hover,
.shell--catalog .fargah-header--overlay .locale-dropdown__trigger:hover {
  color: #e4c47a;
}

.shell--catalog .fargah-header--overlay .header-search-panel {
  background: rgba(5, 5, 8, 0.96);
  border-bottom-color: rgba(212, 175, 90, 0.18);
}

/* Hero */
.page-hero.catalog-page--flipbook {
  padding: calc(var(--header-height, 88px) + clamp(32px, 5vw, 48px)) 0 clamp(20px, 3vw, 32px);
  background: transparent;
  border-bottom: 0;
  text-align: center;
}

.page-hero.catalog-page--flipbook .gold-divider {
  margin-inline: auto;
}

.page-hero.catalog-page--flipbook .page-hero__title {
  color: #f4f2ed;
  margin-bottom: 12px;
}

.page-hero.catalog-page--flipbook .page-hero__subtitle {
  margin: 0 auto;
  max-width: 58ch;
  color: rgba(244, 242, 237, 0.68);
  font-size: 0.95rem;
  line-height: 1.75;
}

/* Flipbook stage */
.catalog-flipbook-stage {
  position: relative;
  padding: clamp(8px, 2vw, 20px) 0 clamp(40px, 6vw, 72px);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(200, 164, 93, 0.14), transparent 62%),
    radial-gradient(ellipse 50% 40% at 15% 80%, rgba(221, 232, 198, 0.06), transparent 55%),
    linear-gradient(180deg, #0a0a10 0%, #050508 52%, #08080c 100%);
  overflow: visible;
}

.catalog-flipbook-stage__ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.catalog-flipbook-stage__glow {
  position: absolute;
  width: 42vw;
  height: 42vw;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
}

.catalog-flipbook-stage__glow--left {
  top: 18%;
  left: -8%;
  background: rgba(200, 164, 93, 0.22);
}

.catalog-flipbook-stage__glow--right {
  bottom: 8%;
  right: -6%;
  background: rgba(120, 140, 180, 0.14);
}

.catalog-flipbook-stage__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, black 0%, transparent 92%);
  opacity: 0.35;
}

.catalog-flipbook-stage__inner {
  position: relative;
  z-index: 1;
}

.catalog-flipbook-stage__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: clamp(20px, 3vw, 32px);
}

.catalog-flipbook-stage__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 5px 12px;
  border: 1px solid rgba(200, 164, 93, 0.35);
  border-radius: 999px;
  color: var(--accent-gold);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.catalog-flipbook-stage__title {
  margin: 0 0 8px;
  color: #f4f2ed;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  letter-spacing: -0.02em;
}

.catalog-flipbook-stage__subtitle {
  margin: 0;
  max-width: 52ch;
  color: rgba(244, 242, 237, 0.62);
  font-size: 0.92rem;
  line-height: 1.7;
}

.catalog-flipbook-stage__viewer {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: clamp(440px, 64vh, 760px);
  padding: clamp(16px, 3vw, 28px) clamp(24px, 5vw, 56px);
  overflow: visible;
}

.catalog-flipbook-stage__book-shell {
  position: relative;
  width: 100%;
  max-width: min(100%, 1040px);
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 2400px;
}

.catalog-flipbook-stage__book-shadow {
  position: absolute;
  bottom: -5%;
  left: 50%;
  width: min(76%, 720px);
  height: 40px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.62) 0%, transparent 72%);
  filter: blur(12px);
  pointer-events: none;
}

.catalog-flipbook {
  position: relative;
  margin: 0 auto;
  min-height: 360px;
}

.catalog-flipbook:not(.is-flipbook-ready) {
  width: min(100%, 520px);
  aspect-ratio: 520 / 680;
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04);
}

.catalog-flipbook:not(.is-flipbook-ready) .catalog-flipbook__page {
  position: absolute;
  inset: 0;
}

.catalog-flipbook:not(.is-flipbook-ready) .catalog-flipbook__page:not(:first-child) {
  visibility: hidden;
  pointer-events: none;
}

.catalog-flipbook.is-flipbook-ready,
.catalog-flipbook.stf__parent {
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04);
}

.catalog-flipbook__page {
  position: relative;
  overflow: hidden;
  background: #f7f4ee;
  color: #1a1a1a;
}

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

.catalog-flipbook__page--spread {
  background: #111;
}

.catalog-flipbook__page-caption {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 14px 16px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.82));
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
  z-index: 2;
}

.catalog-flipbook__page-num {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  z-index: 2;
}

.catalog-flipbook__cover,
.catalog-flipbook__back {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  height: 100%;
  min-height: 100%;
  padding: 32px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 20%, rgba(200, 164, 93, 0.18), transparent 55%),
    linear-gradient(160deg, #12100c 0%, #1c1812 45%, #0d0b08 100%);
  color: #f4f2ed;
}

.catalog-flipbook__cover-logo {
  max-width: min(220px, 70%);
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.35));
}

.catalog-flipbook__cover-eyebrow {
  margin: 0;
  max-width: 28ch;
  color: rgba(244, 242, 237, 0.68);
  font-size: 0.78rem;
  line-height: 1.6;
}

.catalog-flipbook__cover-title {
  margin: 0;
  font-size: clamp(1.2rem, 2.4vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent-gold);
}

.catalog-flipbook__cover-year {
  margin: 0;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: rgba(244, 242, 237, 0.22);
}

.catalog-flipbook__back h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--accent-gold);
}

.catalog-flipbook__back p {
  margin: 0;
  max-width: 26ch;
  color: rgba(244, 242, 237, 0.72);
  font-size: 0.86rem;
  line-height: 1.75;
}

.catalog-flipbook__back-cta {
  margin-top: 8px;
  padding: 10px 18px;
  border: 1px solid rgba(200, 164, 93, 0.45);
  border-radius: 999px;
  color: var(--accent-gold);
  font-size: 0.8rem;
  font-weight: 700;
}

.catalog-flipbook-stage__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 3vw, 28px);
  margin-top: 12px;
}

.catalog-flipbook-stage__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(200, 164, 93, 0.28);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: #f4f2ed;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.2s;
}

[dir="rtl"] .catalog-flipbook-stage__nav svg {
  transform: scaleX(-1);
}

.catalog-flipbook-stage__nav:hover:not(:disabled) {
  border-color: var(--accent-gold);
  background: rgba(200, 164, 93, 0.12);
  color: var(--accent-gold);
  transform: translateY(-1px);
}

.catalog-flipbook-stage__nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.catalog-flipbook-stage__status {
  min-width: min(100%, 320px);
  text-align: center;
}

.catalog-flipbook-stage__counter {
  display: block;
  color: #f4f2ed;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.catalog-flipbook-stage__caption {
  display: block;
  margin-top: 4px;
  min-height: 1.4em;
  color: rgba(244, 242, 237, 0.55);
  font-size: 0.8rem;
}

.catalog-flipbook-stage__thumbs-rail {
  margin-top: clamp(20px, 3vw, 32px);
  padding: clamp(14px, 2.4vw, 20px) clamp(12px, 2vw, 18px);
  border: 1px solid rgba(200, 164, 93, 0.18);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(8, 8, 12, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 48px rgba(0, 0, 0, 0.28);
}

.catalog-flipbook-stage__thumbs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-inline: 4px;
}

.catalog-flipbook-stage__thumbs-label {
  color: #f4f2ed;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.catalog-flipbook-stage__thumbs-count {
  color: rgba(244, 242, 237, 0.48);
  font-size: 0.74rem;
  font-weight: 600;
}

.catalog-flipbook-stage__thumbs-scroll {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.catalog-flipbook-stage__thumbs-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border: 1px solid rgba(200, 164, 93, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(244, 242, 237, 0.78);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s, opacity 0.2s;
}

[dir="rtl"] .catalog-flipbook-stage__thumbs-arrow svg {
  transform: scaleX(-1);
}

.catalog-flipbook-stage__thumbs-arrow:hover:not(:disabled) {
  border-color: var(--accent-gold);
  background: rgba(200, 164, 93, 0.12);
  color: var(--accent-gold);
}

.catalog-flipbook-stage__thumbs-arrow:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.catalog-flipbook-stage__thumbs {
  display: flex;
  gap: 12px;
  padding: 6px 4px 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 164, 93, 0.45) rgba(255, 255, 255, 0.06);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}

.catalog-flipbook-stage__thumbs::-webkit-scrollbar {
  height: 6px;
}

.catalog-flipbook-stage__thumbs::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.catalog-flipbook-stage__thumbs::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(200, 164, 93, 0.45);
}

.catalog-flipbook-stage__thumb {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 78px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  opacity: 0.68;
  transition: opacity 0.2s, transform 0.2s;
}

.catalog-flipbook-stage__thumb-preview {
  position: relative;
  display: block;
  width: 78px;
  height: 102px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  background: #111;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.catalog-flipbook-stage__thumb-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.catalog-flipbook-stage__thumb-preview--cover {
  display: grid;
  place-items: center;
  padding: 10px;
  background:
    radial-gradient(circle at 50% 18%, rgba(200, 164, 93, 0.2), transparent 58%),
    linear-gradient(160deg, #12100c 0%, #1c1812 50%, #0d0b08 100%);
}

.catalog-flipbook-stage__thumb-preview--cover img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}

.catalog-flipbook-stage__thumb-preview--back {
  display: grid;
  place-items: center;
  color: var(--accent-gold);
  background:
    radial-gradient(circle at 50% 24%, rgba(200, 164, 93, 0.16), transparent 60%),
    linear-gradient(160deg, #12100c 0%, #1c1812 50%, #0d0b08 100%);
}

.catalog-flipbook-stage__thumb-num {
  color: rgba(244, 242, 237, 0.55);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1;
}

.catalog-flipbook-stage__thumb:hover {
  opacity: 0.92;
}

.catalog-flipbook-stage__thumb:hover .catalog-flipbook-stage__thumb-preview {
  border-color: rgba(200, 164, 93, 0.45);
  transform: translateY(-2px);
}

.catalog-flipbook-stage__thumb.is-active {
  opacity: 1;
}

.catalog-flipbook-stage__thumb.is-active .catalog-flipbook-stage__thumb-preview {
  border-color: var(--accent-gold);
  box-shadow:
    0 0 0 1px rgba(200, 164, 93, 0.35),
    0 12px 28px rgba(0, 0, 0, 0.38);
  transform: translateY(-3px) scale(1.03);
}

.catalog-flipbook-stage__thumb.is-active .catalog-flipbook-stage__thumb-num {
  color: var(--accent-gold);
}

/* Downloads section below flipbook */
.shell--catalog .catalog-page__downloads {
  background:
    linear-gradient(180deg, #08080c 0%, var(--bg-primary) 18%);
  border-top: 1px solid rgba(200, 164, 93, 0.12);
}

.shell--catalog .catalog-page__downloads .catalog-panel,
.shell--catalog .catalog-page__downloads .consultation-panel {
  border: 1px solid rgba(200, 164, 93, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
}

.shell--catalog .catalog-page__downloads .section-title {
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .catalog-flipbook-stage__header {
    align-items: flex-start;
  }

  .catalog-flipbook-stage__viewer {
    min-height: 56vh;
    padding-inline: 16px;
  }

  .catalog-flipbook-stage__thumbs-rail {
    padding-inline: 10px;
  }

  .catalog-flipbook-stage__thumbs-scroll {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .catalog-flipbook-stage__thumbs-arrow {
    display: none;
  }

  .catalog-flipbook-stage__thumb {
    width: 68px;
  }

  .catalog-flipbook-stage__thumb-preview {
    width: 68px;
    height: 90px;
  }

  .page-hero.catalog-page--flipbook {
    padding-top: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .catalog-flipbook-stage__nav {
    transition: none;
  }
}
