/* ---------------------- CONTENEDOR PRINCIPAL ---------------------- */
.promo-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 50px;
  width: 100%;
  height: auto;
  margin-top: 80px;
  margin-bottom: 80px;
}

/* ---------------------- IMÁGENES Y WRAPPERS ---------------------- */
.promo-images {
  display: flex;
  gap: 5px;
}

.promo-image-wrapper {
  margin: 0 20px;
  position: relative;
}

/* ---------------------- IMÁGENES PRINCIPALES ---------------------- */
.promo-image {
  width: auto;
  max-width: 100%;
  max-height: 600px;
  transition: 
    transform 0.3s cubic-bezier(.48,1.4,.66,1.01),
    z-index 0s;
  object-fit: cover;
  border-radius: 8px;
  height: auto;
  cursor: pointer;
  opacity: 1;
  margin: 0 10px 0 10px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.8);
  z-index: 1;
  position: relative;
}

.promo-image.middle {
  transform: scale(1.25);
  z-index: 10;
}

.promo-image:not(.middle) {
  transform: scale(1.1);
  z-index: 5;
}

/* Hover efecto */
.promo-image:hover,
.promo-image:focus-visible {
  z-index: 20 !important;
  transform: scale(1.18);
  box-shadow: 0 14px 34px rgba(0,0,0,0.14), 0 2px 18px 0 rgba(49,105,224,0.15);
}

/* ---------------------- BOTÓN ACTUALIZAR ---------------------- */
.btn-actualizar-imagen {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 30;
  background: #fff;
  color: #24409b;
  border: 2px solid #24409b;
  border-radius: 9px;
  padding: 6px 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 12px 0 rgba(49,105,224,0.09);
  transition: background 0.17s, color 0.17s;
}

.btn-actualizar-imagen:hover {
  background: #24409b;
  color: #fff;
}

/* ---------------------- MODAL POPUP & ÉXITO ---------------------- */
.promo-modal-bg {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0; top: 0; width: 100vw; height: 100vh;
  background: rgba(30,44,90,0.38);
  transition: opacity .23s;
  opacity: 0;
}
.promo-modal-bg.active {
  display: block;
  opacity: 1;
}
.promo-modal-popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 200;
  transform: translate(-50%, -50%);
  background: #fff;
  box-shadow: 0 8px 32px 0 rgba(49,105,224,0.13), 0 2px 18px 0 rgba(0,0,0,0.13);
  border-radius: 1.3rem;
  padding: 1.4rem 1.2rem 1.2rem 1.2rem;
  flex-direction: column;
  align-items: stretch;
  gap: 1.1rem;
  min-width: 240px;
  max-width: 95vw;
  width: 350px;
  border: 1.5px solid #24409b;
  animation: fadeIn .22s cubic-bezier(.48,1.4,.66,1.01);
  box-sizing: border-box;
  overflow: hidden;
}
.promo-modal-popup.active { display: flex; }
.close-modal-btn {
  background: none;
  border: none;
  color: #24409b;
  font-size: 2.0rem;
  font-weight: bold;
  position: absolute;
  top: 13px;
  right: 21px;
  cursor: pointer;
  transition: color 0.19s;
  z-index: 300;
  line-height: 1;
}
.close-modal-btn:hover { color: #e84242; }

.promo-modal-popup input[type="file"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-size: 1rem;
  padding: 0.42rem 0.4rem;
  background: #f5f8fd;
  border-radius: 0.5rem;
  border: 1.2px solid #b4c6ef;
  margin-bottom: 0.5rem;
  outline: none;
  transition: border .17s;
  overflow: hidden;
  display: block;
}
.promo-modal-popup input[type="file"]:focus { border-color: #24409b; }
.promo-modal-popup button[type="submit"] {
  background: #24409b;
  color: #fff;
  font-weight: 700;
  border: none;
  padding: 0.57rem 1.2rem;
  border-radius: 0.62rem;
  font-size: 1.06rem;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  transition: background .16s;
}
.promo-modal-popup button[type="submit"]:hover { background: #0a2478; }

@keyframes fadeIn {
  from { transform: translate(-50%, -62%) scale(.98); opacity: .7;}
  to   { transform: translate(-50%, -50%) scale(1); opacity: 1;}
}

/* ---------------------- POPUP SUCCESS ---------------------- */
.popup-success {
  position: fixed;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: #1fc366;
  color: #fff;
  font-size: 1.12rem;
  font-weight: 700;
  border-radius: 1.1rem;
  padding: 16px 35px;
  box-shadow: 0 6px 32px rgba(70,170,120,0.13), 0 2px 10px 0 rgba(0,0,0,0.09);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(.4,2.3,.3,1), top 0.25s;
}
.popup-success.active {
  opacity: 1;
  pointer-events: auto;
}

/* ====================== MEDIA QUERIES MEJORADOS ====================== */
/* Tablet y laptops chicas: TODO en columna y centrado, imágenes 1x1 */
@media (max-width: 1100px) {
  .promo-container { flex-direction: column; gap: 30px; }
  .promo-images { flex-direction: column; gap: 60px; align-items: center; }
  .promo-image-wrapper { margin: 0 auto; }
  .promo-image{
    width: 96vw;
    max-width: 550px;
    max-height: 800px;
    height: auto;
    aspect-ratio: unset;
    border-radius: 12px;
    margin: 0 auto;
    object-fit: contain;
    transform: none;
    z-index: 0 !important;
  }
  .promo-image.middle {
    width: 96vw;
    max-width: 650px;
    max-height: 850px;
    height: auto;
    aspect-ratio: unset;
    border-radius: 12px;
    margin: 0 auto;
    object-fit: contain;
    transform: none;
    z-index: 0 !important;
  }
}

/* Tablet vertical y mobile grande */
@media (max-width: 800px) {
  .promo-container { margin-top: 30px; margin-bottom: 32px; }
  .promo-images { gap: 50px; }
  .promo-image{
    width: 95vw;
    max-width: 550px;
    max-height: 700px;
    aspect-ratio: unset;
    border-radius: 10px;
    margin: 0 auto;
    object-fit: contain;
    transform: none;
    z-index: 0 !important;
  }
  .promo-image.middle {
    width: 95vw;
    max-width: 600px;
    max-height: 750px;
    aspect-ratio: unset;
    border-radius: 10px;
    margin: 0 auto;
    object-fit: contain;
    transform: none;
    z-index: 0 !important;
  }
}

/* Mobile (móvil vertical y tablets muy pequeñas) */
@media (max-width: 650px) {
  .promo-container { margin-top: 14px; margin-bottom: 18px; gap: 7px; }
  .promo-images { gap: 30px; }
  .promo-image-wrapper { margin: 0 auto; padding: 0; }

  .promo-image{
    width: 80vw;
    max-width: 80vw;
    height: auto;
    max-height: none;
    aspect-ratio: unset;
    border-radius: 9px;
    margin: 0 auto 13px auto;
    object-fit: contain;
    display: block;
    transform: none;
    z-index: 0 !important;
  }
  .promo-image.middle {
    width: 90vw;
    max-width: 90vw;
    height: auto;
    max-height: none;
    aspect-ratio: unset;
    border-radius: 9px;
    margin: 0 auto 13px auto;
    object-fit: contain;
    display: block;
    transform: none;
    z-index: 0 !important;
  }
}

/* Extra-pequeño (teléfonos chicos) */
@media (max-width: 420px) {
  .promo-images { gap: 30px; }
  .promo-image {
    width: 80vw;
    max-width: 80vw;
    height: auto;
    max-height: none;
    aspect-ratio: unset;
    border-radius: 7px;
    margin-bottom: 12px;
    object-fit: contain;
    transform: none;
    z-index: 0 !important;
  }
  .promo-image.middle {
    width: 90vw;
    max-width: 90vw;
    height: auto;
    max-height: none;
    aspect-ratio: unset;
    border-radius: 7px;
    margin-bottom: 12px;
    object-fit: contain;
    transform: none;
    z-index: 0 !important;
  }
  .promo-image-wrapper { padding: 0 1vw; }
  .promo-modal-popup {
    min-width: 90vw;
    max-width: 90vw;
    width: 90vw;
    padding: 0.6rem 0.02rem 0.6rem 0.02rem;
    border-radius: 0.7rem;
  }
  .close-modal-btn { top: 4px; right: 7px; font-size: 1.3rem; }
}
