/* =========================
   BASE
========================= */
body {
  font-family: 'Segoe UI', sans-serif;
  background: #e6f2ff;
  margin: 0;
  padding: 0px;
  text-align: left;
  overflow-x: hidden;
}

h1 {
  color: #003366;
  text-align: center;
}

input[type="text"] {
  padding: 10px;
  margin: 20px auto;
  width: 90%;
  max-width: 400px;
  border-radius: 8px;
  border: 1px solid #ccc;
  display: block;
}

/* =========================
   BOTONERA (Áreas/Subáreas)
========================= */
.botonera {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.boton,
.subboton {
  background-color: #003366;
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: bold;
  border: none;
  text-align: center;
  display: inline-block;
  flex: 0 0 180px;
}

.subboton {
  display: block;
  width: 50%;
  margin: 8px auto;
}

/* =========================
   CAPA OSCURA (Backdrop)
========================= */
.fondo-opaco {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.6);
  display: none;
  z-index: 98;
}
.fondo-opaco.mostrar { display: block; }

/* =========================
   MODALES GENÉRICOS
========================= */
.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 16px;
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
  width: 90%;
  max-width: 600px;
  display: none;
  box-shadow: 0 0 15px rgba(0,0,0,0.2);
  text-align: left;
  font-weight: normal;
  transition: background-color 0.3s ease;
  cursor: pointer;
  z-index: 100;
}
.modal.mostrar { display: block; }

.oculto { display: none; }

.curso:hover {
  background-color: #f0f8ff;
  box-shadow: 0 0 6px rgba(0,0,0,0.15);
}

/* =========================
   MODAL CURSO (detalle)
========================= */
.modal-curso {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 0 20px rgba(0,0,0,0.4);
  text-align: left;
  z-index: 102;
}

/* Botón cerrar genérico de modales */
.cerrar-modal {
  position: absolute;
  top: 10px; right: 10px;
  background-color: #e60000;
  color: #fff;
  width: 32px; height: 32px;
  border-radius: 50%;
  text-align: center;
  line-height: 32px;
  font-size: 20px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0,0,0,0.3);
  z-index: 999;
  transition: background-color 0.2s ease;
}
.cerrar-modal:hover { background-color: #cc0000; }

/* Contenido del modal curso */
.contenido-curso {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  gap: 30px;
  padding: 20px;
}
.contenido-curso img {
  width: 320px;
  max-width: 100%;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
}
.info-curso { flex: 1; text-align: left; }

/* =========================
   BOTONES DE PAGO
========================= */
.botones-pago button {
  display: inline-block;
  width: 100%;
  min-width: 200px;
  margin: 6px 0;
  padding: 12px 15px;
  font-size: 15px;
  font-weight: bold;
  white-space: nowrap;
  text-align: center;
  box-sizing: border-box;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}
.btn-azul { background-color: #003366; color: white; }
.btn-morado { background-color: purple; color: white; }
.btn-paypal { background-color: #ffc439; color: #003087; }
.btn-tarjeta { background-color: #0099cc; color: white; }

/* =========================
   CARRITO
========================= */
.carrito {
  position: fixed;
  top: 20px; right: 20px;
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  width: 300px;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.5s ease-in-out;
  pointer-events: none;
  z-index: 101;
}
.carrito.mostrar {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.carrito h3 { margin-top: 0; }
#lista-carrito {
  text-align: left;
  padding-left: 20px;
  max-height: 200px;
  overflow-y: auto;
}
.carrito button {
  display: inline-block;
  width: 100%;
  max-width: 220px;
  margin: 5px auto;
  padding: 10px 15px;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

/* =========================
   CARRUSEL DENTRO DEL MODAL CURSO (imágenes del certificado)
========================= */
.carrusel-img {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.carrusel-img img {
  max-width: 100%;
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(0,0,0,0.1);
}
.btn-next-img {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  background: #ffffffdd;
  border: none;
  padding: 8px 12px;
  font-size: 20px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 5px rgba(0,0,0,0.3);
  z-index: 2;
}

/* =========================
   NOTIFICACIONES
========================= */
.notificacion {
  position: fixed;
  bottom: 30px; right: 30px;
  background: #003366;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.4);
  z-index: 200;
  animation: fadeInOut 2s ease-in-out forwards;
}
@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(20px); }
  10% { opacity: 1; transform: translateY(0); }
  90% { opacity: 1; }
  100% { opacity: 0; transform: translateY(20px); }
}

/* =========================
   MODAL QR / PAYPAL
========================= */
#modal-qr,
#modal-paypal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 30px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 0 25px rgba(0,0,0,0.4);
  z-index: 104;
}
#modal-paypal { box-shadow: 0 0 30px rgba(0,0,0,0.5); }

#modal-qr .cerrar-modal {
  position: absolute;
  top: 10px; right: 20px;
  font-size: 26px;
  background: red;
  color: white;
  border-radius: 50%;
  padding: 6px 12px;
  cursor: pointer;
}

/* =========================
   SUGERENCIAS DE BÚSQUEDA
========================= */
.sugerencias {
  list-style: none;
  padding-left: 0;
  margin: 10px auto;
  max-width: 600px;
  text-align: left;
}
.sugerencias li {
  background: #fff;
  padding: 10px 15px;
  margin: 5px 0;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid #ccc;
  box-shadow: 0 0 4px rgba(0,0,0,0.1);
  transition: background 0.3s ease;
}
.sugerencias li:hover { background-color: #f0f0f0; }

/* =========================
   RESPONSIVE
========================= */
@media screen and (max-width: 768px) {
  .modal, .modal-curso, #modal-qr, #modal-paypal {
    width: 95%;
    padding: 10px;
  }
  .contenido-curso { flex-direction: column; }
  .carrito { width: 90%; right: 5%; }
}

/* =========================
   ACCIONES (eliminar curso)
========================= */
.eliminar-curso {
  color: red;
  font-size: 18px;
  margin-left: 10px;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease;
  display: inline-block;
}
.eliminar-curso:hover {
  color: darkred;
  transform: scale(1.2);
}

/* =========================
   CORRECCIONES DE TEMA/WORDPRESS
========================= */
/* Evitar scrolls internos impuestos por el tema/maquetador */
.site-main,
.entry-content,
.elementor-section,
.elementor-container,
.wp-block-group {
  overflow: visible !important;
}

/* Eliminar padding/limitación del contenido principal */
#primary,
.content-area,
.container,
.site-content,
.entry-content {
  padding: 0 !important;
  max-width: none !important;
}

/* Truco para romper contenedor boxed (franja full-bleed) */
.incapyge-full {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

/* =========================
   VISOR (FULLSCREEN) — único (se eliminan duplicados)
========================= */
.viewer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 105;
}
.viewer.mostrar { display: flex; }
.viewer-content {
  position: relative;
  max-width: 90vw; max-height: 90vh;
  display: flex; align-items: center; justify-content: center;
}
#viewer-img {
  max-width: 90vw; max-height: 90vh;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.viewer-close {
  position: absolute;
  top: -12px; right: -12px;
  width: 36px; height: 36px;
  border: none; border-radius: 50%;
  background: #e60000; color: #fff;
  font-size: 22px; cursor: pointer;
  box-shadow: 0 0 10px rgba(0,0,0,.4);
}
.viewer-nav {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px;
  border: none; border-radius: 50%;
  background: rgba(255,255,255,.9); color: #0b3a6b;
  font-size: 26px; cursor: pointer;
  box-shadow: 0 0 8px rgba(0,0,0,.3);
}
.viewer-prev { left: -52px; }
.viewer-next { right: -52px; }
@media (max-width: 768px){
  .viewer-prev { left: -38px; }
  .viewer-next { right: -38px; }
}

/* ===================================================================
   CÓDIGO DE CARRUSELES — AL FINAL (como solicitaste)
   Incluye: carrusel simple (.carousel ...) + multi-ítem (.multi-carousel)
   y el lightbox específico de imágenes del carrusel (#imgLightbox)
=================================================================== */

/* ===== Carrusel simple (coincide con tu HTML de CONVENIOS) ===== */
.carousel-section {
  max-width: 1200px;
  margin: 10px auto 40px;
  padding: 0 16px;
}
.carousel-wrapper { position: relative; }
.carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* IE/Edge antiguo */
  padding: 6px 0;
}
.carousel::-webkit-scrollbar { display: none; } /* WebKit */

.carousel a { flex: 0 0 auto; display: block; }
.carousel img {
  display: block;
  height: 400px;  /* ⇦ AJUSTA ESTE VALOR PARA IMÁGENES MÁS GRANDES */
  width: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
  background: transparent;
}

/* Flechas del carrusel simple */
.arrow {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px;
  border: none; border-radius: 50%;
  background: rgba(11,58,107,.92);
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  z-index: 2;
}
.arrow img { width: 18px; height: 18px; filter: invert(1) brightness(100); }
.arrow.prev { left: -6px; }
.arrow.next { right: -6px; }

@media (max-width: 768px) {
  .carousel img { height: 160px; }
  .arrow { width: 36px; height: 36px; }
}

/* ===== Carrusel multi-ítem (general) ===== */
.multi-carousel {
  --gap: 16px;
  max-width: 1200px;
  margin: 10px auto 40px;
  position: relative;
  overflow: hidden; /* (unificado) evita que sobresalga el carrusel */
}
.multi-carousel .viewport { overflow: hidden; }
.multi-carousel .track {
  display: flex;
  gap: var(--gap);
  transition: transform .5s ease;
  will-change: transform;
  padding: 6px 0;
}
.multi-carousel .track li {
  list-style: none;
  flex: 0 0 auto;         /* el JS define el ancho por ítem */
  background: transparent; /* lados transparentes */
}
.multi-carousel .item {
  height: auto !important;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  box-shadow: none;
  border: 0;
}
.multi-carousel img {
  display: block;
  width: 100%;
  height: 500px;          /* ⇦ AJUSTA ESTE VALOR PARA IMÁGENES MÁS GRANDES */
  object-fit: contain;
  background: transparent;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
}

/* Botones del multi-ítem */
.multi-carousel .nav {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  border: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #0b3a6b; color: #fff;
  cursor: pointer; opacity: .9;
  z-index: 2;
}
.multi-carousel .nav:disabled { opacity: .3; cursor: default; }
.multi-carousel .prev { left: -6px; }
.multi-carousel .next { right: -6px; }

/* Responsivo (multi-ítem) */
@media (max-width: 1024px){ .multi-carousel img{ height: 170px; } }
@media (max-width: 768px) { .multi-carousel img{ height: 150px; } }
@media (max-width: 480px) { .multi-carousel img{ height: 140px; } }

/* Quitar scroll interno si algún contenedor lo impone */
#modelos-carrusel,
.multi-carousel,
.multi-carousel .viewport,
.multi-carousel .track {
  overflow-y: visible !important;
  overflow-x: hidden;
  height: auto !important;
}

/* ===== Lightbox ESPECÍFICO del carrusel de imágenes ===== */
#imgLightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
#imgLightbox .viewer-content {
  position: relative;
  max-width: 100vw; max-height: 130vh;
  display: flex; align-items: center; justify-content: center;
}
#lightboxImg {
  max-width: 100vw; max-height: 130vh;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
#imgLightbox .viewer-close,
#imgLightbox .viewer-nav {
  position: absolute;
  border: none; border-radius: 50%;
  width: 80px; height: 80px; cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 0 8px rgba(0,0,0,.3);
}
#imgLightbox .viewer-close {
  top: -14px; right: -14px;
  background: #e60000; color: #fff; font-size: 22px;
}
#imgLightbox .viewer-prev,
#imgLightbox .viewer-next {
  top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.9); color: #0b3a6b; font-size: 26px;
}
#imgLightbox .viewer-prev { left: -52px; }
#imgLightbox .viewer-next { right: -52px; }

@media (max-width: 768px){
  #imgLightbox .viewer-prev { left: -38px; }
  #imgLightbox .viewer-next { right: -38px; }
}
/* Cuando está embebido en WordPress, ocultar cabecera/menús del propio Certificado2 */
.embed header,
.embed nav,
.embed .topbar,
.embed .navbar,
.embed .menu,
.embed .header {
  display: none !important;
}

/* Ajuste visual para que no quede espacio vacío */
.embed main,
.embed .content,
.embed .container {
  margin-top: 0 !important;
  padding-top: 0 !important;
}
/* ===== Modo EMBED (cuando viene ?embed=1) ===== */
html.embed, body.embed{
  background: transparent !important;
}

body.embed{
  padding-top: 0 !important;
}

/* Oculta el título grande del HTML embebido */
body.embed > h1{
  display:none !important;
}
