body {
    margin: 0;
    padding: 0;
    background: #0a0f18;
    color: #e6e6e6;
    font-family: Arial, sans-serif;
}

/* Modifica la clase .header */
.header {
    width: 100%;
    /* ❌ ELIMINA O COMENTA ESTA LÍNEA: padding: 22px; */
    
    background: #0a0f18;
    box-shadow: 0 0 20px rgba(0, 116, 255, 1);
    
    /* === CENTRADO FLEXBOX MANTENIDO === */
    display: flex;
    justify-content: center; /* Centra horizontalmente */
    align-items: center; /* Centra verticalmente */
    
    min-height: 70px;
}

/* Modifica la clase .titulo */
.titulo {
    margin: 0;
    /* ✅ AGREGA ESTE PADDING AQUÍ */
    padding: 22px 0; /* padding vertical de 22px para dar espacio arriba y abajo */
    
    font-size: 34px;
    font-weight: bold;
    color: #FFC533;
    text-shadow: 0 0 10px rgba(255, 197, 51, 0.45);
    white-space: nowrap; 
}

.contenido {
    max-width: 1200px;
    margin: 45px auto;
    padding: 20px;
    background: rgba(0, 43, 85, 0.25);
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(0, 116, 255, 0.15);
}

h2 {
    color: #2EC7FF;
    margin-top: 0;
}

a {
    color: #FFC533;
    transition: 0.3s;
}

a:hover {
    color: #FFB300;
}

html, body {
    overflow-x: hidden;
}

.footer {
    margin-top: 40px;
    padding: 22px;
    text-align: center;
    background: #002B55;
    color: #89bfff;
    font-size: 14px;
    border-top: 1px solid #2EC7FF;
    box-shadow: 0 0 20px rgba(0, 116, 255, 0.45);
}

.plataformas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    padding: 20px;
}

.plataforma-card {
    text-align: center;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 10px;
    background: #FFFFFF;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.plataforma-card img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 10px;
}

.plataforma-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.plataformas-p {
    color: #000; /* negro verdadero */
    font-weight: 600;
}

.plataforma-enlace {
    text-decoration: none;
    color: inherit;
}

.titulo-enlace {
    color: #FFC533;
    text-decoration: none;
}

.titulo-enlace:hover {
    opacity: .85;
}

/* GRID GENERAL */
.lista-cursos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

/* TARJETA */
.curso-item{
    background:#fff;
    border-radius:10px;
    padding:16px;
    box-shadow:0 6px 18px rgba(0,0,0,.06);
    display:flex;
    flex-direction:column;
    gap:10px;
    overflow:hidden;
}

/* TITULO */
.curso-titulo{
    font-size:13px;
    font-weight:900;
    color:#1a1a1a;
    text-align:center;
    line-height:1.35;

    display:-webkit-box;
    -webkit-line-clamp:3;   /* máximo 3 líneas */
    -webkit-box-orient:vertical;
    overflow:hidden;

    min-height:calc(1.35em * 3); /* fuerza misma altura */
}

/* METAS */
.curso-meta{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:12px;
    color:#555;
    font-size:14px;
}

.curso-meta span{
    text-align:center;
}

/* PRECIO */
.badge {
    display: block;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    text-align: left;
}
.badge.gratis {
    background: linear-gradient(135deg, #00e887, #00c853);
    color: #ffffff;
    text-align: center;
    margin: 0 auto;
    width: fit-content;
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 900;
    letter-spacing: .6px;
    text-transform: uppercase;
    box-shadow: 0 4px 14px rgba(0, 200, 83, .45);
}
.badge.cupon {
    background: linear-gradient(135deg, #ff4d4d, #ff8a00);
    color: #fff;
    text-align: center;
    margin: 0 auto;
    width: fit-content;
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 800;
    letter-spacing: .4px;
    box-shadow: 0 4px 12px rgba(255, 77, 77, .35);
}
.badge.pago {
    background: linear-gradient(135deg, #f8fafc, #eef2f7);
    color: #1f2937;
    border: 1px solid #d1d5db;
    text-align: center;
    margin: 0 auto;
    width: fit-content;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .08);
}

.badge .resto {
    display: none;
}

.badge .puntos {
    display: inline;
}
.ver-mas {
    color: #007bff;
    cursor: pointer;
    font-weight: 600;
}

.curso-precio{
    display:flex;
    align-items:center;
}

.curso-precio > span:not(.badge){
    flex:1;
    display:flex;
    align-items:center;
    justify-content:center;
    text-align:center;
    font-size:11px;
    color:#1a1a1a;
    line-height:1.2;
    padding:6px 4px;
}

.curso-precio .badge{
    display:block;
    text-align:left;
}

.curso-precio span:not(:last-child){
    border-right:1px solid #e5e7eb;
}

.curso-precio .derecha{
    font-size: 13px;
    white-space: nowrap;
    background:#F6F6F8; 
    color:#333;
    border:1px solid #ddd;
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: 700;
}

.curso-item hr{
    margin:16px -16px;
    border:0;
    border-top:2px solid #cbd5e1;
}

.centro {
    display: block;
    text-align: center;
    margin: 10px 0 6px;
    padding: 10px 0;
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    border-radius: 8px;
}

.centro del {
    color: #dc2626;
    font-weight: 600;
    margin-right: 6px;
    opacity: 0.9;
}

.centro::after {
    content: '';
    display: block;
    margin: 6px auto 0;
    width: 48px;
    height: 3px;

    border-radius: 2px;
}
/* BOTÓN */
.btn{
    margin-top:auto;
    margin-left:-16px;
    margin-right:-16px;
    margin-bottom:-16px;

    display:block;
    width:calc(100% + 32px);

    background:linear-gradient(90deg,#0074ff,#2ec7ff);
    padding:14px;
    border-radius:0 0 10px 10px;

    text-decoration:none;
    color:#fff;
    font-weight:700;
    text-align:center;
    box-sizing:border-box;
}

/* Contenedor de imagen */
.curso-img{
    width:calc(100% + 32px);
    height:150px;
    margin:-16px -16px 0;
    border-radius:10px 10px 0 0;
    background:#f3f3f3;
}

.curso-img img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}

.paginacion {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.paginacion a,
.paginacion span {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.paginacion a {
    background: #ffffff;
    color: #333;
    border: 1px solid #ddd;
}

.paginacion a:hover {
    background: #eaf2ff;
}

.paginacion .actual {
    background: #1e90ff;
    color: #fff;
}

.paginacion .dots {
    color: #999;
    pointer-events: none;
}


.rating-leyenda {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e3f5ff;
  color: #2196f3;
  font-size: 13px;
  font-weight: bold;
  padding: 4px 14px 4px 10px;
  border-radius: 16px;
  margin: 8px 0;
  min-height: 28px;
  box-shadow: 0 2px 8px #81c5fa2a;
  gap: 7px;
}
/* ===== CUPÓN DESCRIPCIÓN EXPANDIBLE ===== */

.cupon-desc-box {
    background: #F6F6F8;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    color: #333;
}

.cupon-desc-resto {
    display: none;
}

.cupon-desc-puntos {
    display: inline;
}

.cupon-desc-vermas {
    color: #007bff;
    cursor: pointer;
    font-weight: 700;
    margin-left: 4px;
}

.plataforma-card-libros {
    text-align: center;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 10px;
    background: #FFFFFF;
    cursor: pointer;

    /* 🔒 tamaño fijo */
    height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.plataforma-card-libros:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.plataformas-p-libros {
    color: #000;
    font-weight: 600;
    font-size: 14px;
    text-align: center;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;

    min-height: 36px;
}

.plataforma-card-libros img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 10px;
}

/* ======================
   LIBROS – CARD VERTICAL REAL (FIX DEFINITIVO)
   ====================== */

.curso-item-libro {
    padding: 0;
    overflow: hidden;
}

/* anulamos completamente el comportamiento de curso */
.curso-item-libro .curso-img {
    width: 100%;
    height: auto;
    margin: 0;
    border-radius: 10px 10px 0 0;
}

/* proporción real de libro */
.curso-img-libro {
    aspect-ratio: 3 / 4;
    background: #e5e7eb;
    overflow: hidden;
}

/* imagen del libro */
.curso-img-libro img {
    width: 100%;
    height: 100%;
    object-fit: cover;        /* vertical completa, horizontal recorte central */
    object-position: center;
    display: block;
}

/* ======================
   BOTÓN LIBROS (no recorte)
   ====================== */

.btn-libro{
    margin-top:auto;
    margin-left:0;
    margin-right:0;
    margin-bottom:0;

    border-radius:0 0 10px 10px;
    width:100%;
}

.plataformas-contador-libros {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #084c61;
    background: linear-gradient(135deg, #d4f1f9, #e8f8ff);
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
}

.adsense-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 280px; /* reserva espacio */
    margin: 20px 0;
    overflow: hidden;
}

.adsense-wrapper ins.adsbygoogle {
    display: block;
    width: 100%;
    max-width: 728px; /* desktop */
    min-height: 280px;
}


/* ======================
   RESPONSIVE MÓVILES
   ====================== */
@media (max-width: 768px) {
    .titulo {
        font-size: 26px;
        /* ✅ AJUSTA EL PADDING VERTICAL AQUÍ PARA MÓVILES */
        padding: 15px 0; /* Menos espacio en móvil */
    }

    .header {
        /* ✅ AJUSTA EL MIN-HEIGHT PARA QUE EL FLEXBOX SIGA FUNCIONANDO */
        min-height: 60px;
    }

    .contenido {
        width: 85%;
        padding: 15px;
    }
    .curso-img-libro {
        aspect-ratio: 2 / 3;
    }
        .adsense-wrapper {
        min-height: 250px;
    }

    .adsense-wrapper ins.adsbygoogle {
        max-width: 100%;
        min-height: 250px;
    }
}