.apertura-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.apertura-overlay.is-active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.apertura-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  transition: background 0.35s ease, backdrop-filter 0.35s ease, -webkit-backdrop-filter 0.35s ease;
}

.apertura-overlay.is-active .apertura-overlay__backdrop {
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.apertura-overlay__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(92vw, 560px);
  height: 100dvh;
  background: #111;
  color: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translate3d(100%, 0, 0);
  transition: transform 0.42s cubic-bezier(.22, .61, .36, 1), box-shadow 0.35s ease;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.35);
}

.apertura-overlay.is-active .apertura-overlay__panel {
  transform: translate3d(0, 0, 0);
}

.apertura-overlay__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(17, 17, 17, 0.72);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 4;
  transition: background 0.2s ease, transform 0.2s ease;
}

.apertura-overlay__close:hover {
  background: rgba(17, 17, 17, 0.92);
  transform: scale(1.04);
}

.apertura-overlay__media {
  position: relative;
  flex: 0 0 auto;
  background: #1a1a1a;
  overflow: hidden;
}

.apertura-overlay__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.06) 36%, rgba(0, 0, 0, 0.12));
  pointer-events: none;
  z-index: 1;
}

.apertura-overlay__media picture,
.apertura-overlay__media img {
  display: block;
  width: 100%;
  height: auto;
}

.apertura-overlay__confetti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.apertura-overlay__content {
  padding: 24px 22px 28px;
  overflow: auto;
}

.apertura-overlay__eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f1c27d;
}

.apertura-overlay__content h2 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.05;
  color: #fff;
}

.apertura-overlay__content p {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
}

.apertura-overlay__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.apertura-overlay__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.apertura-overlay__btn:hover {
  transform: translateY(-1px);
}

.apertura-overlay__btn--primary {
  background: #c61d23;
  color: #fff;
}

.apertura-overlay__btn--secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.apertura-overlay__dismiss {
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  line-height: 1.4;
  text-decoration: underline;
  cursor: pointer;
}

.apertura-overlay__dismiss:hover {
  color: #fff;
}

body.apertura-overlay-open {
  overflow: hidden;
}

/* TABLET Y MOBILE */
@media (max-width: 1024px) {
  .apertura-overlay__panel {
    width: min(90vw, 680px);
    max-height: 95dvh;
  }

  .apertura-overlay__media {
    max-height: 35dvh;
  }

  .apertura-overlay__media picture,
  .apertura-overlay__media img {
    height: 100%;
  }

  .apertura-overlay__media img {
    width: 100%;
    -o-object-fit: cover;
       object-fit: cover;
    -o-object-position: center center;
       object-position: center center;
  }
}

@media (max-width: 767px) {
  .apertura-overlay__panel {
    width: 100vw;
  }

  .apertura-overlay__content {
    padding: 20px 18px 24px;
  }

  .apertura-overlay__content h2 {
    font-size: clamp(24px, 8vw, 32px);
  }
}

/* DESKTOP PREMIUM CENTRADO */
@media (min-width: 1025px) {
  .apertura-overlay__panel {
    top: 50%;
    left: 50%;
    right: auto;
    width: min(92vw, 1120px);
    max-width: 1120px;
    height: auto;
    max-height: min(88vh, 780px);
    flex-direction: row;
    border-radius: 24px;
    transform: translate(-50%, -50%) scale(0.96);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  }

  .apertura-overlay.is-active .apertura-overlay__panel {
    transform: translate(-50%, -50%) scale(1);
  }

  .apertura-overlay__media {
    width: 56%;
    max-height: none;
    min-height: 100%;
  }

  .apertura-overlay__media picture,
  .apertura-overlay__media img {
    height: 100%;
  }

  .apertura-overlay__media img {
    width: 100%;
    -o-object-fit: cover;
       object-fit: cover;
    -o-object-position: center center;
       object-position: center center;
  }

  .apertura-overlay__content {
    width: 44%;
    padding: 34px 34px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .apertura-overlay__content h2 {
    font-size: clamp(34px, 2.8vw, 48px);
  }

  .apertura-overlay__content p {
    font-size: 17px;
  }

  .apertura-overlay__actions {
    margin-top: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .apertura-overlay,
  .apertura-overlay__backdrop,
  .apertura-overlay__panel,
  .apertura-overlay__btn,
  .apertura-overlay__close {
    transition: none;
  }
}