/* Administrador de Archivos Zacualpan - Estilos Frontend Universales 1.8.3 */
/* Tipografía alineada: Montserrat con fallbacks del sistema (heredando estilos del sitio) */

/* Contenedores de shortcode: 100% de ancho útil dentro del módulo contenedor */
.aaz-shortcode-table,
.ccaf-shortcode-table,
.ccafac-shortcode-table {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    margin: 20px 0;
}

/* Divi 5: módulo Code sin constricción lateral artificial */
.et_pb_code .aaz-shortcode-table,
.et_pb_code .ccaf-shortcode-table,
.et_pb_module .aaz-shortcode-table,
.et_pb_module .ccaf-shortcode-table {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}

/* Tarjeta única ocupando el 100% del contenedor sin márgenes laterales que la achiquen */
.aaz-shortcode-table.ccaf-shortcode-table .ccc-table-wrap.aaz-tabla-wrap,
.aaz-shortcode-table .ccc-table-wrap,
.ccaf-shortcode-table .ccc-table-wrap.aaz-tabla-wrap,
.et_pb_code .aaz-shortcode-table .ccc-table-wrap,
.et_pb_code .ccaf-shortcode-table .ccc-table-wrap {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}

/* Neutralizador de wrappers anidados legados */
.ccc-table-outer-pass {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Tarjeta base: acotada estrictamente a contenedores div, nunca TABLE */
div.aaz-tabla-wrap,
div.tabla-zacualpan,
div.ccc-table-wrap {
    box-sizing: border-box;
    width: 100%;
    padding: 28px 30px;
    background: #f9f9f9;
    border: 1px solid #dddddd;
    border-radius: 18px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.05);
    margin: 24px 0;
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: #333333;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

div.aaz-tabla-wrap h3,
div.tabla-zacualpan h3,
div.ccc-table-wrap h3 {
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-weight: 700;
    text-transform: none;
    letter-spacing: normal;
    font-size: clamp(1.35rem, 2vw, 1.6rem);
    line-height: 1.25;
    color: #111111;
    margin: 0 0 18px 0;
    text-align: left;
}

.ccc-header-row,
.encabezado-tabla-acatlan,
.aaz-encabezado-tabla {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 18px;
}

.ccc-header-row h3,
.encabezado-tabla-acatlan h3,
.aaz-encabezado-tabla h3 {
    margin-bottom: 0 !important;
}

/* Buscador */
.ccc-search,
.buscador-acatlan,
.buscador-zacualpan,
.search-box {
    display: block;
    width: 100%;
    max-width: 480px;
    min-height: 48px;
    margin: 0 auto 22px;
    padding: 12px 22px;
    color: #333333;
    background: #ffffff;
    border: 2px solid #bbbbbb;
    border-radius: 999px;
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.35;
    font-weight: 400;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ccc-search:focus,
.buscador-acatlan:focus,
.buscador-zacualpan:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.16), 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* Contenedor de scroll horizontal para evitar overflow de página */
.tabla-scroll-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
}

/* Tabla de datos */
table.ccc-table,
table.aaz-table,
table.ccafac-table,
table.tabla-acatlan {
    width: 100%;
    min-width: 640px;
    margin: 0;
    background: #ffffff;
    border: 0;
    border-spacing: 0;
    border-collapse: separate;
    border-radius: 14px;
    overflow: hidden;
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    table-layout: auto;
}

table.ccc-table thead,
table.aaz-table thead,
table.tabla-acatlan thead {
    background: #CC1822;
}

table.ccc-table thead th,
table.aaz-table thead th,
table.tabla-acatlan thead th {
    padding: 13px 16px;
    color: #ffffff;
    background: #CC1822;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.35;
    font-weight: 600;
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
    vertical-align: middle;
}

table.ccc-table thead th:last-child,
table.aaz-table thead th:last-child,
table.tabla-acatlan thead th:last-child {
    border-right: 0;
}

/* Celdas del cuerpo */
table.ccc-table tbody td,
table.aaz-table tbody td,
table.tabla-acatlan tbody td {
    padding: 13px 16px;
    color: #333333;
    background: #ffffff;
    border: 0;
    border-right: 1px solid #eeeeee;
    border-bottom: 1px solid #e5e5e5;
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.45;
    font-weight: 400;
    text-align: left;
    vertical-align: middle;
    overflow-wrap: anywhere;
    word-break: normal;
    transition: background-color 0.18s ease-in-out;
}

table.ccc-table tbody td:last-child,
table.aaz-table tbody td:last-child,
table.tabla-acatlan tbody td:last-child {
    border-right: 0;
}

table.ccc-table tbody tr:last-child td,
table.aaz-table tbody tr:last-child td,
table.tabla-acatlan tbody tr:last-child td {
    border-bottom: 0;
}

table.ccc-table tbody tr:nth-child(even) td,
table.aaz-table tbody tr:nth-child(even) td,
table.tabla-acatlan tbody tr:nth-child(even) td {
    background: #f2f4f5;
}

table.ccc-table tbody tr:hover td,
table.aaz-table tbody tr:hover td,
table.tabla-acatlan tbody tr:hover td {
    background: #edf1f3;
}

/* Subtítulos de sección */
table.ccc-table td.ccc-subtitle,
table.ccc-table td.titulo-fila,
table.aaz-table td.titulo-fila,
table.tabla-acatlan td.titulo-fila {
    padding: 14px 16px !important;
    color: #111111 !important;
    background: #e9ecef !important;
    border-right: 0 !important;
    border-top: 2px solid #3b444b !important;
    border-bottom: 2px solid #3b444b !important;
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
    font-weight: 700 !important;
    text-align: center !important;
    vertical-align: middle !important;
}

/* Enlaces */
table.ccc-table a,
table.aaz-table a,
table.tabla-acatlan a {
    color: #1f2933;
    font-family: inherit;
    font-weight: 700;
    text-decoration: none;
    overflow-wrap: anywhere;
    transition: color 0.2s ease-in-out;
}

table.ccc-table a:hover,
table.aaz-table a:hover,
table.tabla-acatlan a:hover {
    color: #000000;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Paginación */
.ccc-pager,
.paginacion-acatlan,
.paginacion-zacualpan {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 26px 0 0;
    padding: 0;
    text-align: center;
}

.pagina-boton,
.ccc-pager button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 38px;
    margin: 0;
    padding: 8px 13px;
    color: #ffffff;
    background: #3b444b;
    border: 1px solid #3b444b;
    border-radius: 999px;
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, transform 0.15s ease-in-out;
}

.pagina-boton:hover,
.ccc-pager button:hover {
    color: #ffffff;
    background: #1f2933;
    border-color: #1f2933;
    transform: translateY(-2px);
}

.pagina-boton.activo,
.pagina-boton.active,
.ccc-pager button.active,
.ccc-pager button[aria-current="page"] {
    color: #ffffff;
    background: #111111;
    border-color: #111111;
}

/* Botón descargar información / exportar */
.btn-contenedor,
.aaz-export-wrap,
.acatlan-export-wrap {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
}

.btn-descargar,
.aaz-btn-descargar,
.ccc-download-excel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 18px;
    color: #ffffff;
    background: #3b444b;
    border: 1px solid #3b444b;
    border-radius: 999px;
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, transform 0.15s ease-in-out;
}

.btn-descargar:hover,
.aaz-btn-descargar:hover,
.ccc-download-excel:hover {
    color: #ffffff;
    background: #1f2933;
    border-color: #1f2933;
    text-decoration: none;
    transform: translateY(-2px);
}

/* Visor de documentos: ubicado DEBAJO de la tabla y a ANCHO COMPLETO de la tarjeta */
div.ccc-viewer {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-top: 24px;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 18px;
    background: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 14px;
    box-sizing: border-box !important;
    clear: both;
}

div.ccc-viewer[hidden],
div.ccc-viewer[style*="display: none"],
div.ccc-viewer[style*="display:none"] {
    display: none !important;
}

.ccc-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

div.ccc-viewer h4,
div.ccc-viewer .ccc-viewer-header h4 {
    margin: 0;
    color: #111111;
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 18px;
    line-height: 1.35;
    font-weight: 700;
}

.ccc-viewer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 16px;
    color: #ffffff;
    background: #3b444b;
    border: 1px solid #3b444b;
    border-radius: 999px;
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease-in-out, transform 0.15s ease-in-out;
}

.ccc-viewer-close:hover {
    color: #ffffff;
    background: #1f2933;
    border-color: #1f2933;
    transform: translateY(-1px);
}

.ccc-viewer-close:focus-visible {
    outline: 2px solid #CC1822;
    outline-offset: 2px;
}

.aaz-shortcode-table .ccc-viewer-frame,
.ccaf-shortcode-table .ccc-viewer-frame,
.ccc-viewer-frame {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: min(78vh, 850px) !important;
    min-height: 480px;
    background: #ffffff;
    border: 1px solid #dddddd !important;
    border-radius: 10px !important;
    box-sizing: border-box !important;
}

@supports (height: min(78dvh, 900px)) {
    .aaz-shortcode-table .ccc-viewer-frame,
    .ccaf-shortcode-table .ccc-viewer-frame,
    .ccc-viewer-frame {
        height: min(78dvh, 900px) !important;
    }
}

.ccc-viewer-actions {
    margin-top: 10px;
    margin-bottom: 8px;
    text-align: right;
}

.ccc-viewer-fallback-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #1f2933;
    text-decoration: underline;
    font-weight: 600;
}

.ccc-viewer-fallback-link:hover {
    color: #000000;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 767px) {
    div.aaz-tabla-wrap,
    div.tabla-zacualpan,
    div.ccc-table-wrap {
        padding: 20px 16px;
        margin: 16px 0;
        border-radius: 14px;
    }
    div.ccc-viewer {
        padding: 12px;
        margin-top: 18px;
    }
    .ccc-viewer-header {
        gap: 10px;
    }
    .ccc-viewer-close {
        width: 100%;
    }
    .ccc-header-row,
    .encabezado-tabla-acatlan,
    .aaz-encabezado-tabla {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .btn-contenedor,
    .aaz-export-wrap,
    .acatlan-export-wrap {
        justify-content: center;
    }
    .btn-descargar,
    .aaz-btn-descargar,
    .ccc-download-excel {
        width: 100%;
    }
    .ccc-search,
    .buscador-acatlan,
    .buscador-zacualpan {
        max-width: 100%;
    }
    table.ccc-table,
    table.aaz-table,
    table.tabla-acatlan {
        min-width: 620px;
    }
    .aaz-shortcode-table .ccc-viewer-frame,
    .ccaf-shortcode-table .ccc-viewer-frame,
    .ccc-viewer-frame {
        height: 65vh !important;
        min-height: 400px;
    }
}

@media (max-width: 479px) {
    div.aaz-tabla-wrap,
    div.tabla-zacualpan,
    div.ccc-table-wrap {
        padding: 16px 12px;
        border-radius: 12px;
    }
    div.ccc-viewer {
        padding: 10px;
        margin-top: 14px;
    }
    table.ccc-table,
    table.aaz-table,
    table.tabla-acatlan {
        min-width: 580px;
    }
    .aaz-shortcode-table .ccc-viewer-frame,
    .ccaf-shortcode-table .ccc-viewer-frame,
    .ccc-viewer-frame {
        height: 60vh !important;
        min-height: 340px;
    }
}
