/* Skeletons de carga de la extranet (ver /scripts/extranet/scripts/skeleton.js) */

/* Si el contenedor es una rejilla (flex o grid) ocupa todo el ancho.
   Los .skel-elemento son una celda más de la rejilla y respetan su ancho. */
.skel-wrap:not(.skel-elemento) {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
    grid-column: 1 / -1;
}

.skel {
    display: block;
    position: relative;
    overflow: hidden;
    background-color: #e9ecef;
    border-radius: 4px;
}

    .skel::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        transform: translateX(-100%);
        background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0.6) 50%, rgba(255, 255, 255, 0) 100%);
        animation: skel-brillo 1.4s ease-in-out infinite;
    }

@keyframes skel-brillo {
    100% {
        transform: translateX(100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .skel::after {
        animation: none;
    }
}

/* Contenedor que es un elemento flex sin ancho propio (p. ej. #CombBoxs dentro de un .form-row):
   mientras carga ocupa toda la fila; si no, se encoge y el skeleton se queda sin ancho.
   Las columnas (.col-*) conservan su ancho. Al pintarse el contenido real deja de aplicarse. */
:has(> .skel-wrap:not(.skel-elemento)):not([class*="col"]) {
    flex: 1 1 100%;
    min-width: 0;
}

/* Sobre fondos de color (lateral verde del perfil) */
.green .skel {
    background-color: rgba(255, 255, 255, 0.35);
}

/* Piezas */
.skel-linea {
    height: 12px;
    margin-bottom: 10px;
}

.skel-linea-sm {
    height: 9px;
    margin-bottom: 8px;
}

.skel-titulo {
    height: 22px;
    width: 40%;
    margin-bottom: 24px;
}

.skel-circulo {
    border-radius: 50%;
}

.skel-campo {
    height: 38px;
    margin-bottom: 18px;
}

.skel-etiqueta {
    height: 10px;
    width: 35%;
    margin-bottom: 8px;
}

.skel-centrado {
    margin-left: auto;
    margin-right: auto;
}

/* Bloques */
.skel-fila {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

.skel-fila-cuerpo {
    flex: 1 1 auto;
    min-width: 0;
}

.skel-tarjeta {
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    background: #fff;
}

.skel-rejilla {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

    .skel-rejilla > div {
        width: 50%;
        padding: 0 10px;
    }

.skel-rejilla-3 > div {
    width: 33.333%;
}

@media (max-width: 767px) {
    .skel-rejilla > div,
    .skel-rejilla-3 > div {
        width: 100%;
    }

    .skel-fila {
        gap: 12px;
    }
}
