/* -------------------------
   Página Comunidad
-------------------------- */
* { box-sizing: border-box; }
body {
  font-family: Arial, sans-serif;
  background: #000;
  margin: 0;
  padding-bottom: 120px;  /* Agregado para que el contenido no se tape con el banner */
  /* el padding-bottom lo gestiona JS cuando el banner está fijo */
}

.comunidad {
  max-width: 1100px;
  margin: auto;
  padding: 2rem;
}

.comunidad h2 {
  text-align: center;
  font-size: 2.2rem;
  margin-bottom: 2rem;
  color: #fff;
}

/* =========================
   GRID DE CURSOS
========================= */
.cursos-container {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.curso-card {
  background-color: #222;
  width: calc(33% - 20px);
  margin-bottom: 20px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  padding: 12px;
  transition: transform .2s ease, box-shadow .2s ease;
}

.curso-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
}

/* Imágenes completas (no recortar) */
.curso-card img {
  width: 100%;
  height: 420px;       /* alto consistente */
  display: block;
  object-fit: contain; /* muestra la imagen completa */
  background: #000;    /* relleno elegante para bandas */
  border-radius: 10px;
  margin-bottom: 14px;
}

/* Contenido */
.curso-card .info { position: relative; z-index: 1; }

.curso-card h3 {
  font-size: 1.1rem;
  line-height: 1.35;
  margin-bottom: .5rem;
  color: #fff;
}

.curso-card p {
  font-size: .95rem;
  color: #bbb;
  margin: .28rem 0;
}

/* Precio en bloque (no flotante) */
.precio,
.precio-preventa {
  position: static;
  background: #2b2b2b;
  color: #fff;
  padding: 8px 10px;
  font-size: 16px;
  text-align: center;
  border-radius: 8px;
  margin-top: 10px;
}

/* =========================
   BOTONES DE CURSO
========================= */
.card-buttons {
  display: flex;
  justify-content: space-between;
  gap: .6rem;
  margin-top: 1rem;
}

.card-buttons button {
  flex: 1;
  padding: .7rem .9rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  transition: transform .2s, background .3s, box-shadow .2s;
}
.card-buttons button:active { transform: scale(.98); }

.btn-buy  { background: #27ae60; color:#fff; }
.btn-book { background: #3498db; color:#fff; }
.btn-buy:hover  { background:#219150; box-shadow:0 6px 14px rgba(39,174,96,.35); }
.btn-book:hover { background:#2a7dbe; box-shadow:0 6px 14px rgba(52,152,219,.35); }

/* Feedback verde temporal en botón copiado */
.btn-copiado {
  background: #2ecc71 !important;
  color: #fff !important;
}

/* Countdown */
.countdown {
  margin-top: .6rem;
  font-size: .9rem;
  font-weight: bold;
  color: #e67e22;
}

/* =========================
   MODAL DE PAGO (encima de todo)
========================= */
.modal {
  display: none;
  position: fixed;
  z-index: 3000;          /* por encima del banner y avisos */
  inset: 0;
  background: rgba(240, 236, 236, 0.6);
  justify-content: center;
  align-items: center;
  animation: fadeIn .3s ease-in-out;
}
.modal-content {
  background: #fff;
  padding: 25px;
  border-radius: 16px;
  width: min(420px, 92vw);
  text-align: center;
  box-shadow: 0 10px 26px rgba(0,0,0,.45);
  position: relative;
}
.modal-content h2 {
  margin-bottom: 10px;
  font-size: 1.35rem;
  color: #f7eded;
}
.close {
  position: absolute;
  right: 15px;
  top: 12px;
  font-size: 22px;
  font-weight: bold;
  color: #888;
  cursor: pointer;
  transition: .2s;
}
.close:hover { color:#000; }

/* =========================
   BOTONES DE PAGO
========================= */
.metodos-pago { margin-top: 1rem; }
.metodos-pago button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin: 10px 0;
  padding: 12px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  transition: transform .2s, background .3s;
  color: #fff;
}
.metodos-pago i { font-size: 18px; }
.metodos-pago button:hover { transform: translateY(-2px); }

.metodos-pago button:nth-child(1){ background:#8000ff; }   /* Yape */
.metodos-pago button:nth-child(1):hover{ background:#5a00b3; }
.metodos-pago button:nth-child(2){ background:#00b894; }   /* Plin */
.metodos-pago button:nth-child(2):hover{ background:#00856b; }
.metodos-pago button:nth-child(3){ background:#ff9800; }   /* BCP local */
.metodos-pago button:nth-child(3):hover{ background:#e68900; }
.metodos-pago button:nth-child(4){ background:#c0440b; }   /* BCP interb */
.metodos-pago button:nth-child(4):hover{ background:#a6390b; }
.metodos-pago button:nth-child(5){ background:#ff9800; }   /* BBVA local */
.metodos-pago button:nth-child(5):hover{ background:#e68900; }
.metodos-pago button:nth-child(6){ background:#c0440b; }   /* BBVA interb */
.metodos-pago button:nth-child(6):hover{ background:#a6390b; }

/* =========================
   QR
========================= */
.qrs {
  display: flex;
  justify-content: space-around;
  margin: 1rem 0;
  gap: 1rem;
}
.qrs div { text-align: center; }
.qrs img {
  width: 120px;
  border: 2px solid #eee;
  border-radius: 10px;
  padding: 6px;
}

/* Aviso de copiado dentro del modal (debajo de QR) */
.copy-notice[hidden] { display: none !important; }

.copy-notice {
  margin: 12px auto 0;
  width: 100%;
  max-width: 420px;
  background: #f4f8ff;
  color: #1f3b57;
  border: 1px solid #cfe0ff;
  border-radius: 12px;
  padding: 12px 48px 12px 14px; /* espacio para el botón ✖ */
  font-size: 14px;
  font-weight: 700;
  position: relative;
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
}

.copy-close {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #1f3b57;
  font-size: 16px;
  cursor: pointer;
  opacity: .8;
}
.copy-close:hover { opacity: 1; }

/* =========================
   TOAST
========================= */
#toast {
  visibility: hidden;
  min-width: 200px;
  background: #333;
  color: #fff;
  text-align: center;
  border-radius: 10px;
  padding: 12px 14px;
  position: fixed;
  z-index: 2500;     /* debajo del modal; encima del banner */
  left: 50%;
  bottom: 30px;
  font-size: 15px;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity .5s, bottom .5s, visibility .5s;
}
#toast.show {
  visibility: visible;
  opacity: 1;
  bottom: 50px;
}



/* =========================
   ANIMACIÓN DEL COUNTDOWN
========================= */

.countdown {
  margin-top: .6rem;
  font-size: .9rem;
  font-weight: bold;
  color: #e67e22;
  animation: pulso 1s infinite alternate;
}

/* Animación suave */
@keyframes pulso {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(1.08);
    opacity: 0.8;
  }
}

/* =========================
   MENSAJE CUANDO INICIA
========================= */
.mensaje-inicio {
  margin-top: 10px;
  font-weight: bold;
}

.contador-inicio {
  color: #ff8800;   /* Naranja */
  font-size: 16px;
  display: block;
  margin-bottom: 4px;
}

.texto-inicio {
  color: #ffffff;
  font-size: 14px;
}

/* =========================
   CONTADOR NUMÉRICO (BASE)
========================= */

.contador-numeros {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  perspective: 800px; /* necesario para el flip 3D */
}

/* ⏱️ NÚMEROS */
.contador-numeros span {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 34px;
  height: 42px;

  background: linear-gradient(180deg, #2e2e2e, #1a1a1a);
  border-radius: 8px;

  font-size: 18px;
  font-weight: 800;
  color: #ffffff;

  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.08),
    0 4px 10px rgba(0,0,0,.6);

  transform-style: preserve-3d;
}

/* =========================
   FLIP ANIMATION
========================= */

.contador-numeros span.flip {
  animation: flipNumber 0.55s ease;
}

@keyframes flipNumber {
  0% {
    transform: rotateX(0deg);
  }
  45% {
    transform: rotateX(-90deg);
  }
  100% {
    transform: rotateX(0deg);
  }
}

.contador-numeros {
  font-size: 20px;
  font-weight: bold;
  margin: 10px 0;
}

.contador-numeros span {
  display: inline-block;
  min-width: 30px;
  text-align: center;
  transition: transform 0.3s;
}

/* 🔄 Flip */
.flip {
  animation: flip 0.4s;
}

@keyframes flip {
  0% { transform: rotateX(0); }
  50% { transform: rotateX(90deg); }
  100% { transform: rotateX(0); }
}

/* ✨ Glow */
.glow {
  color: #ff9800;
  text-shadow: 0 0 8px rgba(255,152,0,0.8);
}

/* ⏰ Urgente últimos 10s */
.urgente {
  animation: blink 1s infinite;
}

@keyframes blink {
  0%,100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* 🔒 Curso finalizado */
.locked {
  opacity: 0.6;
  filter: grayscale(1);
}

.mensaje-inicio {
  font-weight: bold;
  margin-top: 8px;
  color: #d32f2f;
}
/* =========================================
   DISEÑO MÓVIL - CURSOS
   ========================================= */

@media (max-width: 768px) {

    .comunidad {
        width: 100%;
        padding: 25px 15px;
        box-sizing: border-box;
    }

    .comunidad h2 {
        font-size: 24px;
        line-height: 1.2;
        text-align: center;
        margin-bottom: 25px;
    }

    /* Contenedor de cursos */
    .cursos-container {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 25px;
    }

    /* Tarjeta */
    .curso-card {
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        box-sizing: border-box;
    }

    /* Imagen */
    @media (max-width: 768px) {

    .curso-card {
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
        overflow: hidden;
    }

    .curso-card > img {
        width: 100%;
        height: auto;
        display: block;
    }

}

    /* Información */
    .curso-card .info {
        width: 100%;
        padding: 20px;
        box-sizing: border-box;
    }

    /* Título */
    .curso-card h3 {
        font-size: 19px;
        line-height: 1.3;
        margin: 0 0 15px;
    }

    /* Textos */
    .curso-card .info p {
        font-size: 15px;
        line-height: 1.5;
        margin: 7px 0;
    }

    /* Precio preventa */
    .precio-preventa {
        font-size: 22px !important;
        font-weight: bold;
        margin-top: 15px !important;
    }

    /* Contador */
    .contador-numeros {
        width: 100%;
        margin: 18px 0;
        padding: 12px 5px;
        box-sizing: border-box;

        display: flex;
        justify-content: center;
        align-items: center;

        font-size: 13px;
        white-space: nowrap;
    }

    .contador-numeros span {
        font-size: 20px;
        font-weight: bold;
    }

    /* Botones */
    .card-buttons {
        width: 100%;
        display: flex;
        gap: 10px;
        margin-top: 20px;
    }

    .card-buttons button {
        flex: 1;
        min-height: 48px;
        font-size: 15px;
    }
}
@media (max-width: 400px) {

    .comunidad {
        padding: 20px 10px;
    }

    .curso-card .info {
        padding: 16px;
    }

    .curso-card h3 {
        font-size: 17px;
    }

    .curso-card .info p {
        font-size: 14px;
    }

    .contador-numeros {
        font-size: 11px;
        padding: 10px 2px;
    }

    .contador-numeros span {
        font-size: 17px;
    }

    .card-buttons {
        flex-direction: column;
    }

    .card-buttons button {
        width: 100%;
    }
}
