/* Contenedor general */
.dfg-container {
    width: 100%;
}

/* ---- Barra de búsqueda ---- */
.dfg-search-wrapper {
    margin-bottom: 30px;
}

.dfg-search-left {
    margin-right: auto;
    margin-left: 0;
}
.dfg-search-center {
    margin-left: auto;
    margin-right: auto;
}
.dfg-search-right {
    margin-left: auto;
    margin-right: 0;
}

.dfg-search-field {
    position: relative;
    display: flex;
    align-items: center;
}

.dfg-search {
    width: 100%;
    padding: 0 40px 0 20px;
    border: 1px solid #e0e5ec;
    border-radius: 30px;
    background-color: #f2f5f9;
    font-size: 16px;
    color: #333;
    outline: none;
    transition: border-color 0.3s;
    box-sizing: border-box;
    height: 48px;
}

.dfg-search:focus {
    border-color: #3a6cb6;
}

.dfg-search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #888888;
    line-height: 0;
}

.dfg-search-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    display: block;
}

/* ---- Grid de tarjetas ---- */
.dfg-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

/* Tarjeta individual */
.dfg-card {
    background: #eef4f9;
    border: 2px solid transparent;
    border-radius: 24px;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    box-sizing: border-box;
    transition: transform 0.3s, border-color 0.3s;
    /* El padding se controla desde el panel (card_padding) */
}

.dfg-card:hover {
    border-color: #3a6cb6;
}

/* Bloque de información (izquierda) */
.dfg-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
}

/* Tipo de archivo */
.dfg-file-type {
    font-weight: 600;
    font-size: 14px;
    color: #3a6cb6;
    text-transform: uppercase;
    margin-bottom: 4px;
}

/* Título del archivo */
.dfg-title {
    font-weight: 700;
    font-size: 20px;
    color: #1a2b4c;
    line-height: 1.2;
    margin: 0 0 8px 0;
}

/* Tamaño del archivo (opcional) */
.dfg-size {
    color: #666666;
    font-size: 13px;
    margin-bottom: 15px;
}

/* Botón de descarga */
.dfg-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: #3a6cb6;
    border: none;
    border-radius: 6px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    align-self: flex-start;
    cursor: pointer;
}

.dfg-download:hover {
    background: #1a2b4c;
    color: #ffffff;
}

/* Imagen (derecha) */
.dfg-image {
    width: 40%;               /* se puede cambiar desde el panel con image_width */
    /* max-width: 200px;  ← ELIMINADO para que el ancho del panel funcione sin límite */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;   /* para que el padding no expanda el contenedor */
    overflow: hidden;         /* asegura que la imagen no sobresalga */
}

.dfg-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;       /* llena todo el contenedor, recortando si es necesario */
    border-radius: 14px;
    box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.15);
}

/* Clases de control */
.dfg-card.hidden {
    display: none !important;
}

.dfg-card.dfg-page-hidden {
    display: none !important;
}

/* Paginación (tus estilos personalizados) */
.dfg-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    width: 100%;
}

.dfg-page-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 40px;
    height: 40px;
    padding: 0 6px;
    border: 1px solid #e0e5ec;
    border-radius: 8px;
    background-color: #ffffff;
    color: #1a2b4c;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.dfg-page-button:hover {
    background-color: #f2f5f9;
    border-color: #3a6cb6;
}

.dfg-page-button.active {
    background-color: #3a6cb6;
    color: #ffffff;
    border-color: #3a6cb6;
    cursor: default;
}

/* Responsivo */
@media (max-width: 991px) {
    .dfg-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .dfg-card {
        flex-direction: column-reverse;
    }
    .dfg-image {
        width: 100%;
        max-width: 160px;
        margin: 0 auto;
        padding: 20px 20px 0 20px;
    }
    .dfg-info {
        padding: 20px;
    }
    .dfg-title {
        font-size: 20px;
    }
}