/* ═══════════════ CATÁLOGO — HERO SECTION LAYOUT ═══════════════ */
body.page-catalogo {
  background: #ffffff !important;
}

/* ═══════════════ ANIMACIONES GLOBALES ═══════════════ */

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-slideInLeft {
  animation: slideInLeft 0.8s ease-out forwards;
}

.animate-slideInRight {
  animation: slideInRight 0.8s ease-out forwards;
}

.animate-scaleIn {
  animation: scaleIn 0.6s ease-out forwards;
}

.animate-delay-1 {
  animation-delay: 0.2s;
}

.animate-delay-2 {
  animation-delay: 0.4s;
}

.animate-delay-3 {
  animation-delay: 0.6s;
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════ HERO SECTION ═══════════════ */
.catalogo-hero {
  position: relative;
  overflow: hidden;
  display: flex;
}

.catalogo-hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 56px;
  width: 100%;
  max-width: 1515px !important; /* Más ancho pero controlado */
  margin: 0 auto;
}

.catalogo-hero__content {
  flex: 0 1 580px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.catalogo-hero__title {
  font-size: clamp(2.4rem, 4.5vw, 4.2rem);
  font-weight: 900;
  color: #1a1a1a;
  letter-spacing: -2.5px;
  line-height: 1;
  margin: 0 0 24px;
  white-space: nowrap;
}

.catalogo-hero__title em {
  font-style: normal;
  color: #EB690B;
  display: inline;
}

.catalogo-hero__desc {
  font-size: 1.15rem;
  color: #555555;
  line-height: 1.6;
  max-width: 520px;
  margin: 0;
}

.catalogo-hero__img-wrap {
  --hero-layout-width: calc(580px + 56px + 720px);
  --hero-right-bleed: max(0px, calc((100vw - var(--hero-layout-width)) / 2));
  flex: 0 1 720px;
  width: 100%;
  max-width: 720px;
  height: clamp(250px, 28vw, 330px);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  transition: transform 0.3s ease-out;
  will-change: transform;
}

.catalogo-hero__placeholder,
.catalogo-hero__img,
.catalogo-hero__frame--transition {
  position: absolute;
  top: 0;
  bottom: 0;
  right: calc(-1 * var(--hero-right-bleed));
  left: auto;
  width: calc(100% + 56px);
  max-width: none;
  height: 100%;
  object-fit: contain;
  object-position: right center;
}

.catalogo-hero__img-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: calc(-1 * var(--hero-right-bleed));
  left: auto;
  z-index: 4;
  width: calc(100% + 56px);
  background: linear-gradient(90deg,
    #ffffff 0%,
    rgba(255, 255, 255, 0.92) 48px,
    rgba(255, 255, 255, 0.45) 110px,
    rgba(255, 255, 255, 0) 180px);
  pointer-events: none;
}

.catalogo-hero__img {
  filter: saturate(1.05);
  z-index: 2;
}

.catalogo-hero__placeholder {
  opacity: 1;
  transition: opacity 0.6s ease;
  z-index: 1;
}

.catalogo-hero__img-wrap.is-ready .catalogo-hero__placeholder {
  opacity: 0;
}

.catalogo-hero__img[data-stop-motion-base] {
  opacity: 0;
  transition: opacity 0.24s ease;
}

.catalogo-hero__img[data-stop-motion-base].is-ready {
  opacity: 1;
}

.catalogo-hero__frame--transition {
  z-index: 3;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.catalogo-hero__frame--transition.is-visible {
  opacity: 1;
}

/* ═══════════════ SECCIÓN DE ESTADÍSTICAS ═══════════════ */
.catalogo-stats-section {
  padding: 60px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.catalogo-stats {
  display: flex;
  justify-content: center;
  gap: 80px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.stat__num {
  font-size: 2.8rem;
  font-weight: 900;
  color: #1a1a1a;
  letter-spacing: -1px;
  line-height: 1;
}

.stat__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #666666;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.stat__num-wrap {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.stat__plus {
  font-size: 2rem;
  font-weight: 800;
  color: #EB690B;
  opacity: 0;
  transform: translateX(-5px);
  transition: all 0.6s ease-out;
}

.stat__plus.visible {
  opacity: 1;
  transform: translateX(0);
}

/* ═══════════════ SECCIÓN DE CATÁLOGOS ═══════════════ */
.catalogo-wrap {
  padding: 80px 0;
}

.catalogo-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 40px;
}

.catalogo-right {
  display: flex;
  align-items: center;
  gap: 60px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ═══════════════ TARJETAS ═══════════════ */
.cat-item {
  display: flex;
  flex-direction: column;
  gap: 16px;
  cursor: pointer;
  flex: 0 1 calc(33.333% - 60px);
  max-width: 400px;
  min-width: 320px;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cat-item:hover {
  transform: translateY(-8px);
}

.cat-item__cover {
  position: relative;
  aspect-ratio: 0.7 / 0.9;
  border-radius: 12px 25px 25px 12px;
  overflow: hidden;
  background: #1a1a1a;
  box-shadow: -6px 6px 0 #111, 0 20px 60px rgba(0, 0, 0, 0.6);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cat-item:hover .cat-item__cover {
  box-shadow: -12px 12px 0 #0a0a0a, 0 40px 100px rgba(0, 0, 0, 0.8), 0 0 60px rgba(235, 105, 11, 0.2);
  transform: rotate(-1deg);
}

.cat-item__cover img,
.pdf-cover-preview {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

.cat-item--general .cat-item__cover img {
  object-position: top;
}

.pdf-cover-preview {
  width: 100%;
  height: 100%;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.pdf-cover-preview.loaded,
.pdf-cover-image.loaded,
.catalog-remote-cover.loaded {
  opacity: 1;
}

.pdf-cover-image,
.catalog-remote-cover {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.catalog-cover-fallback {
  width: 100%;
  height: 100%;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  color: #fff;
  text-align: center;
  background:
    radial-gradient(circle at 50% 22%, rgba(235, 105, 11, 0.24), transparent 32%),
    linear-gradient(145deg, #2a2a2a, #101010);
}

.catalog-cover-fallback__label {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eb690b;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.catalog-cover-fallback strong {
  font-size: 20px;
  line-height: 1.2;
}

.catalog-flipbook-loading {
  height: 100%;
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  letter-spacing: .04em;
}

.cat-item__cover::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 12px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.5), transparent);
  z-index: 2;
}

.cat-item__num {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(235, 105, 11, 0.9);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 3px;
  z-index: 3;
}

.cat-item__action {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 4;
}

.cat-item:hover .cat-item__action {
  opacity: 1;
}

.cat-item__action-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 16px 24px;
  border: 1.5px solid rgba(235, 105, 11, 0.8);
  border-radius: 8px;
  background: rgba(235, 105, 11, 0.15);
  backdrop-filter: blur(4px);
  transform: translateY(8px);
  transition: transform 0.25s ease;
}

.cat-item:hover .cat-item__action-label {
  transform: translateY(0);
}

.cat-item__action-label svg {
  width: 24px;
  height: 24px;
  color: #EB690B;
}

.cat-item__meta {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 0 2px;
}

.cat-item__index {
  font-size: 1.8rem;
  font-weight: 900;
  color: #252525;
  line-height: 1;
}

.cat-item__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cat-item__name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
}

.cat-item__tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: #EB690B;
  text-transform: uppercase;
  margin: 0;
}

/* ═══════════════ MODALES ═══════════════ */
.flipbook-modal,
.iframe-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: #111;
  flex-direction: column;
  padding-top: var(--header-h, 80px);
  /* Detección dinámica inteligente */
}

/* Eliminamos media queries redundantes ya que el JS detecta el cambio */

.flipbook-modal.active,
.iframe-modal.active {
  display: flex;
}

.flipbook-modal__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0a0a0a;
  border-bottom: 1px solid #222;
  padding: 12px 28px;
  flex-shrink: 0;
  position: relative;
  margin-bottom: 0px;
  /* Efecto Magnético: pegado a la barra de herramientas */
}

.flipbook-modal__title {
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  margin: 0;
}

.flipbook-esc-tip {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  color: white !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.15em !important;
  pointer-events: none !important;
  white-space: nowrap !important;
}

.flipbook-modal__close {
  background: #EB690B;
  border: none;
  border-radius: 6px;
  padding: 6px 20px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  animation: btnRespiro 2.2s ease-in-out infinite;
}

.flipbook-modal__close:hover {
  animation: none;
  background: #fff;
  color: #1a1a1a;
  box-shadow: 0 0 15px rgba(235, 105, 11, 0.5);
}

@keyframes btnRespiro {
  0% {
    background: #EB690B;
    color: #fff;
  }

  50% {
    background: #1a1a1a;
    color: #fff;
  }

  100% {
    background: #EB690B;
    color: #fff;
  }
}

.flipbook-modal__viewer,
.iframe-modal__viewer {
  flex: 1;
  overflow: hidden;
  position: relative;
}

#df-modal-book,
.iframe-modal__viewer iframe {
  width: 100% !important;
  height: 100% !important;
  border: none;
}

/* ═══════════════ DEARFLIP ═══════════════ */
#df-modal-book .df-ui-wrapper {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  height: 45px !important;
  bottom: auto !important;
  background: #ffffff !important;
  border-radius: 0 !important;
  transform: none !important;
  margin: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  z-index: 10 !important;
}

#df-modal-book .df-ui-controls {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  transform: none !important;
  width: 100% !important;
  height: 45px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #ffffff !important;
  /* La franja blanca de lado a lado */
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

#df-modal-book .df-ui-bg {
  display: none !important;
}

#df-modal-book .df-ui-btn {
  color: #1a1a1a !important;
  background: transparent !important;
  border-radius: 0 !important;
  opacity: 0.8 !important;
}

#df-modal-book .df-ui-btn:hover {
  background: transparent !important;
  color: #EB690B !important;
  opacity: 1 !important;
}

#df-modal-book .df-icon,
#df-modal-book svg {
  fill: #1a1a1a !important;
  color: #1a1a1a !important;
}

#df-modal-book .df-ui-btn:hover .df-icon,
#df-modal-book .df-ui-btn:hover svg {
  fill: #EB690B !important;
  color: #EB690B !important;
}

.df-ui-btn.df-ui-first,
.df-ui-btn.df-ui-last,
.df-ui-btn.df-ui-prev,
.df-ui-btn.df-ui-next,
.df-ui-next.df-active,
.df-ui-prev.df-active {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* ═══════════════ UI ADICIONAL ═══════════════ */
.iframe-spinner {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: #111;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.iframe-spinner__ring {
  width: 52px;
  height: 52px;
  border: 4px solid rgba(255, 255, 255, 0.08);
  border-top-color: #EB690B;
  border-radius: 50%;
  animation: spinnerRotate 0.8s linear infinite;
}

@keyframes spinnerRotate {
  to {
    transform: rotate(360deg);
  }
}

/* ═══════════════ RESPONSIVE ═══════════════ */
@media (max-width: 960px) {
  .catalogo-hero {
    min-height: auto;
    padding: 56px 0 30px;
  }

  .catalogo-hero__inner {
    flex-direction: column;
    gap: 28px;
    text-align: center;
  }

  .catalogo-hero__content {
    align-items: center;
  }

  .catalogo-hero__img-wrap {
    height: clamp(220px, 52vw, 300px);
  }

  .catalogo-hero__placeholder,
  .catalogo-hero__img,
  .catalogo-hero__frame--transition {
    right: 0;
    width: 100%;
  }

  .catalogo-hero__img-wrap::after {
    display: none;
  }

  .catalogo-stats {
    gap: 60px;
  }

  .cat-item {
    max-width: 180px;
    flex: 0 1 calc(50% - 8px);
  }
}

@media (max-width: 540px) {
  .catalogo-stats {
    flex-direction: column;
    gap: 40px;
  }

  .cat-item {
    max-width: 100%;
    flex: 0 1 100%;
  }

}
