/* CR Carrusel de Imágenes - estilos del front (v2.0.0) */
.cr-carousel {
  --cr-h: 400px;
  --cr-h-m: auto;
  --cr-gap: 0px;
  --cr-speed: 600ms;
  --cr-radius: 0px;
  position: relative;
  width: 100%;
  margin: 0 0 1.25rem;
  isolation: isolate;
  box-sizing: border-box;
}
.cr-carousel *, .cr-carousel *::before, .cr-carousel *::after { box-sizing: border-box; }

.cr-viewport {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
  border-radius: var(--cr-radius);
  background: #eef0f3;
}
.cr-track { display: flex; gap: var(--cr-gap); transition-property: transform; transition-timing-function: cubic-bezier(.22, .61, .36, 1); transition-duration: var(--cr-speed); }
.cr-track.is-dragging { transition: none !important; cursor: grabbing; }

.cr-carousel:not(.cr-swiper) .cr-slide {
  flex: 0 0 calc((100% - var(--cr-gap) * (var(--cr-spv, 1) - 1)) / var(--cr-spv, 1));
  min-width: 0;
  position: relative;
}
.cr-carousel:not(.cr-ready) .cr-slide:not(:first-child) { display: none; }

.cr-slide picture { display: block; }
.cr-slide__link { display: block; position: relative; color: inherit; text-decoration: none; }
a.cr-slide__link:focus-visible { outline: 3px solid #2563eb; outline-offset: -3px; }
.cr-slide__img {
  display: block;
  width: 100%;
  height: var(--cr-h);
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}
@media (max-width: 767px) {
  .cr-slide__img { height: var(--cr-h-m); }
}

/* Vista previa del admin: fuerza la altura móvil */
.cr-force-m .cr-slide__img { height: var(--cr-h-m); }

/* Título superpuesto */
.cr-slide__caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 3.5rem 1.75rem 2.75rem;
  background: linear-gradient(to top, rgba(0, 0, 0, .62), rgba(0, 0, 0, 0));
  color: #fff;
  pointer-events: none;
}
.cr-slide__title {
  display: block;
  max-width: 42rem;
  font-size: clamp(1.05rem, 1.4vw + .65rem, 1.9rem);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -.01em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .35);
}
@media (max-width: 767px) {
  .cr-slide__caption { padding: 2.5rem 1rem 2.25rem; }
}

/* Flechas */
.cr-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(17, 24, 39, .55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity .2s ease, background .2s ease, transform .2s ease;
}
.cr-arrow--prev { left: 14px; }
.cr-arrow--next { right: 14px; }
.cr-carousel:hover .cr-arrow, .cr-arrow:focus-visible { opacity: 1; }
.cr-arrow:hover { background: rgba(17, 24, 39, .8); transform: translateY(-50%) scale(1.06); }
.cr-arrow:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.cr-arrow[disabled], .cr-arrow.swiper-button-disabled { opacity: 0 !important; pointer-events: none; }
@media (hover: none) {
  .cr-arrow { display: none; }
}

/* Paginación */
.cr-dots {
  position: absolute;
  left: 0; right: 0; bottom: 12px;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
}
.cr-dot {
  position: relative;
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .6);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .12);
  cursor: pointer;
  pointer-events: auto;
  transition: width .25s ease, background .25s ease;
}
.cr-dot::after { content: ""; position: absolute; inset: -9px -4px; }
.cr-dot.is-active { width: 26px; background: #fff; }
.cr-dot:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.cr-single .cr-arrow, .cr-single .cr-dots { display: none; }

/* Efecto fundido (motor integrado) */
.cr-fade .cr-track { display: grid; transition: none; }
.cr-fade .cr-slide {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--cr-speed) ease, visibility 0s linear var(--cr-speed);
}
.cr-fade .cr-slide.is-active { opacity: 1; visibility: visible; transition-delay: 0s; z-index: 1; }

/* Motor SwiperJS opcional */
.cr-swiper .cr-viewport.swiper { overflow: hidden; }
.cr-swiper .cr-track { gap: 0; }

@media (prefers-reduced-motion: reduce) {
  .cr-track, .cr-slide, .cr-arrow, .cr-dot { transition: none !important; }
}

.cr-carousel [hidden] { display: none !important; }
