/* ************************************************************************ */
/* ------------------------- CUSTOM FONTS -------------------------- */
/* ************************************************************************ */

@import url('https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,100..900;1,100..900&display=swap');

* {
    font-family: "Raleway", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
}

/* ************************************************************************ */
/* ------------------------- CUSTOM THEME -------------------------- */
/* ************************************************************************ */

:root {
    --cruza-black: #192227;
    --cruza-accent: #6EDEF2;
    --cruza-gray: #E0E0E0;
    --cruza-gray-light: #f6f6f6;
}

/* ************************************************************************ */
/* ------------------------- HEADER -------------------------- */
/* ************************************************************************ */

#ast-hf-menu-1{
    font-weight: bold;
    color: var(--cruza-black);
}

#ast-hf-menu-1 a[aria-current="page"], #ast-hf-menu-1 a:hover{
    text-decoration: underline;
    color: var(--cruza-black);
}

.logout-item a {
    line-height: 0!important;
    padding: 15px 20px;
    background-color: var(--cruza-black);
    color: white!important;
}

.logout-button:hover{
    color: white!important;
    text-decoration: underline;
}

.logout-button img{
    height: 30px;
    margin-right: 5px;
}

/* Acceso al manual de usuario. Enlace discreto para no competir con el logout,
   separado de el porque el boton de logout lleva fondo y recuadro propios. */
.manual-item {
    margin-right: 20px;
}

.manual-item a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--cruza-black);
}

.manual-item a:hover {
    text-decoration: underline;
}

.manual-item .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}



/* ************************************************************************ */
/* ------------------------- PÁGINAS DE LISTADOS -------------------------- */
/* ************************************************************************ */

.listado-container {
    width: 100%;
    padding: 0 0 1.5rem 0;
}

.listado-tabla-container {
    width: 100%;
    overflow-x: auto; /* Hace que la tabla sea responsive en móviles */
    margin: 1rem 0;
    padding: 0 40px;
}

.listado-acciones {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0;
    padding: 20px;
    #background-color: #f8f9fa;
    border-radius: 8px;
}

.listado-buscador {
    margin: 1.5rem 0;
    max-width: 500px;
    width: 100%;
}

.listado-buscador form {
    display: flex; /* Activa Flexbox */
    align-items: center; /* Alinea verticalmente */
    gap: 10px; /* Espacio entre el input y el botón */
}

.listado-buscador input {
    flex: 1; /* Permite que el input ocupe todo el espacio disponible */
    padding: 8px; /* Espaciado interno para mejor apariencia */
}

.listado-buscador button {
    padding: 8px 15px; /* Ajusta el tamaño del botón */
    white-space: nowrap; /* Evita que el texto del botón se divida en varias líneas */
}

.header-listados{
    position: relative;
    display: flex;
    background: var(--cruza-black);
    padding: 30px 40px;
    margin: 0;
    justify-content: space-between;
    align-items: center;
}

.header-listados-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-listados-content h1 {
    color: white;
}

.header-listados-content h1 span {
    color: var(--cruza-accent);
}

.header-listados-content .menu-custom-header {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    list-style: none;
    margin-bottom: 0px;
    margin-left: 0px;
}

.header-listados-content .menu-custom-header li a {
    color: white;
}

.header-listados-content .menu-custom-header li.current_page_item a {
    color: white;
    font-weight: bold;
    text-decoration: underline;
    text-underline-offset: 5px;
}

.subheader-listados, .listado-tabla-container, .header-listados-content {
    width: 100%;
    max-width: 1440px;
    margin: auto;
}

.subheader-listados {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding: 20px 40px;
}

.subheader-listados .buscador-container {
    display: flex;
    align-items: center;
    border-top: 1px solid var(--cruza-black);
    border-bottom: 1px solid var(--cruza-black);
    padding: 5px;
    width: 100%;
}

.subheader-listados .buscador-container input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px;
    font-size: 16px;
    background: transparent;
    box-shadow: none;
}

.subheader-listados .buscador-container .search-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    box-shadow: none;
}

.subheader-listados .buscador-container .search-button .dashicons {
    font-size: 24px;
    color: var(--cruza-black);
    vertical-align: middle;
}

.subheader-listados .buscador-container .search-button:hover .dashicons {
    color: var(--cruza-black)
}

.subheader-listados .listado-acciones a.button {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--cruza-black);
    padding: 15px 20px;
}

.subheader-listados .listado-acciones a.button span.dashicons {
    color: var(--cruza-accent);
    line-height: 1;
    vertical-align: middle;
}

.subheader-listados .listado-acciones button.button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
}

.subheader-listados .listado-acciones button.button span.dashicons {
    line-height: 1;
    vertical-align: middle;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

#listado-tabla {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    /*margin: 1em 0;*/
}

#listado-tabla th {
    background-color: var(--cruza-black);
    color: white;
    padding: 12px;
    text-align: center;
    border: 1px solid var(--cruza-gray);
    width: auto;
}

#listado-tabla th a, #listado-tabla th a::after, #listado-tabla th {
    color: white!important;
}

#listado-tabla tbody a{
    color: var(--cruza-black);
}

#listado-tabla th a:hover, #listado-tabla tbody a:hover {
    text-decoration: underline;
    text-underline-offset: 5px;
}

#listado-tabla th::after {
    content: '⇅'; /* Icono de ordenación por defecto */
    margin-left: 5px;
    opacity: 0.3;
    font-size: 14px;
}

#listado-tabla th.orden-asc::after {
    content: '▲'; /* Icono para orden ASC */
    opacity: 1;
}

#listado-tabla th.orden-desc::after {
    content: '▼'; /* Icono para orden DESC */
    opacity: 1;
}

#listado-tabla td {
    padding: 12px;
    border: 1px solid #ddd;
    width: auto;
}

#listado-tabla tbody {
    text-align: center;
    border: none;
}

#listado-tabla tbody button {
    background: none;
    color: var(--cruza-black);
    box-shadow: none;
}

#listado-tabla tbody button span.dashicons {
    font-weight: 300;
    font-size: 32px;
}

#listado-tabla tbody button span.dashicons:hover {
    color: var(--cruza-accent);
}

table#listado-tabla, #listado-tabla tbody td {
    border: none;
}

#listado-tabla tbody tr + tr td {
    border-top: 1px solid #d0d0d0;
}

.paginacion-link {
    margin: 5px;
    cursor: pointer;
    text-decoration: none;
}

.listado-paginacion {
    text-align: center;
    margin-top: 20px;
}

.listado-paginacion .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    margin: 0 3px;
    border: 1px solid #d0d0d0;
    border-radius: 5px;
    background-color: #ffffff;
    color: #192227;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.listado-paginacion .page-numbers:hover {
    background-color: #f0f0f0;
    border-color: #999;
}

.listado-paginacion .page-numbers.current {
    background-color: #192227;
    border-color: #192227;
    color: #ffffff;
    font-weight: 700;
    cursor: default;
}

.listado-paginacion .page-numbers.dots {
    border: none;
    background: none;
    cursor: default;
    color: #999;
}

.listado-paginacion .page-numbers.disabled {
    background-color: #f5f5f5;
    border-color: #e0e0e0;
    color: #bbb;
    cursor: not-allowed;
    pointer-events: none;
}

.listado-usuarios-botones-container {
    display: flex;
    gap: 10px;
}

/* En móviles permitir scroll horizontal */
@media screen and (max-width: 768px) {
    .listado-tabla-container {
        overflow-x: auto;
        padding: 0 15px;
    }

    #listado-tabla {
        table-layout: auto;
    }

    #listado-tabla th,
    #listado-tabla td {
        white-space: nowrap;
    }

    .header-listados {
        padding: 20px;
        flex-direction: column;
        gap: 15px;
    }

    .header-listados-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .header-listados-content .menu-custom-header {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .subheader-listados {
        flex-direction: column;
        padding: 15px 20px;
        gap: 15px;
    }

    .subheader-listados .listado-acciones {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .listado-acciones {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .listado-acciones-izquierda,
    .listado-acciones-derecha {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .eb-filtro-notificacion,
    .eb-filtro-tipo,
    .eb-filtro-estado {
        width: 100%;
    }

    .eb-select-notificacion,
    .eb-select-tipo,
    .eb-select-estado {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .subheader-listados .listado-buscador {
        max-width: 100%;
        flex: 1 1 100%;
    }

    .subheader-listados .listado-acciones {
        margin-left: 0;
        width: 100%;
    }

    .listado-usuarios-botones-container {
        flex-direction: column;
        width: 100%;
    }

    .listado-usuarios-botones-container a.button,
    .subheader-listados .listado-acciones a.button {
        width: 100%;
        justify-content: center;
        box-sizing: border-box;
    }

    .listado-paginacion .page-numbers {
        min-width: 32px;
        height: 32px;
        font-size: 13px;
        margin: 0 2px;
    }
}


/* ************************************************************************ */
/* ------------------------- PÁGINAS DE NUEVO CPT ------------------------- */
/* ************************************************************************ */
.nuevo-container {
    width: 100%;
    padding: 0 0 1.5rem 0;
    max-width: 1440px;
    margin: auto;
}

/* ************************************************************************ */
/* ------------------------ PÁGINAS DE EDITAR CPT ------------------------- */
/* ************************************************************************ */
.edicion-container {
    width: 100%;
    padding: 0 0 1.5rem 0;
}

.edicion-columnas {
    display: flex;
    gap: 20px;
    margin: 1rem 0;
}

.columna-izquierda {
    flex: 4; /* 80% del ancho */
}

.columna-derecha {
    flex: 1; /* 20% del ancho */
    border-left: 1px solid #ccd0d4 ;
    padding: 0 0 0 20px;
}

/*En moviles apila las columnas */
@media (max-width: 768px) {
    .edicion-columnas {
        flex-direction: column; /* Apilar columnas */
    }

    .columna-izquierda,
    .columna-derecha {
        flex: none;
        width: 100%; /* Cada columna ocupa el 100% */
    }
}


/* ************************************************************************ */
/* ------------------------ FORMULARIOS DE ACF ---------------------------- */
/* ************************************************************************ */
.acf-form-submit {
    margin-top: 20px;
}

.acf-fields>.acf-tab-wrap .acf-tab-group li.active a {
    background: var(--ast-global-color-0) !important;
}

.ast-single-post .entry-content a {
    text-decoration: none !important;
}

.acf-fields>.acf-tab-wrap {
    background: #fff!important;
}

.acf-tab-wrap {
    overflow: hidden !important;
}


/* ************************************************************************ */
/* -------------------------------- LOGIN --------------------------------- */
/* ************************************************************************ */

.login-main-container{
    display: flex;
    flex-wrap: wrap;
    background-color: var(--cruza-gray-light);
    justify-content: space-around;
    width: 100vw;
    padding: 200px;
    gap: 20px;
}

.login-intro{
    max-width: 550px;
}

.login-intro p{
    margin-top: 10px;
    margin-bottom: 0;
}

.login-main-container form{
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 500px;
    width: 100%;
}

.login-main-container form input[type='submit']{
    background-color: var(--cruza-black);
    font-size: 15px;
    padding: 12px 25px;
}

.login-main-container form input{
    border: none;
}

.login-forgot-password {
    margin-top: -15px;
    text-align: right;
}

.login-forgot-password a {
    color: var(--cruza-black);
    font-size: 14px;
    text-decoration: underline;
}

.login-forgot-password a:hover {
    color: var(--cruza-black);
    opacity: 0.8;
}

.form-title{
    display: flex;
    border-bottom: 2px solid var(--cruza-black);
    gap: 50px;
    margin-bottom: 30px;
    justify-content: space-between;
}

.form-title p:first-child{
    font-weight: bold;
}

.form-title p {
    margin-bottom: 10px;
}

body.home #page .site-content {
    background-color: var(--cruza-gray-light);
}

@media (max-width: 1024px) {
    .login-main-container {
        padding: 60px;
    }
}

@media (max-width: 768px) {
    .login-main-container{
        padding: 20px;
        width: 100%;
        gap: 20px;
    }
    .login-main-container div{
        width: 100%;
    }
    .login-main-container form{
        width: 100%;
    }
}

/* ************************************************************************ */
/* -------------------------- FORMULARIOS NUEVOS--------------------------- */
/* ************************************************************************ */

.nuevo-container{
    padding: 40px;
}
.nuevo-container .new-title {
    font-size: 28px;
    text-transform: none!important;
    text-decoration: none!important;
    margin-bottom: 20px;
}

.nuevo-container #acf-form .acf-tab-wrap a{
    background-color: var(--cruza-gray-light);
    padding: 0 40px;
    border: none;
}

.nuevo-container #acf-form .acf-tab-wrap li{
    margin: 0;
    padding: 10px;
    background-color: var(--cruza-gray-light);
}

.nuevo-container #acf-form .acf-tab-wrap ul li{
    border-right: 1px solid var(--cruza-black);
}

.nuevo-container #acf-form .acf-tab-wrap ul li:last-child{
    border-right: none;
}

.nuevo-container #acf-form .acf-tab-wrap li[class='active'], .nuevo-container #acf-form .acf-tab-wrap li[class='active'] a{
    background-color: var(--cruza-black)!important;
    color: white;
}
.nuevo-container #acf-form .acf-tab-wrap ul {
    border-bottom: 2px solid var(--cruza-black);
    margin: 10px 0 0 0;
    padding: 0;
}

.nuevo-container .acf-tab-wrap {
    width: 100%;
}

.nuevo-container .acf-form .acf-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.nuevo-container .acf-form .acf-field {
    width: calc(50% - 10px);
}
.acf-field.acf-field-repeater.acf-field-67c8a15714adc,
.acf-field.acf-field-relationship.acf-field-67c959119c987,
.acf-field.acf-field-relationship.acf-field-67c9507afdcad{
    width: 100%;
}

.nuevo-container .acf-form .acf-input-wrap input {
    width: 100%;
    box-sizing: border-box;
}

.nuevo-container .acf-form-submit{
    border-top: 2px solid var(--cruza-black);
    padding-top: 50px;
}

.nuevo-container .acf-button{
    background-color: var(--cruza-black)!important;
}
.nuevo-container .acf-button:hover{
    background-color: var(--cruza-black)!important;
    text-decoration: underline;
}
.nuevo-container .acf-field{
    border:none!important;
}
.nuevo-container .acf-field:nth-child(odd){
    padding-left: 50px!important;
    padding-right: 0;
    padding-top: 0!important;
    padding-bottom: 0!important;
}
.nuevo-container .acf-field:nth-child(even){
    padding-right: 50px!important;
    padding-left: 0;
    padding-top: 0!important;
    padding-bottom: 0!important;
}

@media (max-width: 768px) {
    .nuevo-container{
        padding: 50px 20px;
    }
    .nuevo-container .acf-form .acf-field {
        width: 100%;
        padding: 0!important;
    }

}

/* ************************************************************************ */
/* -------------------- SIGNUP/NUEVO USUARIO TEMPLATE --------------------- */
/* ************************************************************************ */

.signup-checkbox {
    display: flex;
    align-items: center;
    justify-content: start;
    gap: 10px;
}

.signup-result-msg {
    color: white;
    margin-top: 10px;
    max-width: 550px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
}

.signup-result-successfully {
    background: green;
}

.signup-result-error {
    background: red;
}

/* ************************************************************************ */
/* ---------------------------- EDITAR USUARIO ---------------------------- */
/* ************************************************************************ */

.not-found-user-button {
    text-decoration: none; background: #202d33; padding: 6px 12px; color: white;
}

/* ************************************************************************ */
/* -------------------- EMAIL BIENVENIDA COMUNIDADES ---------------------- */
/* ************************************************************************ */

#listado-tabla .eb-email-cell {
    word-break: break-all;
    max-width: 220px;
    line-height: 1.6;
    text-align: left;
}

.eb-filtro-notificacion,
.eb-filtro-tipo,
.eb-filtro-estado {
    display: flex;
    align-items: center;
}

.eb-select-notificacion,
.eb-select-tipo,
.eb-select-estado {
    padding: 8px 12px;
    border: 1px solid var(--cruza-black);
    border-radius: 0;
    background: white;
    font-size: 14px;
    cursor: pointer;
    height: 42px;
}

.eb-filtro-notificacion {
    flex: 1 1 auto;
}

.eb-select-tipo,
.eb-select-estado {
    min-width: 150px;
}

/* Buscador en la barra de filtros de envío */
.subheader-listados .listado-buscador {
    flex: 1 1 260px;
    min-width: 220px;
    max-width: 380px;
    margin: 0;
}

/* El botón de acción se empuja al final de la fila */
.subheader-listados .listado-acciones {
    margin-left: auto;
}

.badge-estado {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-enviado {
    background-color: #d4edda;
    color: #155724;
}

.badge-no-enviado {
    background-color: #e9ecef;
    color: #6c757d;
}

@keyframes eb-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.eb-spin {
    display: inline-block;
    animation: eb-spin 1s linear infinite;
}

/* Banner notificación activa */
.en-notif-activa-banner {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 16px;
    background-color: #192227;
    color: #ffffff;
}

.en-notif-activa-label {
    font-size: 11px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    opacity: 0.7;
}

.en-notif-activa-nombre {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 600;
}

.en-notif-activa-nombre .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Wrapper tabla con spinner */
#en-tabla-wrapper {
    position: relative;
}

#en-tabla-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

#en-tabla-spinner .dashicons {
    font-size: 36px;
    width: 36px;
    height: 36px;
    color: #192227;
    animation: eb-spin 0.8s linear infinite;
}

@keyframes en-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}


/* ************************************************************************ */
/* -------------------- ACCIONES EN TABLAS (GENÉRICO) -------------------- */
/* ************************************************************************ */

.tabla-acciones {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.tabla-acciones a,
.tabla-acciones button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    margin: 0;
    background: none;
    border: none;
    box-shadow: none;
    line-height: 1;
    vertical-align: middle;
}

/* ************************************************************************ */
/* ----------------------- NOTIFICACIONES EMAIL --------------------------- */
/* ************************************************************************ */

.notificacion-form-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px;
}

.notificacion-campo {
    margin-bottom: 24px;
}

.notificacion-campo label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--cruza-black);
}

.notificacion-required {
    color: #c0392b;
}

.notificacion-campo input[type="text"],
.notificacion-campo input[type="email"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 15px;
    box-sizing: border-box;
    background: #fff;
}

.notificacion-campo input[type="text"]:focus,
.notificacion-campo input[type="email"]:focus {
    border-color: var(--cruza-black);
    outline: none;
    box-shadow: 0 0 0 2px rgba(25, 34, 39, 0.1);
}

.notificacion-campo-estrecho input[type="email"],
.notificacion-campo-estrecho select {
    max-width: 400px;
}

.notificacion-campo select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 15px;
    box-sizing: border-box;
    background: #fff;
    cursor: pointer;
}

.notificacion-campo select:focus {
    border-color: var(--cruza-black);
    outline: none;
    box-shadow: 0 0 0 2px rgba(25, 34, 39, 0.1);
}

.notificacion-ayuda {
    margin-top: 6px;
    font-size: 13px;
    color: #666;
}

.notificacion-ayuda code {
    background: var(--cruza-gray-light);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 12px;
    color: var(--cruza-black);
}

.notificacion-form-acciones {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--cruza-gray);
}

.notificacion-form-acciones .button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.notificacion-form-acciones .button-primary {
    background: var(--cruza-black);
    border-color: var(--cruza-black);
    color: #fff;
}

.notificacion-form-acciones .button-primary:hover {
    background: #2c3e50;
    border-color: #2c3e50;
    color: #fff;
}

.notificacion-form-acciones .button-secondary {
    background: #fff;
    border-color: #ccc;
    color: var(--cruza-black);
}

.notificacion-alert {
    margin: 0 40px 20px;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
}

.notificacion-alert-exito {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.notificacion-alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@media (max-width: 768px) {
    .notificacion-form-container {
        padding: 20px;
    }

    .notificacion-campo-estrecho input[type="email"] {
        max-width: 100%;
    }

    .notificacion-form-acciones {
        flex-direction: column;
        align-items: stretch;
    }

    .notificacion-form-acciones .button {
        justify-content: center;
        width: 100%;
        box-sizing: border-box;
    }
}

