/* Estilos generales y contenedor responsive */

.table-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.responsive-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.header-title {
    text-align: center;
    font-size: 1.4rem;
    color: #008000;
    font-weight: bold;
    padding-bottom: 5px;
}

.header-subtitle {
    text-align: right;
    font-size: 0.95rem;
    color: #666;
    padding-bottom: 10px;
}

.header-main {
    text-align: center;
    font-size: 1.1rem;
    color: #444;
    padding-bottom: 20px;
}

.responsive-table th.Cabeceras {
    background-color: #2c3e50;
    color: #ffffff;
    padding: 12px 10px;
    font-size: 0.9rem;
    text-align: center;
    border: 1px solid #1a252f;
}

.category-row {
    background-color: #9BD311;
    color: #fff;
    font-weight: bold;
    text-align: left;
    padding: 10px 15px;
}

.responsive-table td {
    padding: 10px;
    border: 1px solid #e0e0e0;
    font-size: 0.9rem;
    vertical-align: middle;
}

.responsive-table tbody tr:nth-child(even) {
    background-color: #f9fbf9;
}

.responsive-table tbody tr:hover {
    background-color: #f1f7ed;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.valores-col {
    background-color: #FFFFFF;
    font-weight: bold;
    color: #27ae60;
}

.responsive-table img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Ocultar etiquetas móviles por defecto en escritorio */
.mobile-label {
    display: none;
}

/* DISEÑO RESPONSIVE: TARJETAS VERTICALES EN PANTALLAS PEQUEÑAS (Móviles < 768px) */
@media screen and (max-width: 768px) {
    .table-container {
        padding: 10px;
    }

    /* Ocultar la cabecera tradicional de la tabla */
    .responsive-table thead, 
    .responsive-table tr.Cabeceras {
        display: none;
    }

    /* Hacer que cada fila de datos se comporte como una tarjeta flotante */
    .responsive-table tr.data-row {
        display: block;
        background-color: #ffffff;
        border: 1px solid #ddd;
        border-radius: 8px;
        margin-bottom: 15px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        padding: 10px;
    }

    /* Fila de categoría como tarjeta con diseño propio */
    .responsive-table tr.category-tr {
        display: block;
        background: none;
        margin: 20px 0 10px 0;
    }
    .responsive-table tr.category-tr td {
        display: block;
        background-color: #9BD311;
        border-radius: 6px;
        text-align: center;
    }

    /* Mostrar la etiqueta descriptiva antes de cada dato en modo móvil */
    .mobile-label {
        display: inline-block;
        font-weight: bold;
        margin-right: 5px;
        color: #588605;
    }

    /* Transformar la tabla para que las filas actúen como bloques apilados */
    .responsive-table, 
    .responsive-table tbody, 
    .responsive-table tr, 
    .responsive-table td {
        display: block;
        width: 100% !important;
    }

    .responsive-table td {
        text-align: left !important;
        padding: 6px 10px;
        border: none;
        border-bottom: 1px solid #f1f1f1;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .responsive-table td:last-child {
        border-bottom: none;
    }

    .responsive-table td.text-right, 
    .responsive-table td.text-center {
        text-align: left !important;
    }

    .responsive-table tr.data-row td.valores-col {
        background-color: #eafaf1;
        border-radius: 4px;
        padding: 6px 8px;
        margin-top: 4px;
    }
}