html.pie-popup-lock,
html.pie-popup-lock body {
  overflow: hidden !important;
}

.pie-popup,
.pie-popup * {
  box-sizing: border-box;
}

.pie-popup {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--pie-overlay, rgba(0, 0, 0, .55));
  font-family: Arial, Helvetica, sans-serif;
}

.pie-popup.is-open {
  display: flex;
}

.pie-popup__dialog {
  width: min(var(--pie-width, 750px), calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .35);
  animation: pieIn .22s ease-out;
}

.pie-popup__header {
  flex: 0 0 auto;
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: var(--pie-header-bg, #fff);
  color: var(--pie-header-text, #07113b);
  border-bottom: 1px solid rgba(0, 0, 0, .28);
}

.pie-popup__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.pie-popup__logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  flex: 0 0 auto;
}

.pie-popup__title {
  min-width: 0;
  flex: 1 1 auto;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}

/* Reset fuerte para evitar estilos globales del tema de WordPress. */
.pie-popup button.pie-popup__x {
  all: unset;
  box-sizing: border-box !important;
  flex: 0 0 42px;
  width: 42px !important;
  height: 42px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #b7b7b7 !important;
  font: 700 28px/1 Arial, Helvetica, sans-serif !important;
  cursor: pointer;
}

.pie-popup__content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px;
  background: #f2f2f2;
}

.pie-popup__carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .38);
  background: #e5e5e5;
}

.pie-popup__viewport {
  width: 100%;
  overflow: hidden;
  touch-action: pan-y;
}

.pie-popup__track {
  display: flex;
  width: 100%;
  transform: translate3d(0, 0, 0);
  transition: transform .48s cubic-bezier(.22, .61, .36, 1);
  will-change: transform;
}

.pie-popup__slide {
  flex: 0 0 100%;
  min-width: 0;
  width: 100%;
  background: #f2f2f2;
}

.pie-popup__image-frame {
  width: 100%;
  height: min(var(--pie-image-height, 464px), 52vh);
  height: min(var(--pie-image-height, 464px), 52dvh);
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #e8e8e8;
}

.pie-popup__image-frame img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  object-fit: contain;
  background: #e8e8e8;
}

.pie-popup__cta-wrap {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 16px 16px;
  background: #f2f2f2;
}

.pie-popup a.pie-popup__cta {
  all: unset;
  box-sizing: border-box !important;
  min-height: 52px;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 10px 22px !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: var(--pie-button-bg, #2f80c0) !important;
  box-shadow: inset 0 -2px rgba(0, 0, 0, .08) !important;
  color: var(--pie-button-text, #fff) !important;
  font: 500 20px/1.2 Arial, Helvetica, sans-serif !important;
  text-align: center !important;
  text-decoration: none !important;
  cursor: pointer;
}

/* Flechas sin círculo, centradas y aisladas de los estilos del tema. */
.pie-popup button.pie-popup__arrow {
  all: unset;
  box-sizing: border-box !important;
  position: absolute !important;
  top: min(calc(var(--pie-image-height, 464px) / 2), 26vh) !important;
  top: min(calc(var(--pie-image-height, 464px) / 2), 26dvh) !important;
  transform: translateY(-50%) !important;
  z-index: 5 !important;
  width: 48px !important;
  height: 72px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: #fff !important;
  cursor: pointer;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .48));
}

.pie-popup button.pie-popup__arrow svg {
  display: block;
  width: 34px;
  height: 52px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pie-popup button.pie-popup__prev {
  left: 12px !important;
}

.pie-popup button.pie-popup__next {
  right: 12px !important;
}

.pie-popup__footer {
  flex: 0 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 12px 20px;
  background: var(--pie-footer-bg, #900);
}

.pie-popup button.pie-popup__close {
  all: unset;
  box-sizing: border-box !important;
  min-width: 80px;
  min-height: 44px;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 9px 16px !important;
  border: 1px solid #fff !important;
  border-radius: 6px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #fff !important;
  font: 700 16px/1.2 Arial, Helvetica, sans-serif !important;
  text-align: center !important;
  cursor: pointer;
}

.pie-popup button.pie-popup__arrow:focus-visible,
.pie-popup button.pie-popup__x:focus-visible,
.pie-popup button.pie-popup__close:focus-visible,
.pie-popup a.pie-popup__cta:focus-visible {
  outline: 3px solid rgba(48, 128, 192, .52) !important;
  outline-offset: 2px !important;
}

@media (hover: hover) and (pointer: fine) {
  .pie-popup button.pie-popup__arrow:hover {
    opacity: .82;
  }

  .pie-popup a.pie-popup__cta:hover {
    filter: brightness(.96);
  }

  .pie-popup button.pie-popup__close:hover {
    background: rgba(255, 255, 255, .1) !important;
  }
}

@keyframes pieIn {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 700px) {
  .pie-popup {
    padding: 8px;
  }

  .pie-popup__dialog {
    width: min(var(--pie-width, 750px), calc(100vw - 16px));
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 12px;
  }

  .pie-popup__header {
    min-height: 54px;
    padding: 7px 10px;
    gap: 7px;
  }

  .pie-popup__brand {
    gap: 7px;
  }

  .pie-popup__logo {
    width: 36px;
    height: 36px;
  }

  .pie-popup__title {
    font-size: clamp(12px, 3.7vw, 15px);
  }

  .pie-popup button.pie-popup__x {
    flex-basis: 38px;
    width: 38px !important;
    height: 38px !important;
    font-size: 25px !important;
  }

  .pie-popup__content {
    padding: 9px;
  }

  .pie-popup__image-frame {
    height: min(var(--pie-image-height, 464px), 43vh);
    height: min(var(--pie-image-height, 464px), 43dvh);
    min-height: 160px;
  }

  .pie-popup__cta-wrap {
    min-height: 68px;
    padding: 10px 12px 12px;
  }

  .pie-popup a.pie-popup__cta {
    min-height: 46px;
    max-width: 100%;
    padding: 9px 18px !important;
    font-size: 17px !important;
  }

  .pie-popup button.pie-popup__arrow {
    top: min(calc(var(--pie-image-height, 464px) / 2), 21.5vh) !important;
    top: min(calc(var(--pie-image-height, 464px) / 2), 21.5dvh) !important;
    width: 40px !important;
    height: 58px !important;
  }

  .pie-popup button.pie-popup__arrow svg {
    width: 27px;
    height: 42px;
    stroke-width: 3.4;
  }

  .pie-popup button.pie-popup__prev {
    left: 4px !important;
  }

  .pie-popup button.pie-popup__next {
    right: 4px !important;
  }

  .pie-popup__footer {
    min-height: 62px;
    padding: 9px 12px;
  }

  .pie-popup button.pie-popup__close {
    min-height: 42px;
    padding: 8px 14px !important;
    font-size: 15px !important;
  }
}

@media (max-width: 380px) {
  .pie-popup__title {
    font-size: 12px;
  }

  .pie-popup__image-frame {
    height: min(var(--pie-image-height, 464px), 39vh);
    height: min(var(--pie-image-height, 464px), 39dvh);
    min-height: 145px;
  }

  .pie-popup button.pie-popup__arrow {
    top: min(calc(var(--pie-image-height, 464px) / 2), 19.5vh) !important;
    top: min(calc(var(--pie-image-height, 464px) / 2), 19.5dvh) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pie-popup__dialog {
    animation: none;
  }

  .pie-popup__track {
    transition: none;
  }
}
