/* ==========================================================================
   Section: Promos carousel ("¡Aprovecha nuestras promociones!")
   Partial: partials/root-8a5edab2--promos.html
   JS:      scripts/sections/root-8a5edab2--promos.js
   All rules scoped under .x-promos. Values from live-site getComputedStyle.
   ========================================================================== */

.x-promos {
  background: var(--white);
  padding: 32px 96px;
  position: relative;
  overflow: hidden;
}

.x-promos__wrapper {
  max-width: 1352px;
  margin: 0 auto;
  position: relative;
}

.x-promos__heading {
  margin: 0 0 32px;
  text-align: center;
}

.x-promos__title {
  font-size: 32px;
  font-weight: 450;
  line-height: 44.8px;
  letter-spacing: -0.64px;
  color: var(--ink-2);
  margin: 0 0 8px;
}

/* --- Carousel ------------------------------------------------------------ */

.x-promos__carousel {
  position: relative;
}

.x-promos__viewport {
  overflow: hidden;
  height: 458px;
}

.x-promos__track {
  display: flex;
  gap: 32px;
  padding: 0 0 2px;
  height: 458px;
  align-items: stretch;
  transition: transform .45s ease;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

/* --- Card ---------------------------------------------------------------- */

.x-promos .x-promocard {
  flex: 0 0 calc(33.3333% - 21px);
  height: 456px;
  border-radius: var(--r-card);
}

.x-promos .x-promocard__link {
  display: block;
  height: 100%;
  color: inherit;
}

.x-promos .x-promocard__inner {
  position: relative;
  width: 100%;
  height: 456px;
  max-height: 500px;
  border-radius: var(--r-panel);
  overflow: hidden;
  box-shadow: var(--shadow-card-dark);
  background: var(--dark-card);
}

.x-promos .x-promocard__img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  transition: transform .3s ease-out;
}

.x-promos .x-promocard__img-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--r-panel);
}

.x-promos .x-promocard__link:hover .x-promocard__img-wrap,
.x-promos .x-promocard__link:focus-visible .x-promocard__img-wrap {
  transform: scale(1.1);
}

/* --- Card content panel -------------------------------------------------- */

.x-promos .x-promocard__content {
  position: absolute;
  left: 0;
  right: 0;
  top: 176px;
  bottom: 0;
  background: var(--dark-card);
  border-radius: 0 0 var(--r-panel) var(--r-panel);
  padding: 40px 16px 16px;
  display: flex;
  flex-direction: column;
}

.x-promos .x-promocard__partner-logo {
  position: absolute;
  top: -25px;
  left: 0;
  width: 152px;
  height: 48px;
  max-height: 48px;
  background: var(--white);
  padding: 4px 4px 4px 8px;
  border-radius: 0 8px 8px 0;
  z-index: 1;
}

.x-promos .x-promocard__partner-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
}

.x-promos .x-promocard__body {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.x-promos .x-promocard__top h3 {
  font-size: 22px;
  font-weight: var(--fw-medium);
  line-height: 33px;
  letter-spacing: -0.22px;
  color: var(--white);
  margin: 0;
}

.x-promos .x-promocard__top p {
  font-size: 18px;
  font-weight: 450;
  line-height: 27px;
  letter-spacing: -0.18px;
  color: var(--white);
  margin: 8px 0 0;
}

.x-promos .x-promocard__bottom {
  display: grid;
  grid-template-columns: 1fr 102px;
  gap: 8px;
  align-items: end;
  margin-top: auto;
}

/* --- Badges (time column) ------------------------------------------------- */

.x-promos .x-promocard__time {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
}

.x-promos .x-promocard__badge {
  display: block;
  white-space: nowrap;
  font-size: 16px;
  line-height: 18.8px;
  letter-spacing: -0.16px;
  padding: 7px 8px;
  border-radius: var(--r-badge);
  text-align: center;
}

.x-promos .x-promocard__badge--new {
  background: var(--green-dark);
  color: var(--white);
  font-weight: var(--fw-semibold);
  max-width: 64px;
  margin-bottom: 8px;
}

.x-promos .x-promocard__badge--days {
  background: var(--white);
  color: var(--ink);
  font-weight: var(--fw-medium);
  min-width: fit-content; /* live: min-width wins over max-width, badge hugs text */
  max-width: 95px;
}

/* --- Discount block --------------------------------------------------------
   Live DOM (verified on bancofalabella.pe):
     line 1 "top"    -> small white uppercase (PARTICIPA / GANA)
     line 2 "hl"     -> big white uppercase, font-size fitted to the 102px
                        column by JS (48px max): Descubre / Y GANA / S/2,900
     line 3 "bottom" -> the RED BADGE (#D60942): Más aquí / AHORA / REGÍSTRATE
   ------------------------------------------------------------------------- */

.x-promos .x-promocard__discount {
  display: grid;
  gap: 2px;
  align-items: center;
  align-content: center;
  text-align: center;
  min-height: 77px;
}

.x-promos .x-promocard__discount-line {
  display: block;
  width: 100%;
  margin: 0;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-align: center;
  text-transform: uppercase;
}

.x-promos .x-promocard__discount-line--top {
  font-size: 18px;
  font-weight: var(--fw-medium);
  line-height: 18px;
  letter-spacing: -0.36px;
}

.x-promos .x-promocard__discount-line--hl {
  font-size: 32px; /* no-JS fallback; init() fits it to the column (max 48px) */
  font-weight: var(--fw-medium);
  line-height: 1;
  letter-spacing: -0.36px;
}

.x-promos .x-promocard__discount-line--bottom {
  font-size: 16px;
  font-weight: var(--fw-semibold);
  line-height: 24px;
  letter-spacing: -0.317px;
  background: var(--red-badge);
  border-radius: 5px;
  padding: 2px 4px;
  justify-self: center;
  width: auto;
  min-width: 0;
}

/* --- Arrows (same pattern as hero) ---------------------------------------- */

.x-promos__arrow {
  position: absolute;
  top: 209px;
  width: 40px;
  height: 40px;
  z-index: var(--z-arrows);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.x-promos__arrow--prev { left: -20px; }
.x-promos__arrow--next { right: -20px; }

.x-promos__arrow img {
  width: 40px;
  height: 40px;
  display: block;
}

.x-promos__arrow.is-disabled {
  opacity: .25;
  pointer-events: none;
}

/* --- Dots (same pattern as hero) ------------------------------------------ */

.x-promos__dots {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0 10px;
  height: 6px;
}

.x-promos__dot {
  width: 6px;
  height: 6px;
  border-radius: 15px;
  background: transparent;
  border: 0;
  padding: 0;
  margin-left: 8px;
  transition: background-color .3s .3s, width .3s;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.x-promos__dot::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 15px;
  background: var(--lime-pale);
  transition: background-color .3s;
}

.x-promos__dot:first-child { margin-left: 0; }

.x-promos__dot.is-active {
  width: 24px;
  background: var(--lime);
  transition: background-color .3s, width .3s;
}

.x-promos__dot.is-active::after { display: none; }

/* --- Responsive ------------------------------------------------------------
   >=1024: 3 cards per view (default above)
   768–1023: 2 cards per view
   <768: 1 card per view
   ------------------------------------------------------------------------- */

@media (max-width: 1023px) {
  .x-promos .x-promocard {
    flex: 0 0 calc(50% - 16px);
  }
}

@media (max-width: 767px) {
  .x-promos {
    padding: 32px 0;
  }

  .x-promos__heading {
    padding: 0 24px;
  }

  .x-promos__title {
    font-size: 40px;
    line-height: 56px;
    letter-spacing: -0.8px;
  }

  .x-promos__viewport {
    padding: 0 24px;
    height: 430px;
  }

  .x-promos__track {
    gap: 16px;
    height: 430px;
  }

  .x-promos .x-promocard {
    flex: 0 0 280px; /* live mobile card width (peek of next card) */
    height: 430px;
  }

  .x-promos .x-promocard__inner {
    height: 430px;
  }

  .x-promos .x-promocard__content {
    top: 150px;
  }

  /* Live site hides carousel arrows on mobile */
  .x-promos__arrow {
    display: none;
  }
}
