/* Granitolit — página Catálogo (revista interativa) */
.catalog-section { background: #fff; padding: 56px 0 90px; }
.catalog-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 48px; align-items: start; }

/* ---------- Flipbook ---------- */
.flipbook { position: relative; background: #fff; border-radius: 10px; }
/* Sem barras de rolagem: no tamanho normal nada transborda; com zoom a área rola por arraste/roda/toque */
.fb-stage { position: relative; overflow: hidden; padding: 6px 0 10px; min-height: 380px; scrollbar-width: none; -ms-overflow-style: none; overscroll-behavior: contain; }
.fb-stage::-webkit-scrollbar { display: none; }
.fb-stage.is-zoomed { overflow: auto; }
.fb-holder { position: relative; margin: 0 auto; }
.fb-book { margin: 0 auto; }
.fb-book .stf__block { will-change: transform; }
.fb-book .stf__item { backface-visibility: hidden; }
.fb-page { background: #fff; overflow: hidden; }
.fb-page img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; pointer-events: none; background: #f1efea; }

.fb-arrow {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 46px;
  height: 64px;
  margin-top: -32px;
  display: grid;
  place-items: center;
  color: #fff;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .55));
  transition: transform .2s, opacity .2s;
}
.fb-arrow svg { width: 38px; height: 38px; stroke-width: 2.2; }
.fb-arrow:hover { transform: scale(1.12); }
.fb-arrow[disabled] { opacity: 0; pointer-events: none; }
.fb-arrow-prev { left: 2px; }
.fb-arrow-next { right: 2px; }

.fb-loading { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; background: #fff; color: var(--muted); font-size: 14px; }
.fb-loading span { display: flex; align-items: center; gap: 12px; }
.fb-loading span::before { content: ''; width: 22px; height: 22px; border-radius: 50%; border: 3px solid #e7e3da; border-top-color: var(--yellow); animation: fb-spin .8s linear infinite; }
@keyframes fb-spin { to { transform: rotate(360deg); } }

/* ---------- Barra de ferramentas ---------- */
.fb-toolbar {
  position: relative;
  z-index: 8;
  display: flex;
  align-items: stretch;
  width: max-content;
  max-width: 100%;
  margin: 14px auto 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .13);
}
.fb-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  padding: 0 14px;
  background: #f3f2ef;
  border-radius: 8px 0 0 8px;
  color: #666;
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
}
.fb-btn { width: 46px; height: 48px; display: grid; place-items: center; color: #5f5f5c; transition: color .15s, background .15s; }
.fb-btn svg { width: 21px; height: 21px; stroke-width: 1.8; }
.fb-btn:hover { color: var(--green); background: #f7f6f2; }
.fb-btn[disabled] { opacity: .35; pointer-events: none; }
.fb-btn:last-child { border-radius: 0 8px 8px 0; }

.fb-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  min-width: 230px;
  padding: 8px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .18);
  display: none;
}
.fb-menu.open { display: block; }
.fb-menu a, .fb-menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-align: left;
}
.fb-menu a:hover, .fb-menu button:hover { background: var(--cream); color: var(--green); }
.fb-menu svg { width: 18px; height: 18px; }

/* ---------- Miniaturas ---------- */
.fb-thumbs {
  position: absolute;
  inset: 0 0 auto 0;
  bottom: 70px;
  z-index: 7;
  display: none;
  overflow: auto;
  padding: 22px;
  background: rgba(250, 249, 246, .98);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.fb-thumbs.open { display: block; }
.fb-thumbs-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.fb-thumbs-head strong { font-family: var(--serif); font-weight: 500; font-size: 20px; }
.fb-thumbs-head button { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; }
.fb-thumbs-head button:hover { background: #fff; }
.fb-thumbs-head svg { width: 22px; height: 22px; }
.fb-thumbs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 16px; }
.fb-thumb { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.fb-thumb img { width: 100%; aspect-ratio: 612 / 792; object-fit: cover; border-radius: 4px; border: 2px solid transparent; box-shadow: 0 3px 10px rgba(0, 0, 0, .1); transition: transform .2s, border-color .2s; }
.fb-thumb:hover img { transform: translateY(-3px); }
.fb-thumb.current img { border-color: var(--yellow); }
.fb-thumb.current span { color: var(--ink); font-weight: 600; }

/* ---------- Tela cheia ---------- */
.flipbook:fullscreen, .flipbook.fb-fake-fs { background: #1c1c1a; padding: 22px 16px; display: flex; flex-direction: column; justify-content: center; border-radius: 0; }
.flipbook.fb-fake-fs { position: fixed; inset: 0; z-index: 400; overflow: auto; }
.flipbook:fullscreen .fb-stage, .flipbook.fb-fake-fs .fb-stage { flex: 0 1 auto; }
.flipbook:fullscreen .fb-loading, .flipbook.fb-fake-fs .fb-loading { background: #1c1c1a; }

/* ---------- Lateral ---------- */
.catalog-aside { position: sticky; top: 104px; display: flex; flex-direction: column; gap: 20px; }
.btn-catalog { height: 54px; border-radius: 10px; font-size: 16px; background: #111; color: #fff; }
.btn-catalog:hover { background: var(--green); }
.catalog-cover { display: block; }
.catalog-cover img { width: 100%; height: auto; box-shadow: 0 16px 36px rgba(0, 0, 0, .18); transition: transform .3s, box-shadow .3s; }
.catalog-cover:hover img { transform: translateY(-4px); box-shadow: 0 22px 44px rgba(0, 0, 0, .22); }
.catalog-meta { font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.catalog-meta strong { color: var(--ink); font-weight: 600; }

.fb-fallback .fb-arrow { display: grid; }

@media (max-width: 980px) {
  .catalog-layout { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .catalog-aside { position: static; display: grid; grid-template-columns: 180px 1fr; align-items: center; gap: 20px 26px; }
  .catalog-aside .btn-catalog { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .catalog-section { padding: 36px 0 70px; }
  .fb-btn { width: 40px; }
  .fb-counter { min-width: 58px; padding: 0 10px; }
  .fb-arrow { width: 36px; }
  .fb-arrow svg { width: 30px; height: 30px; }
  .catalog-aside { grid-template-columns: 130px 1fr; }
  .fb-thumbs-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px; }
}
