/* ==========================================================
   SARÒ GRATO · CARRUSEL PREMIUM
   Encapsulado completamente con prefijo .sg-carousel-
   ========================================================== */

.sg-carousel-widget,
.sg-carousel-widget *,
.sg-carousel-widget *::before,
.sg-carousel-widget *::after {
  box-sizing: border-box;
}

.sg-carousel-widget {
  --sg-carousel-bg: #FFFFFF;
  --sg-carousel-bg-soft: #F6F2E7;
  --sg-carousel-charcoal: #161310;
  --sg-carousel-gold: #C9A227;
  --sg-carousel-border: rgba(22, 19, 16, 0.10);

  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  isolation: isolate;
  contain: layout paint;
}

.sg-carousel-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--sg-carousel-bg);
  border: 1px solid var(--sg-carousel-border);
  border-radius: 18px;
  box-shadow:
    0 1px 2px rgba(22, 19, 16, 0.03),
    0 14px 36px rgba(22, 19, 16, 0.05);
}

.sg-carousel-track {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: pan-y;
}

.sg-carousel-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.008);
  pointer-events: none;
  transition:
    opacity 480ms cubic-bezier(.22,.61,.36,1),
    visibility 480ms cubic-bezier(.22,.61,.36,1),
    transform 700ms cubic-bezier(.22,.61,.36,1);
}

.sg-carousel-slide.sg-carousel-is-active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  pointer-events: auto;
}

.sg-carousel-image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  object-fit: contain;
  object-position: center;
  background: var(--sg-carousel-bg);
  user-select: none;
  -webkit-user-drag: none;
}

.sg-carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 46px;
  height: 46px;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(22, 19, 16, 0.10);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--sg-carousel-charcoal);
  box-shadow: 0 8px 24px rgba(22, 19, 16, 0.10);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 34px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-50%);
  transition:
    opacity 220ms ease,
    visibility 220ms ease,
    background-color 220ms ease,
    border-color 220ms ease,
    color 220ms ease,
    transform 220ms ease;
  appearance: none;
  -webkit-appearance: none;
}

.sg-carousel-arrow-prev {
  left: 18px;
}

.sg-carousel-arrow-next {
  right: 18px;
}

.sg-carousel-arrow-icon {
  display: block;
  height: 38px;
  line-height: 34px;
}

@media (hover: hover) and (pointer: fine) {
  .sg-carousel-frame:hover .sg-carousel-arrow {
    opacity: 1;
    visibility: visible;
  }

  .sg-carousel-arrow:hover {
    background: var(--sg-carousel-charcoal);
    color: #FFFFFF;
    border-color: var(--sg-carousel-charcoal);
    transform: translateY(-50%) scale(1.03);
  }
}

.sg-carousel-arrow:focus-visible {
  opacity: 1;
  visibility: visible;
  outline: 2px solid var(--sg-carousel-gold);
  outline-offset: 3px;
}

.sg-carousel-dots {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transform: translateX(-50%);
}

.sg-carousel-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(22, 19, 16, 0.28);
  cursor: pointer;
  transition:
    width 220ms ease,
    background-color 220ms ease,
    opacity 220ms ease;
  appearance: none;
  -webkit-appearance: none;
}

.sg-carousel-dot.sg-carousel-is-active {
  width: 24px;
  flex-basis: 24px;
  background: var(--sg-carousel-gold);
}

.sg-carousel-dot:focus-visible {
  outline: 2px solid var(--sg-carousel-charcoal);
  outline-offset: 3px;
}

.sg-carousel-widget.sg-carousel-is-single .sg-carousel-arrow,
.sg-carousel-widget.sg-carousel-is-single .sg-carousel-dots {
  display: none !important;
}

@media (max-width: 767px) {
  .sg-carousel-frame {
    border-radius: 14px;
    box-shadow:
      0 1px 2px rgba(22, 19, 16, 0.02),
      0 8px 24px rgba(22, 19, 16, 0.04);
  }

  .sg-carousel-arrow {
    display: none !important;
  }

  .sg-carousel-dots {
    bottom: 14px;
    gap: 7px;
  }

  .sg-carousel-dot {
    width: 7px;
    height: 7px;
    flex-basis: 7px;
  }

  .sg-carousel-dot.sg-carousel-is-active {
    width: 22px;
    flex-basis: 22px;
  }
}

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