/* ========================================
   SKELETONS - Placeholders de carga
   ======================================== */

/* Animación de pulso para skeletons */
@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Skeleton para curso-card */
.skeleton-card {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.skeleton-card__image {
    width: 100%;
    height: 200px;
    background: #e0e0e0;
}

.skeleton-card__content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skeleton-card__badge {
    width: 80px;
    height: 24px;
    border-radius: 999px;
}

.skeleton-card__title {
    width: 85%;
    height: 24px;
}

.skeleton-card__description {
    width: 100%;
    height: 16px;
}

.skeleton-card__description--line-2 {
    width: 70%;
    height: 16px;
}

.skeleton-card__button {
    width: 100%;
    height: 40px;
    border-radius: 999px;
    margin-top: 0.5rem;
}

/* Skeleton para grid de cursos */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: 2rem;
}

/* Skeleton para item del carrito */
.skeleton-carrito-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.skeleton-carrito-item__image {
    width: 120px;
    height: 80px;
    border-radius: 8px;
    flex-shrink: 0;
}

.skeleton-carrito-item__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.skeleton-carrito-item__title {
    width: 60%;
    height: 20px;
}

.skeleton-carrito-item__price {
    width: 100px;
    height: 24px;
}

/* Skeleton para texto */
.skeleton-text {
    height: 16px;
    border-radius: 4px;
}

.skeleton-text--large {
    height: 24px;
}

.skeleton-text--small {
    height: 12px;
}

/* Skeleton para título de sección */
.skeleton-title {
    width: 40%;
    height: 32px;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* Skeleton para modal */
.skeleton-modal {
    padding: 2rem;
}

.skeleton-modal__header {
    width: 50%;
    height: 36px;
    margin-bottom: 1.5rem;
}

.skeleton-modal__image {
    width: 100%;
    height: 300px;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.skeleton-modal__content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skeleton-modal__line {
    width: 100%;
    height: 16px;
}

.skeleton-modal__line--short {
    width: 60%;
}

/* Estados de carga */
.loading-state {
    position: relative;
    min-height: 200px;
}

.loading-state::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spinner-rotate 0.8s linear infinite;
}

@keyframes spinner-rotate {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Ocultar skeletons cuando el contenido está cargado */
.content-loaded .skeleton {
    display: none;
}



