/* Autolab Servicios Carrusel — frontend */

.alsc-carousel {
  --alsc-gap: 30px;
  --alsc-radius: 60px;
  --alsc-cta-bg: rgba(0, 0, 0, 0.62);
  --alsc-cta-radius: 25px;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  position: relative;
}

.alsc-carousel__viewport {
  overflow: hidden;
  width: 100%;
}

.alsc-carousel__track {
  display: flex;
  gap: var(--alsc-gap);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  touch-action: pan-y;
}

.alsc-card {
  flex: 0 0 calc((100% - (var(--alsc-gap) * 2)) / 3);
  min-width: 0;
  box-sizing: border-box;
}

.alsc-card__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 0 0 25px;
  background: var(--alsc-card-bg, #748093);
  border-radius: var(--alsc-radius) var(--alsc-radius) 0 0;
  overflow: visible;
  position: relative;
  animation: alscFadeInUp 0.7s ease both;
}

.alsc-card__media-wrap {
  position: relative;
  width: 100%;
  margin: 0;
  line-height: 0;
}

.alsc-card__media {
  margin: 0;
  width: 100%;
  line-height: 0;
}

.alsc-card__media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--alsc-radius) var(--alsc-radius) 0 0;
}

.alsc-card__media--placeholder {
  aspect-ratio: 3 / 2;
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--alsc-radius) var(--alsc-radius) 0 0;
}

.alsc-card__cta {
  appearance: none;
  border: 0;
  cursor: pointer;
  background: var(--alsc-cta-bg);
  color: #fff !important;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  padding: 15px 35px;
  border-radius: var(--alsc-cta-radius);
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 3;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.2s ease;
}

.alsc-card__cta:hover,
.alsc-card__cta:focus-visible {
  background: rgba(0, 0, 0, 0.78);
  transform: translateX(-50%) translateY(-2px);
  outline: none;
}

.alsc-card__title {
  margin: 22px 0 0;
  padding: 0 16px;
  color: #fff;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
}

.alsc-carousel__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
}

.alsc-carousel__btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: #f21e21;
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.alsc-carousel__btn:hover,
.alsc-carousel__btn:focus-visible {
  opacity: 0.9;
  transform: scale(1.04);
  outline: none;
}

.alsc-carousel__btn:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
}

.alsc-carousel__dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.alsc-carousel__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: #c9cdd4;
  cursor: pointer;
}

.alsc-carousel__dot.is-active {
  background: #f21e21;
  transform: scale(1.15);
}

/* Modal */
.alsc-modal[hidden],
.alsc-modal:not(.is-open) {
  display: none !important;
}

.alsc-modal.is-open {
  display: flex !important;
  position: fixed;
  inset: 0;
  z-index: 999999;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
}

.alsc-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.alsc-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 22, 0.72);
  backdrop-filter: blur(2px);
}

.alsc-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  max-height: min(90vh, 820px);
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  animation: alscModalIn 0.28s ease both;
}

.alsc-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  color: #222;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.alsc-modal__close:hover,
.alsc-modal__close:focus-visible {
  background: rgba(0, 0, 0, 0.16);
  outline: none;
}

.alsc-modal__nav {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: #1f6feb;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  transition: background 0.2s ease, transform 0.2s ease;
}

.alsc-modal__nav:hover,
.alsc-modal__nav:focus-visible {
  background: #1558c0;
  transform: scale(1.05);
  outline: none;
}

.alsc-modal__nav:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
}

.alsc-modal__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  min-height: 360px;
}

.alsc-modal__content {
  padding: 40px 36px 36px;
}

.alsc-modal__title {
  margin: 0 0 16px;
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  font-weight: 700;
  line-height: 1.2;
  color: #1b1f27;
}

.alsc-modal__body {
  color: #444;
  font-size: 1rem;
  line-height: 1.65;
}

.alsc-modal__body > *:first-child {
  margin-top: 0;
}

.alsc-modal__body > *:last-child {
  margin-bottom: 0;
}

.alsc-modal__media {
  background: #edf0f4;
  min-height: 280px;
}

.alsc-modal__image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
}

.alsc-modal__media:has(img[src=""]),
.alsc-modal__media.is-empty {
  display: none;
}

.alsc-modal__dialog.is-no-image .alsc-modal__grid {
  grid-template-columns: 1fr;
}

.alsc-empty {
  padding: 20px;
  text-align: center;
  color: #666;
}

@keyframes alscFadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes alscModalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.alsc-modal__dialog--pulse {
  animation: alscModalIn 0.22s ease both;
}

body.alsc-modal-open {
  overflow: hidden;
}

/* Tablet: 2 cards */
@media (max-width: 1024px) {
  .alsc-card {
    flex: 0 0 calc((100% - var(--alsc-gap)) / 2);
  }

  .alsc-card__title {
    font-size: 20px;
  }

  .alsc-modal__grid {
    grid-template-columns: 1fr;
  }

  .alsc-modal__media {
    order: -1;
    min-height: 220px;
  }

  .alsc-modal__image {
    min-height: 220px;
    max-height: 280px;
  }

  .alsc-modal__content {
    padding: 28px 22px 24px;
  }
}

/* Mobile: 1 card */
@media (max-width: 680px) {
  .alsc-carousel {
    --alsc-gap: 16px;
    --alsc-radius: 36px;
  }

  .alsc-card {
    flex: 0 0 100%;
  }

  .alsc-card__cta {
    padding: 13px 28px;
    font-size: 14px;
    bottom: 14px;
  }

  .alsc-card__title {
    margin-top: 18px;
    font-size: 18px;
  }

  .alsc-card__inner {
    padding-bottom: 18px;
  }

  .alsc-carousel__controls {
    margin-top: 18px;
  }

  .alsc-modal {
    padding: 10px;
    align-items: flex-end;
    gap: 8px;
  }

  .alsc-modal__nav {
    width: 40px;
    height: 40px;
    font-size: 18px;
    align-self: center;
  }

  .alsc-modal__dialog {
    width: 100%;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
  }

  .alsc-modal__dialog--pulse {
    animation: none;
  }
}
