.ricco-catalogo,
.ricco-catalogo * {
  box-sizing: border-box;
}

.ricco-catalogo {
  position: relative;
  isolation: isolate;
  --ricco-catalogo-bg: #f5f5f3;
  --ricco-controls-bg: rgba(255, 255, 255, 0.96);
  --ricco-controls-border: rgba(0, 0, 0, 0.12);
  --ricco-controls-text: #20252b;
  --ricco-accent: #0f4a77;
  width: 100%;
  height: 720px;
  min-height: 460px;
  overflow: hidden;
  color: #20252b;
  background: var(--ricco-catalogo-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.ricco-catalogo-controls {
  position: absolute;
  z-index: 90;
  top: 0;
  bottom: 0;
  left: 0;
  width: 48px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 5px;
  border-right: 1px solid var(--ricco-controls-border);
  color: var(--ricco-controls-text);
  background: var(--ricco-controls-bg);
  box-shadow: 4px 0 18px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.ricco-controls-main,
.ricco-controls-extra,
.ricco-secondary-tools {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.ricco-controls-extra {
  margin-top: 4px;
}

.ricco-secondary-tools {
  width: 100%;
}

.ricco-mobile-tools-toggle {
  display: none;
}

.ricco-mobile-fullscreen {
  display: none;
}

.ricco-control-divider {
  width: 24px;
  height: 1px;
  margin: 3px 0;
  background: rgba(0, 0, 0, 0.12);
}

.ricco-tool {
  width: 38px;
  height: 38px;
  min-width: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: inherit;
  background: transparent;
  text-decoration: none;
  font: inherit;
  line-height: 1;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, opacity 140ms ease;
}

.ricco-tool svg {
  width: 21px;
  height: 21px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.ricco-tool:hover,
.ricco-tool:focus-visible,
.ricco-tool[aria-expanded="true"] {
  color: var(--ricco-accent);
  background: rgba(15, 74, 119, 0.09);
  outline: none;
}

.ricco-tool:disabled {
  opacity: 0.28;
  cursor: default;
  background: transparent;
}

.ricco-page-counter {
  width: 38px;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 5px 2px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  color: #697079;
  font-size: 9px;
  line-height: 1;
}

.ricco-current-page {
  width: 32px !important;
  height: 25px !important;
  min-height: 0 !important;
  padding: 0 2px !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 6px !important;
  color: #20252b !important;
  background: #f4f5f6 !important;
  text-align: center;
  font: inherit !important;
  font-size: 11px !important;
  appearance: textfield;
}

.ricco-current-page::-webkit-outer-spin-button,
.ricco-current-page::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.ricco-page-total {
  font-size: 9px;
  white-space: nowrap;
}

.ricco-zoom-reset {
  width: 40px;
  min-width: 40px;
  font-size: 9px;
  font-weight: 700;
}

.ricco-book-viewport {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 10px 12px 10px 60px;
  background: var(--ricco-catalogo-bg);
  outline: none;
  touch-action: none;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.ricco-book-viewport:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(15, 74, 119, 0.45);
}

.ricco-book-viewport.is-zoomed {
  align-items: flex-start;
  justify-content: flex-start;
  overflow: auto;
  padding: 0 0 0 48px;
  cursor: grab;
}

.ricco-book-viewport.is-panning {
  cursor: grabbing;
}

.ricco-instant-preview {
  position: absolute;
  z-index: 2;
  inset: 10px 12px 10px 60px;
  width: calc(100% - 72px);
  height: calc(100% - 20px);
  display: block;
  object-fit: contain;
  object-position: center;
  opacity: 1;
  transition: opacity 120ms ease, visibility 120ms ease;
  pointer-events: none;
}

.ricco-catalogo.is-ready .ricco-instant-preview {
  opacity: 0;
  visibility: hidden;
}

.ricco-book-stage {
  position: relative;
  flex: 0 0 auto;
  margin: auto;
}

.ricco-book-viewport.is-zoomed .ricco-book-stage {
  margin: 0 auto;
}

.ricco-zoom-layer {
  position: absolute;
  inset: 0 auto auto 0;
  transform-origin: 0 0;
  will-change: transform;
}

.ricco-pageflip {
  position: relative;
  margin: 0;
  perspective: 3200px;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.ricco-book-viewport.is-zoomed .ricco-pageflip,
.ricco-catalogo.is-pinching .ricco-pageflip {
  pointer-events: none;
}

.ricco-book-page {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.ricco-book-page-blank {
  background: transparent;
  box-shadow: none;
}

.ricco-page-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #fff;
  user-select: none;
  pointer-events: none;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.ricco-page-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #8a8f98;
  background: #f3f4f5;
  font-size: 13px;
  transition: opacity 120ms ease;
}

.ricco-book-page:not(.is-loading) .ricco-page-placeholder {
  opacity: 0;
  pointer-events: none;
}

.ricco-catalogo-status {
  position: absolute;
  z-index: 120;
  left: 50%;
  top: 50%;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(440px, calc(100% - 40px));
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9px;
  color: #fff;
  background: rgba(14, 17, 20, 0.9);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, -50%);
  transition: opacity 140ms ease, visibility 140ms ease;
}

.ricco-catalogo.has-instant-preview .ricco-catalogo-status {
  top: 10px;
  right: 12px;
  left: auto;
  max-width: min(320px, calc(100% - 76px));
  padding: 7px 10px;
  font-size: 12px;
  transform: none;
}

.ricco-catalogo-status.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.ricco-catalogo-status.is-error {
  border-color: rgba(255, 110, 110, 0.4);
  background: rgba(92, 22, 22, 0.96);
}

.ricco-catalogo-status.is-error .ricco-spinner {
  display: none;
}

.ricco-spinner {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ricco-spin 0.75s linear infinite;
}

.ricco-panel-backdrop {
  position: absolute;
  z-index: 68;
  inset: 0;
  display: none;
  border: 0;
  background: rgba(0, 0, 0, 0.12);
}

.ricco-catalogo.has-panel-open .ricco-panel-backdrop {
  display: block;
}

.ricco-side-panel {
  position: absolute;
  z-index: 75;
  top: 0;
  bottom: 0;
  left: 48px;
  width: min(340px, calc(100% - 48px));
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.12);
  transform: translateX(calc(-100% - 8px));
  visibility: hidden;
  transition: transform 190ms ease, visibility 190ms ease;
}

.ricco-side-panel.is-open {
  transform: translateX(0);
  visibility: visible;
}

.ricco-panel-header {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.ricco-panel-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.ricco-panel-close {
  width: 34px;
  height: 34px;
  min-width: 34px;
}

.ricco-panel-body {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  padding: 14px;
}

.ricco-thumbnails-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.ricco-thumbnail-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  color: #20252b;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.ricco-thumbnail-item:hover,
.ricco-thumbnail-item.is-active {
  border-color: var(--ricco-accent);
  box-shadow: 0 0 0 1px var(--ricco-accent);
}

.ricco-thumbnail-item canvas {
  width: 64px;
  height: 82px;
  display: block;
  object-fit: contain;
  background: #f1f2f3;
}

.ricco-thumbnail-label {
  font-size: 13px;
  font-weight: 600;
}

.ricco-search-form {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.ricco-search-input,
.ricco-share-link {
  min-width: 0;
  flex: 1 1 auto;
  height: 40px;
  padding: 0 11px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 7px;
  color: #20252b;
  background: #fff;
  font: inherit;
  font-size: 14px;
}

.ricco-panel-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: #20252b;
  text-decoration: none;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.ricco-panel-button:hover,
.ricco-panel-button:focus-visible {
  color: #fff;
  background: var(--ricco-accent);
  outline: none;
}

.ricco-search-status {
  min-height: 22px;
  margin: 0 0 8px;
  color: #697079;
  font-size: 12px;
}

.ricco-search-results {
  display: grid;
  gap: 8px;
}

.ricco-search-result {
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 7px;
  color: #20252b;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.ricco-search-result strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.ricco-search-result span {
  display: block;
  color: #5f6670;
  font-size: 12px;
  line-height: 1.4;
}

.ricco-share-native {
  width: 100%;
  margin-bottom: 14px;
}

.ricco-share-options {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.ricco-share-option {
  justify-content: flex-start;
  color: #20252b;
  background: #f2f3f4;
}

.ricco-share-option:hover,
.ricco-share-option:focus-visible {
  color: #fff;
}

.ricco-share-copy {
  display: flex;
  gap: 8px;
}

.ricco-copy-feedback {
  min-height: 20px;
  margin: 8px 0 0;
  color: #27703e;
  font-size: 12px;
}

.ricco-zoom-navigator {
  position: absolute;
  z-index: 82;
  top: 12px;
  left: 62px;
  width: 190px;
  padding: 8px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.15);
  user-select: none;
}

.ricco-zoom-navigator[hidden] {
  display: none;
}

.ricco-zoom-navigator-canvas-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #eee;
  cursor: crosshair;
}

.ricco-zoom-navigator canvas {
  width: 100%;
  height: auto;
  display: block;
}

.ricco-zoom-navigator-window {
  position: absolute;
  min-width: 12px;
  min-height: 10px;
  border: 2px solid #0b9fe8;
  background: rgba(11, 159, 232, 0.08);
  pointer-events: none;
}

.ricco-zoom-navigator-label {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: #555d66;
  font-size: 11px;
}

.ricco-mobile-more {
  display: none;
}

.ricco-catalogo-error {
  padding: 18px;
  border-left: 4px solid #d63638;
  background: #fff2f2;
  color: #3c434a;
}

.ricco-catalogo:fullscreen,
.ricco-catalogo.is-fullscreen {
  width: 100vw;
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 100vh;
  min-height: 100dvh;
  border-radius: 0;
}

.ricco-catalogo-shell {
  width: 100%;
  margin: 0;
  padding: 0;
}

.ricco-catalogo-shell .ricco-catalogo {
  width: 100%;
  max-width: none;
  border-radius: 0;
  box-shadow: none;
}

.ricco-catalogo-standalone-page {
  margin: 0;
}

.ricco-catalogos-archive {
  width: min(1240px, calc(100% - 40px));
  margin: 50px auto;
}

.ricco-catalogos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.ricco-catalogo-card {
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
}

.ricco-catalogo-card a {
  color: inherit;
  text-decoration: none;
}

.ricco-catalogo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
}

.ricco-catalogo-card-placeholder {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  background: #eceef1;
  color: #696f78;
}

.ricco-catalogo-card h2 {
  margin: 0;
  padding: 18px;
  font-size: 18px;
}

@keyframes ricco-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 720px), (pointer: coarse) and (max-width: 1024px) {
  .ricco-catalogo {
    min-height: 500px;
    display: flex;
    flex-direction: column;
  }

  .ricco-catalogo-controls {
    position: relative;
    z-index: 95;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    min-height: 52px;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 2px;
    padding: 5px 6px;
    border-right: 0;
    border-bottom: 1px solid var(--ricco-controls-border);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  }

  .ricco-controls-main,
  .ricco-controls-extra {
    flex-direction: row;
    align-items: center;
    gap: 1px;
  }

  .ricco-controls-main {
    flex: 1 1 auto;
    min-width: 0;
  }

  .ricco-mobile-fullscreen {
    width: auto;
    min-width: 104px;
    display: inline-flex;
    gap: 6px;
    margin-left: 5px;
    padding: 0 10px;
    border: 1px solid rgba(15, 74, 119, 0.22);
    border-radius: 10px;
    color: #fff;
    background: var(--ricco-accent);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
  }

  .ricco-mobile-fullscreen:hover,
  .ricco-mobile-fullscreen:focus-visible {
    color: #fff;
    background: #0b3f67;
  }

  .ricco-mobile-fullscreen svg {
    width: 17px;
    height: 17px;
  }

  .ricco-controls-extra {
    margin-top: 0;
  }

  .ricco-secondary-tools {
    position: absolute;
    z-index: 110;
    top: calc(100% + 5px);
    right: 6px;
    width: auto;
    max-width: calc(100vw - 12px);
    display: none;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 2px;
    padding: 5px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.17);
  }

  .ricco-catalogo-controls.is-tools-open .ricco-secondary-tools {
    display: flex;
  }

  .ricco-mobile-tools-toggle {
    display: inline-flex;
  }

  .ricco-control-divider {
    width: 1px;
    height: 24px;
    margin: 0 2px;
  }

  .ricco-tool {
    width: 34px;
    min-width: 34px;
    height: 34px;
  }

  .ricco-tool svg {
    width: 19px;
    height: 19px;
  }

  .ricco-page-counter {
    width: auto;
    min-width: 48px;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px 4px;
    border-top: 0;
    border-bottom: 0;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
  }

  .ricco-current-page {
    width: 28px !important;
  }

  .ricco-book-viewport {
    position: relative;
    inset: auto;
    min-height: 0;
    flex: 1 1 auto;
    padding: 8px;
  }

  .ricco-book-viewport.is-zoomed {
    padding: 0;
  }

  .ricco-instant-preview {
    inset: 60px 8px 8px;
    width: calc(100% - 16px);
    height: calc(100% - 68px);
  }

  .ricco-catalogo.has-instant-preview .ricco-catalogo-status {
    top: 60px;
    right: 8px;
    max-width: calc(100% - 16px);
  }

  .ricco-panel-backdrop {
    top: 52px;
  }

  .ricco-side-panel {
    top: 52px;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    border-right: 0;
    transform: translateY(-104%);
  }

  .ricco-side-panel.is-open {
    transform: translateY(0);
  }

  .ricco-thumbnails-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ricco-thumbnail-item {
    grid-template-columns: 52px 1fr;
    gap: 8px;
  }

  .ricco-thumbnail-item canvas {
    width: 52px;
    height: 70px;
  }

  .ricco-zoom-navigator {
    top: 60px;
    left: 8px;
    width: 170px;
  }
}

@media (max-width: 390px) {
  .ricco-mobile-fullscreen {
    min-width: 38px;
    width: 38px;
    padding: 0;
    margin-left: 2px;
  }

  .ricco-mobile-fullscreen-label {
    display: none;
  }

  .ricco-tool {
    width: 31px;
    min-width: 31px;
    height: 31px;
  }

  .ricco-page-counter {
    min-width: 44px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .ricco-tool,
  .ricco-page-placeholder,
  .ricco-catalogo-status,
  .ricco-side-panel {
    transition: none;
  }

  .ricco-spinner {
    animation-duration: 1.5s;
  }
}

/* === Riccó Catálogos Interativos 0.2 === */
.ricco-page-canvas {
  position: relative;
  z-index: 1;
}

.ricco-page-placeholder {
  z-index: 2;
}

.ricco-page-interactions {
  position: absolute;
  z-index: 5;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ricco-interaction {
  position: absolute;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 1px;
  min-height: 1px;
  margin: 0;
  padding: clamp(2px, 0.7vw, 10px);
  border: 0;
  color: inherit;
  background: transparent;
  box-shadow: none;
  font: inherit;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}

.ricco-interaction.is-visible {
  border: 1px solid var(--ricco-interaction-border, #123f68);
  border-radius: var(--ricco-interaction-radius, 8px);
  color: var(--ricco-interaction-color, #fff);
  background: var(--ricco-interaction-bg, #123f68);
  opacity: var(--ricco-interaction-opacity, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
  font-size: var(--ricco-interaction-font-size, 14px);
  font-weight: 600;
}

.ricco-interaction.is-visible:hover,
.ricco-interaction.is-visible:focus-visible {
  filter: brightness(1.08);
  transform: translateY(-1px);
  outline: 2px solid rgba(18, 63, 104, 0.28);
  outline-offset: 2px;
}

.ricco-interaction.is-hotspot {
  color: transparent;
  background: transparent;
}

.ricco-interaction.is-hotspot:focus-visible {
  border: 2px solid #2271b1;
  color: #fff;
  background: rgba(18, 63, 104, 0.88);
  outline: 2px solid #fff;
  outline-offset: -4px;
}

.ricco-interaction.is-shortcode {
  display: block;
  padding: 0;
  overflow: visible;
  cursor: default;
}

.ricco-interaction.is-shortcode > * {
  max-width: 100%;
}

.ricco-quote-toggle {
  position: relative;
}

.ricco-quote-count {
  position: absolute;
  right: -3px;
  top: -4px;
  min-width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border-radius: 999px;
  color: #fff;
  background: #d63638;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.ricco-quote-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.09);
}

.ricco-quote-item > div {
  min-width: 0;
}

.ricco-quote-item strong,
.ricco-quote-item span {
  display: block;
}

.ricco-quote-item span {
  margin-top: 4px;
  color: #646970;
  font-size: 12px;
}

.ricco-quote-remove {
  flex: 0 0 auto;
  padding: 4px 0;
  border: 0;
  color: #b32d2e;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.ricco-quote-empty {
  color: #646970;
}

.ricco-quote-page-link {
  display: block;
  margin-top: 18px;
  text-align: center;
  text-decoration: none;
}

.ricco-interaction-toast {
  position: absolute;
  z-index: 210;
  left: 50%;
  bottom: 28px;
  max-width: min(520px, calc(100% - 40px));
  padding: 12px 17px;
  border-radius: 8px;
  color: #fff;
  background: rgba(18, 20, 24, 0.94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 12px);
  transition: opacity 160ms ease, visibility 160ms ease, transform 160ms ease;
}

.ricco-interaction-toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.ricco-interaction-lightbox {
  position: absolute;
  z-index: 300;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  color: #fff;
  background: rgba(9, 11, 14, 0.97);
}

.ricco-interaction-lightbox[hidden] {
  display: none;
}

.ricco-lightbox-toolbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.ricco-lightbox-caption {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ricco-lightbox-close {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-size: 29px;
  line-height: 1;
}

.ricco-lightbox-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
}

.ricco-lightbox-stage:active {
  cursor: grabbing;
}

.ricco-lightbox-image {
  display: block;
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
  transform-origin: center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
}

.ricco-lightbox-help {
  min-height: 38px;
  padding: 9px 15px;
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
  font-size: 12px;
}

.ricco-catalogo.has-interaction-lightbox .ricco-catalogo-controls,
.ricco-catalogo.has-interaction-lightbox .ricco-side-panel,
.ricco-catalogo.has-interaction-lightbox .ricco-zoom-navigator {
  visibility: hidden;
}

@media (max-width: 720px) {
  .ricco-interaction.is-visible {
    min-height: 34px;
    padding: 5px 8px;
    font-size: clamp(10px, 3vw, 13px) !important;
  }

  .ricco-interaction-toast {
    bottom: 74px;
  }

  .ricco-interaction-lightbox {
    position: fixed;
    z-index: 999999;
  }
}

/* Navegação interativa e mídia 0.2.1 */
.ricco-book-viewport {
  touch-action: pan-y;
}

.ricco-book-viewport.is-zoomed,
.ricco-catalogo.is-pinching .ricco-book-viewport {
  touch-action: none;
  overscroll-behavior: none;
}

.ricco-lightbox-media {
  width: min(1100px, 94%);
  height: min(720px, 88%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ricco-lightbox-media[hidden] {
  display: none;
}

.ricco-lightbox-media iframe,
.ricco-lightbox-media video {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
  background: #000;
}

.ricco-lightbox-media audio {
  width: min(680px, 92%);
}

.ricco-interaction {
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 720px) {
  .ricco-lightbox-media {
    width: 100%;
    height: 100%;
    padding: 8px;
  }

  .ricco-book-viewport.is-zoomed .ricco-book-stage {
    margin: 0;
  }
}


@media (max-height: 720px) and (orientation: landscape) and (pointer: coarse) {
  .ricco-catalogo {
    min-height: 320px;
  }

  .ricco-book-viewport {
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .ricco-catalogo-controls {
    width: 44px;
    padding: 3px;
  }

  .ricco-tool {
    width: 34px;
    height: 34px;
    min-width: 34px;
  }

  .ricco-tool svg {
    width: 19px;
    height: 19px;
  }
}


/* 0.2.6: virada rígida e uniforme em desktop e mobile. */
.ricco-catalogo.is-rigid-turn .ricco-pageflip {
  perspective: 2200px;
  transform-style: preserve-3d;
}

.ricco-catalogo.is-rigid-turn .ricco-book-page,
.ricco-catalogo.is-rigid-turn .ricco-page-canvas {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.ricco-catalogo.is-rigid-turn .ricco-page-interactions {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

@media (pointer: coarse) {
  .ricco-catalogo.is-rigid-turn .ricco-book-viewport:not(.is-zoomed) {
    touch-action: pan-y pinch-zoom;
  }
}


/* 0.2.7: mobile em paisagem deve usar somente a altura realmente visível. */
@media (orientation: landscape) and (pointer: coarse) {
  .ricco-catalogo {
    min-height: 260px;
  }

  .ricco-catalogo-controls {
    min-height: 44px;
    padding-top: 3px;
    padding-bottom: 3px;
  }

  .ricco-book-viewport {
    min-height: 0;
    padding-top: 4px;
    padding-bottom: 4px;
  }
}


/* 0.2.8: acesso evidente à tela cheia no mobile e melhor aproveitamento quando ativo. */
@media (max-width: 720px), (pointer: coarse) and (max-width: 1024px) {
  .ricco-catalogo.is-fullscreen,
  .ricco-catalogo:fullscreen {
    display: flex;
    flex-direction: column;
    background: #14171b;
  }

  .ricco-catalogo.is-fullscreen .ricco-catalogo-controls,
  .ricco-catalogo:fullscreen .ricco-catalogo-controls {
    min-height: 44px;
    padding: 4px 6px;
    color: #f7f8f9;
    border-bottom-color: rgba(255, 255, 255, 0.12);
    background: rgba(20, 23, 27, 0.94);
    box-shadow: none;
  }

  .ricco-catalogo.is-fullscreen .ricco-page-counter,
  .ricco-catalogo:fullscreen .ricco-page-counter {
    color: rgba(255, 255, 255, 0.78);
    border-color: rgba(255, 255, 255, 0.14);
  }

  .ricco-catalogo.is-fullscreen .ricco-current-page,
  .ricco-catalogo:fullscreen .ricco-current-page {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1) !important;
  }

  .ricco-catalogo.is-fullscreen .ricco-mobile-fullscreen,
  .ricco-catalogo:fullscreen .ricco-mobile-fullscreen {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.12);
  }

  .ricco-catalogo.is-fullscreen .ricco-book-viewport,
  .ricco-catalogo:fullscreen .ricco-book-viewport {
    flex: 1 1 auto;
    min-height: 0;
    padding: 4px;
    background: #14171b;
  }
}

@media (orientation: landscape) and (pointer: coarse) {
  .ricco-mobile-fullscreen {
    min-width: 98px;
    height: 34px;
  }

  .ricco-catalogo.is-fullscreen .ricco-mobile-fullscreen,
  .ricco-catalogo:fullscreen .ricco-mobile-fullscreen {
    min-width: 72px;
  }
}


/* 0.2.9: controles compactos e consistentes + fullscreen mobile orientado. */
.ricco-mobile-fullscreen-label {
  display: none !important;
}

/* No desktop o fullscreen permanece somente como ícone na barra lateral. */
.ricco-fullscreen {
  width: 38px;
  min-width: 38px;
  padding: 0;
}

@media (max-width: 720px), (pointer: coarse) and (max-width: 1024px) {
  /* Corrige overrides antigos de landscape que comprimiam a barra para 44px. */
  .ricco-catalogo-controls {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: 100% !important;
    min-height: 48px;
    flex: 0 0 auto;
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    gap: 2px;
    padding: 5px 6px !important;
    border-right: 0;
    border-bottom: 1px solid var(--ricco-controls-border);
  }

  .ricco-controls-main {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2px;
  }

  .ricco-controls-extra {
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1px;
    margin: 0 0 0 2px;
  }

  /* Indicador principal de fullscreen: quadrado azul, sem texto, estilo app/mobile. */
  .ricco-mobile-fullscreen {
    position: relative;
    order: 20;
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    margin: 0 0 0 auto !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 10px !important;
    color: #fff !important;
    background: var(--ricco-accent) !important;
    box-shadow: 0 3px 10px rgba(15, 74, 119, 0.22);
  }

  .ricco-mobile-fullscreen svg {
    width: 20px !important;
    height: 20px !important;
    stroke-width: 2 !important;
  }

  .ricco-mobile-fullscreen:active {
    transform: scale(0.94);
  }

  .ricco-catalogo.is-fullscreen .ricco-mobile-fullscreen,
  .ricco-catalogo:fullscreen .ricco-mobile-fullscreen {
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    background: rgba(255, 255, 255, 0.12) !important;
    box-shadow: none;
  }
}

@media (orientation: landscape) and (pointer: coarse) {
  .ricco-catalogo-controls {
    width: 100% !important;
    min-height: 44px !important;
    flex-direction: row !important;
    padding: 3px 6px !important;
  }

  .ricco-mobile-fullscreen {
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
  }
}


/* 0.3.0: fullscreen mobile adaptativo, sem forçar orientação. */
@media (max-width: 720px), (pointer: coarse) and (max-width: 1024px) {
  .ricco-catalogo.is-fullscreen,
  .ricco-catalogo:fullscreen {
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 0 !important;
    display: block !important;
    overflow: hidden;
    background: #14171b;
  }

  /* Em fullscreen, a barra vira overlay. Ela não rouba altura do PDF. */
  .ricco-catalogo.is-fullscreen .ricco-catalogo-controls,
  .ricco-catalogo:fullscreen .ricco-catalogo-controls {
    position: absolute !important;
    z-index: 220 !important;
    top: max(8px, env(safe-area-inset-top)) !important;
    right: 8px !important;
    bottom: auto !important;
    left: 8px !important;
    width: auto !important;
    min-height: 44px !important;
    max-width: calc(100% - 16px) !important;
    padding: 4px 5px !important;
    border: 1px solid rgba(255,255,255,.10) !important;
    border-radius: 13px !important;
    color: #fff !important;
    background: rgba(17, 20, 24, .78) !important;
    box-shadow: 0 6px 24px rgba(0,0,0,.20) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
  }

  .ricco-catalogo.is-fullscreen.are-controls-hidden .ricco-catalogo-controls,
  .ricco-catalogo:fullscreen.are-controls-hidden .ricco-catalogo-controls {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
  }

  .ricco-catalogo.is-fullscreen .ricco-book-viewport,
  .ricco-catalogo:fullscreen .ricco-book-viewport {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)) !important;
    background: #14171b !important;
  }

  .ricco-catalogo.is-fullscreen .ricco-book-viewport.is-zoomed,
  .ricco-catalogo:fullscreen .ricco-book-viewport.is-zoomed {
    padding: 0 !important;
  }

  /* O botão de fullscreen continua sendo só o símbolo, sem texto. */
  .ricco-catalogo.is-fullscreen .ricco-mobile-fullscreen,
  .ricco-catalogo:fullscreen .ricco-mobile-fullscreen {
    flex: 0 0 36px;
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
    color: #fff !important;
    background: rgba(255,255,255,.12) !important;
  }

  .ricco-catalogo.is-fullscreen .ricco-secondary-tools,
  .ricco-catalogo:fullscreen .ricco-secondary-tools {
    top: calc(100% + 7px);
    right: 0;
    color: #20252b;
  }
}

@media (orientation: landscape) and (pointer: coarse) {
  .ricco-catalogo.is-fullscreen .ricco-catalogo-controls,
  .ricco-catalogo:fullscreen .ricco-catalogo-controls {
    top: max(6px, env(safe-area-inset-top)) !important;
    right: max(6px, env(safe-area-inset-right)) !important;
    left: max(6px, env(safe-area-inset-left)) !important;
    min-height: 40px !important;
    padding: 2px 4px !important;
  }

  .ricco-catalogo.is-fullscreen .ricco-tool,
  .ricco-catalogo:fullscreen .ricco-tool {
    width: 32px;
    min-width: 32px;
    height: 32px;
  }

  .ricco-catalogo.is-fullscreen .ricco-mobile-fullscreen,
  .ricco-catalogo:fullscreen .ricco-mobile-fullscreen {
    width: 32px !important;
    min-width: 32px !important;
    height: 32px !important;
  }
}


/* 0.3.1: fullscreen mobile exclusivamente horizontal. */
.ricco-landscape-gate {
  position: absolute;
  z-index: 500;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 28px;
  text-align: center;
  color: #fff;
  background: #14171b;
}

.ricco-landscape-gate[hidden] {
  display: none !important;
}

.ricco-landscape-gate-icon {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 4px;
}

.ricco-landscape-gate strong {
  font-size: 18px;
}

.ricco-landscape-gate span {
  max-width: 280px;
  font-size: 13px;
  opacity: .78;
}

.ricco-catalogo.is-fullscreen.is-awaiting-landscape .ricco-landscape-gate,
.ricco-catalogo:fullscreen.is-awaiting-landscape .ricco-landscape-gate {
  display: flex;
}

.ricco-catalogo.is-fullscreen.is-awaiting-landscape .ricco-book-viewport,
.ricco-catalogo:fullscreen.is-awaiting-landscape .ricco-book-viewport {
  visibility: hidden;
}

.ricco-catalogo.is-fullscreen.is-orientation-transition .ricco-book-stage,
.ricco-catalogo:fullscreen.is-orientation-transition .ricco-book-stage {
  opacity: 0;
}

.ricco-catalogo.is-fullscreen .ricco-book-stage,
.ricco-catalogo:fullscreen .ricco-book-stage {
  transition: opacity 120ms ease;
}

@media (orientation: landscape) and (pointer: coarse) {
  .ricco-catalogo.is-fullscreen .ricco-book-viewport,
  .ricco-catalogo:fullscreen .ricco-book-viewport {
    padding: 4px max(8px, env(safe-area-inset-right)) 4px max(8px, env(safe-area-inset-left)) !important;
  }

  .ricco-catalogo.is-fullscreen .ricco-book-stage,
  .ricco-catalogo:fullscreen .ricco-book-stage {
    margin: auto;
  }
}

/* 0.3.3: fullscreen mobile sem apagão e controles fora do conteúdo. */
.ricco-catalogo.is-fullscreen.is-orientation-transition .ricco-book-stage,
.ricco-catalogo:fullscreen.is-orientation-transition .ricco-book-stage {
  opacity: 1 !important;
  visibility: visible !important;
}

.ricco-catalogo.is-fullscreen.is-awaiting-landscape .ricco-book-viewport,
.ricco-catalogo:fullscreen.is-awaiting-landscape .ricco-book-viewport {
  visibility: visible !important;
}

.ricco-landscape-gate {
  background: rgba(20, 23, 27, .76) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ricco-fullscreen.is-busy,
.ricco-mobile-fullscreen.is-busy {
  opacity: .55;
  pointer-events: none;
}

@media (orientation: landscape) and (pointer: coarse) {
  /* Barra lateral permanente, no estilo de um leitor de revista. Ela reserva
     espaço próprio e não fica por cima do conteúdo do catálogo. */
  .ricco-catalogo.is-fullscreen .ricco-catalogo-controls,
  .ricco-catalogo:fullscreen .ricco-catalogo-controls {
    position: absolute !important;
    z-index: 240 !important;
    top: 0 !important;
    right: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 100% !important;
    min-height: 0 !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 2px !important;
    padding: max(4px, env(safe-area-inset-top)) 4px max(4px, env(safe-area-inset-bottom)) !important;
    border: 0 !important;
    border-right: 1px solid rgba(255,255,255,.10) !important;
    border-radius: 0 !important;
    color: #f4f6f8 !important;
    background: rgba(17, 20, 24, .96) !important;
    box-shadow: 4px 0 16px rgba(0,0,0,.16) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
  }

  .ricco-catalogo.is-fullscreen.are-controls-hidden .ricco-catalogo-controls,
  .ricco-catalogo:fullscreen.are-controls-hidden .ricco-catalogo-controls {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
  }

  .ricco-catalogo.is-fullscreen .ricco-controls-main,
  .ricco-catalogo.is-fullscreen .ricco-controls-extra,
  .ricco-catalogo:fullscreen .ricco-controls-main,
  .ricco-catalogo:fullscreen .ricco-controls-extra {
    width: 100% !important;
    flex: 0 0 auto !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 1px !important;
    margin: 0 !important;
  }

  .ricco-catalogo.is-fullscreen .ricco-controls-extra,
  .ricco-catalogo:fullscreen .ricco-controls-extra {
    margin-top: 3px !important;
  }

  .ricco-catalogo.is-fullscreen .ricco-tool,
  .ricco-catalogo:fullscreen .ricco-tool,
  .ricco-catalogo.is-fullscreen .ricco-mobile-fullscreen,
  .ricco-catalogo:fullscreen .ricco-mobile-fullscreen {
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 8px !important;
  }

  .ricco-catalogo.is-fullscreen .ricco-mobile-fullscreen,
  .ricco-catalogo:fullscreen .ricco-mobile-fullscreen {
    display: inline-flex !important;
    color: #fff !important;
    background: var(--ricco-accent) !important;
    border: 1px solid rgba(255,255,255,.16) !important;
  }

  .ricco-catalogo.is-fullscreen .ricco-mobile-fullscreen-label,
  .ricco-catalogo:fullscreen .ricco-mobile-fullscreen-label {
    display: none !important;
  }

  .ricco-catalogo.is-fullscreen .ricco-page-counter,
  .ricco-catalogo:fullscreen .ricco-page-counter {
    width: 36px !important;
    min-width: 36px !important;
    height: auto !important;
    min-height: 34px !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 0 !important;
    padding: 2px !important;
    border: 0 !important;
    background: rgba(255,255,255,.08) !important;
  }

  .ricco-catalogo.is-fullscreen .ricco-current-page,
  .ricco-catalogo:fullscreen .ricco-current-page {
    width: 30px !important;
    min-width: 30px !important;
    height: 22px !important;
    padding: 0 !important;
    color: #fff !important;
    background: transparent !important;
    font-size: 12px !important;
  }

  .ricco-catalogo.is-fullscreen .ricco-page-total,
  .ricco-catalogo:fullscreen .ricco-page-total {
    font-size: 8px !important;
    line-height: 1 !important;
    color: rgba(255,255,255,.62) !important;
  }

  /* O livro passa a ocupar tudo menos a barra lateral. */
  .ricco-catalogo.is-fullscreen .ricco-book-viewport,
  .ricco-catalogo:fullscreen .ricco-book-viewport {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 44px !important;
    width: calc(100% - 44px) !important;
    height: 100% !important;
    padding: 4px max(6px, env(safe-area-inset-right)) 4px 6px !important;
  }

  .ricco-catalogo.is-fullscreen .ricco-secondary-tools,
  .ricco-catalogo:fullscreen .ricco-secondary-tools {
    position: absolute !important;
    z-index: 260 !important;
    top: auto !important;
    right: auto !important;
    bottom: 6px !important;
    left: 46px !important;
    width: auto !important;
    max-width: calc(100vw - 54px) !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    padding: 5px !important;
    border-radius: 10px !important;
    background: rgba(255,255,255,.98) !important;
    color: #20252b !important;
    box-shadow: 0 8px 28px rgba(0,0,0,.2) !important;
  }

  .ricco-catalogo.is-fullscreen .ricco-landscape-gate,
  .ricco-catalogo:fullscreen .ricco-landscape-gate {
    left: 44px !important;
  }
}
