/* Local layout fixes for BBVA homepage sliders / pagination */

/* --- Marquee: only one slide visible --- */
.marqueeslider__carousel .swiper-container {
  overflow: hidden;
  position: relative;
  width: 100%;
}

.marqueeslider__carousel:not(:has(.swiper-container-initialized)):not(.local-slider-ready)
  .swiper-wrapper
  > .complexmarquee
  ~ .complexmarquee {
  display: none !important;
}

.marqueeslider__carousel.local-slider-ready .swiper-wrapper {
  display: block !important;
}

.marqueeslider__carousel.local-slider-ready .swiper-wrapper > .complexmarquee {
  display: none !important;
  width: 100% !important;
}

.marqueeslider__carousel.local-slider-ready .swiper-wrapper > .complexmarquee.is-local-active {
  display: block !important;
  animation: local-fade 0.55s ease;
}

@keyframes local-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/*
 * Nav cluster like official .slider-navigation-centered:
 *   [ < ]  ( 2 de 2 )  [ > ]   — centered as a group, NOT at screen edges
 */
.local-slider-ready,
.slider.slider-navigation-centered {
  position: relative !important;
  padding-bottom: 56px !important;
}

.local-slider-ready > .swiper-container {
  width: 100%;
  max-width: 100%;
  overflow: hidden !important;
}

.local-slider-ready > .swiper-custom-pagination,
.local-slider-ready > .swiper-custom-pagination.local-fraction,
.slider.slider-navigation-centered > .swiper-custom-pagination {
  position: absolute !important;
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  bottom: 8px !important;
  transform: translateX(-50%) !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 8px 14px !important;
  border-radius: 16px !important;
  background: #fff !important;
  color: #072146 !important;
  font-style: italic !important;
  font-size: 14px !important;
  line-height: 1 !important;
  text-align: center !important;
  box-shadow: 0 1px 2px rgba(7, 33, 70, 0.08);
  z-index: 5 !important;
  pointer-events: none;
  white-space: nowrap;
}

/* Prev: just left of the centered pill */
.local-slider-ready > .swiper-button-prev,
.local-slider-ready > button.swiper-button-prev,
.local-slider-ready > .swiper-button.swiper-button-prev,
.slider.slider-navigation-centered > .swiper-button-prev,
.slider.slider-navigation-centered > button.swiper-button-prev,
.slider.slider-navigation-centered > .swiper-button.swiper-button-prev {
  position: absolute !important;
  left: calc(50% - 80px) !important;
  right: auto !important;
  top: auto !important;
  bottom: 0 !important;
  margin: 0 !important;
  transform: none !important;
  width: 40px !important;
  height: 40px !important;
  background: none !important;
  z-index: 6 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  opacity: 1 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
}

/* Next: just right of the centered pill */
.local-slider-ready > .swiper-button-next,
.local-slider-ready > button.swiper-button-next,
.local-slider-ready > .swiper-button.swiper-button-next,
.slider.slider-navigation-centered > .swiper-button-next,
.slider.slider-navigation-centered > button.swiper-button-next,
.slider.slider-navigation-centered > .swiper-button.swiper-button-next {
  position: absolute !important;
  right: calc(50% - 80px) !important;
  left: auto !important;
  top: auto !important;
  bottom: 0 !important;
  margin: 0 !important;
  transform: none !important;
  width: 40px !important;
  height: 40px !important;
  background: none !important;
  z-index: 6 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  opacity: 1 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
}

/* Kill official edge positioning that pushes arrows to screen sides */
@media screen and (min-width: 1024px) {
  .local-slider-ready > .swiper-button-prev,
  .local-slider-ready > button.swiper-button-prev,
  .slider.slider-navigation-centered > .swiper-button-prev {
    left: calc(50% - 80px) !important;
    right: auto !important;
    top: auto !important;
    bottom: 0 !important;
    transform: none !important;
  }

  .local-slider-ready > .swiper-button-next,
  .local-slider-ready > button.swiper-button-next,
  .slider.slider-navigation-centered > .swiper-button-next {
    right: calc(50% - 80px) !important;
    left: auto !important;
    top: auto !important;
    bottom: 0 !important;
    transform: none !important;
  }
}

.local-slider-ready.local-nav-hidden > .swiper-button-prev,
.local-slider-ready.local-nav-hidden > .swiper-button-next,
.local-slider-ready.local-nav-hidden > button.swiper-button-prev,
.local-slider-ready.local-nav-hidden > button.swiper-button-next,
.local-slider-ready.local-nav-hidden > .swiper-button,
.local-slider-ready.local-nav-hidden > .swiper-custom-pagination {
  display: none !important;
}

/* --- Cards track --- */
.cardsmodule__slider.local-slider-ready .swiper-container {
  overflow-x: hidden !important;
  overflow-y: visible !important;
  width: 100%;
}

.cardsmodule__slider.local-slider-ready .swiper-wrapper {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 24px;
  width: max-content !important;
  transition: transform 0.35s ease;
  will-change: transform;
}

.cardsmodule__slider.local-slider-ready .swiper-wrapper > .card,
.cardsmodule__slider.local-slider-ready .swiper-wrapper > .swiper-slide {
  flex: 0 0 var(--local-slide-w, 320px) !important;
  width: var(--local-slide-w, 320px) !important;
  max-width: var(--local-slide-w, 320px) !important;
  box-sizing: border-box;
  list-style: none;
}

/* --- Product slider --- */
.productslider .slider.local-slider-ready .swiper-container {
  overflow: hidden !important;
  width: 100%;
}

.productslider .slider.local-slider-ready .swiper-wrapper {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 24px;
  width: max-content !important;
  transition: transform 0.35s ease;
  will-change: transform;
}

.productslider .slider.local-slider-ready .swiper-wrapper > li,
.productslider .slider.local-slider-ready .swiper-wrapper > .swiper-slide {
  flex: 0 0 var(--local-slide-w, 160px) !important;
  width: var(--local-slide-w, 160px) !important;
  max-width: var(--local-slide-w, 160px) !important;
  list-style: none;
}

/* Product desktop: hide fraction; arrows stay beside content edges per official */
@media (min-width: 1024px) {
  .productslider .slider.local-slider-ready > .swiper-custom-pagination {
    display: none !important;
  }

  .productslider .slider.local-slider-ready {
    padding-bottom: 0 !important;
  }

  .productslider .slider.local-slider-ready > .swiper-button-prev,
  .productslider .slider.local-slider-ready > button.swiper-button-prev {
    left: -24px !important;
    right: auto !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
  }

  .productslider .slider.local-slider-ready > .swiper-button-next,
  .productslider .slider.local-slider-ready > button.swiper-button-next {
    right: -24px !important;
    left: auto !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
  }
}

.footer__sociallinks .footer__social-svg {
  display: block;
  width: 24px;
  height: 24px;
  color: inherit;
  fill: currentColor;
}

.footer__sociallinks a.js-copy-email {
  cursor: pointer;
}

/* Mobile megamenu: flush left + even vertical rhythm */
@media screen and (max-width: 1023px) {
  .megamenu__flyout__secondary .accordion__list__content,
  .megamenu__flyout__secondary .accordion__list__content--haschildren,
  .megamenu__flyout__secondary .accordion__list__content--haschildren > ul {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
  }

  .megamenu__flyout__secondary .accordion__list__content--haschildren > ul {
    padding: 0;
  }

  .megamenu__flyout__secondary .megamenu__flyout__category,
  .megamenu__flyout__secondary .megamenu__flyout__template {
    margin: 0;
  }
}
