﻿/* =========================================
   VARIABLES
========================================= */

:root {
    --ch_azul: #002050;
    --ch_azul2: #003070;
    --ch_azul_oscuro: #001530;
    --ch_gris: #F0F0F0;
    --ch_gris2: #C8C8D0;
    --ch_blanco: #FFFFFF;
}



/* =========================================
RESET
========================================= */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial,Helvetica,sans-serif;
    background: var(--ch_blanco);
}

/* =========================================
LAYOUT GLOBAL
========================================= */

html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}


/* =========================================
HEADER
========================================= */

.ch_header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 65px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    background: linear-gradient(90deg,var(--ch_azul),var(--ch_azul2));
    color: var(--ch_gris);
    z-index: 1000;
}



/* LOGO */

.ch_logo {
    display: flex;
    align-items: center;
}

    .ch_logo img {
        height: 40px;
    }



/* MENU SUPERIOR */

.ch_nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

    .ch_nav a {
        color: var(--ch_gris);
        text-decoration: none;
        padding: 6px 12px;
        border-radius: 4px;
    }

        .ch_nav a:hover {
            background: var(--ch_azul_oscuro);
        }

/* =========================================
FOOTER
========================================= */

.ch_footer {
    background: var(--ch_azul);
    color: var(--ch_gris);
    padding: 15px;
    text-align: center;
}
.ch_footer {
    text-align: center;
}

/* =========================================
CONTENEDOR PRINCIPAL
========================================= */

.ch_main {
    margin-top: 65px;
    flex: 1;
    display: flex;
    flex-direction: column;
}


/* =========================================
BOTONES
========================================= */

.ch_btn {
    background: var(--ch_azul);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

    .ch_btn:hover {
        background: var(--ch_azul2);
    }



/* =========================================
CARDS
========================================= */

.ch_card {
    border: 1px solid var(--ch_gris2);
    border-radius: 6px;
    background: white;
    overflow: hidden;
}

    .ch_card img {
        width: 100%;
        height: 160px;
        object-fit: cover;
    }

.ch_card_body {
    padding: 10px;
}



/* =========================================
PORTADA
========================================= */

.ch_portada_scroll {
    height: 100%;
    overflow: auto;
}


/* =========================
CARRUSEL PRO
========================= */

.ch_carousel {
    width: 100%;
    height: calc(100vh - 65px);
    position: relative;
    overflow: hidden;
    background: #000;
}


/* SLIDES */

.ch_slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity .8s ease;
}

    .ch_slide.activo {
        opacity: 1;
        z-index: 2;
    }


    /* IMAGEN */

    .ch_slide img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }


/* SOMBRA INFERIOR */

.ch_carousel::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(transparent,rgba(0,0,0,.6));
    z-index: 5;
}


/* TITULO */

.ch_slide_overlay {
    position: absolute;
    top: 5%;
    left: 8%;
    transform: translateY(-50%);
    color: white;
    z-index: 10;
    width: 100%;
}

.ch_slide_titulo {
    font-size: 48px;
    font-weight: bold;
    color:#000;
}


/* BOTON */
.ch_slide_btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    z-index: 20;
    width: 100%;
}

.ch_btn_slide {
    background: rgba(0,0,0,.85);
    color: white;
    padding: 12px 28px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 6px;
    letter-spacing: .5px;
    font-size: 15px;
    transition: .25s;
}

    .ch_btn_slide:hover {
        background: black;
    }
/* DOTS */

.ch_carousel_nav {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 20;
}

.ch_dot {
    width: 12px;
    height: 12px;
    background: white;
    opacity: .5;
    border-radius: 50%;
    cursor: pointer;
}

    .ch_dot.activo {
        opacity: 1;
    }


/* FLECHAS */

.ch_arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 30px;
    color: white;
    background: rgba(0,0,0,.4);
    padding: 10px;
    cursor: pointer;
    z-index: 30;
}

    .ch_arrow.left {
        left: 10px;
    }

    .ch_arrow.right {
        right: 10px;
    }

/* =========================================
GRID PORTADA
========================================= */

.ch_portada_grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    padding: 40px;
    background-color: var(--ch_gris2);
}



/* NOVEDADES */

.ch_novedades {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(250px,1fr));
    gap: 20px;
}



/* DESTACADOS */

.ch_destacados {
    display: flex;
    flex-direction: column;
    gap: 20px;
}



/* =========================================
SECCION INTERNA
========================================= */

.ch_seccion {
    width: 100%;
    max-width: 1200px;
    margin: auto;
    padding: 30px 20px;
}

    .ch_seccion h1 {
        text-align: center;
        margin-bottom: 30px;
    }

/* CONTENEDOR */

.ch_seccion_contenido {
    display: flex;
    gap: 40px;
    align-items: stretch;
}

/* TEXTO */

.ch_seccion_texto {
    flex: 1;
    font-size: 18px;
    line-height: 1.6;
    white-space: pre-line;
}

/* IMAGEN */

.ch_seccion_img_box {
    flex: 1;
    display: flex;
}

    .ch_seccion_img_box img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 10px;
    }

/* SOLO TEXTO */

.ch_solo_texto {
    justify-content: center;
}

    .ch_solo_texto .ch_seccion_texto {
        max-width: 800px;
        text-align: justify;
        white-space: pre-line;
    }

/* SOLO IMAGEN */

.ch_solo_imagen {
    justify-content: center;
}

    .ch_solo_imagen .ch_seccion_img_box {
        max-width: 800px;
    }

    .ch_solo_imagen img {
        height: auto;
    }

/* MOVIL */

@media (max-width:768px) {
    .ch_seccion_texto {
        white-space: pre-line;
    }
    .ch_seccion_contenido {
        flex-direction: column;
    }

    .ch_seccion_img_box {
        order: -1;
    }
}


/* =========================
ADMIN LAYOUT
========================= */

.ch_admin {
    display: flex;
    flex: 1;
    min-height: 0;
}



/* MENU LATERAL */

.ch_menu_admin {
    width: 220px;
    background: var(--ch_azul_oscuro);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

    .ch_menu_admin a {
        color: var(--ch_gris);
        text-decoration: none;
        padding: 12px 16px;
        display: block;
    }

        .ch_menu_admin a:hover {
            background: var(--ch_azul);
        }



/* CONTENIDO ADMIN */

.ch_admin_contenido {
    flex: 1;
    padding: 25px;
    overflow: auto;
}



/* BOTON MENU */

.ch_btn_menu {
    display: none;
    background: var(--ch_azul);
    color: white;
    border: none;
    padding: 8px 12px;
    margin-bottom: 15px;
    cursor: pointer;
}



/* MENU ADMIN */

.ch_menu_admin {
    width: 220px;
    background: var(--ch_azul_oscuro);
    display: flex;
    flex-direction: column;
}

    .ch_menu_admin a {
        color: var(--ch_gris);
        text-decoration: none;
        padding: 12px 16px;
        display: block;
    }

        .ch_menu_admin a:hover {
            background: var(--ch_azul);
        }



/* CONTENIDO ADMIN */

.ch_admin_contenido {
    flex: 1;
    padding: 25px;
}



/* =========================================
ACCIONES MODULO
========================================= */

.ch_acciones {
    display: flex;
    gap: 10px;
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--ch_gris2);
}

.ch_accion {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--ch_azul);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
}

.ch_accion_texto {
    white-space: nowrap;
}



/* =========================================
FORMULARIOS
========================================= */

.ch_form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 80%;
    margin: 0 auto; /* centra horizontalmente */
    align-items: center; /* centra verticalmente elementos */
    justify-content: center; /* centra el grid */
}

.ch_form_card {
    border: 1px solid var(--ch_gris2);
    border-radius: 6px;
    padding: 12px;
    background: white;
}

    .ch_form_card label {
        font-weight: bold;
        font-size: 13px;
        margin-bottom: 5px;
        display: block;
    }

.ch_input {
    width: 100%;
    padding: 7px;
    border: 1px solid var(--ch_gris2);
    border-radius: 4px;
}

.ch_form_botones {
    grid-column: 1/-1;
    margin-top: 15px;
}



/* =========================================
GRILLAS
========================================= */

.grtabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

    .grtabla th {
        background: var(--ch_azul);
        color: white;
        padding: 10px;
        text-align: left;
        border-bottom: 2px solid var(--ch_azul2);
    }

    .grtabla td {
        padding: 8px 10px;
        border-bottom: 1px solid var(--ch_gris2);
    }

    .grtabla tr:hover {
        background: #f5f8ff;
    }

.gr-total-row {
    background: #f0f4ff;
    font-weight: bold;
}



/* =========================================
TOAST
========================================= */

#ch_toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

/* TARJETA */

.ch_toast {
    min-width: 320px;
    max-width: 520px;
    background: #fff;
    color: #333;
    padding: 16px 20px;
    margin-top: 12px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,.25);
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: ch_toast_in .35s ease;
    pointer-events: auto;
}

    /* ICONOS */

    .ch_toast i {
        font-size: 18px;
    }

/* TIPOS */

.ch_ok {
    border-left: 6px solid #28a745;
    border-right: 3px solid #28a745;
}

.ch_error {
    border-left: 6px solid #dc3545;
    border-right: 3px solid #dc3545;
}

.ch_info {
    border-left: 6px solid #0d6efd;
    border-right: 3px solid #0d6efd;
}

.ch_warning {
    border-left: 6px solid #ffc107;
    border-right: 3px solid #ffc107;
}

/* ANIMACION */

@keyframes ch_toast_in {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/*LINK */

.ch_link {
    color: #0f3d63;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid #16a34a;
    padding: 2px 4px;
    transition: all .25s ease;
}

    .ch_link:hover {
        color: #16a34a;
        border-bottom: 2px solid #0f3d63;
        background: rgba(22,163,74,0.08);
        border-radius: 4px;
    }
.ch_link_btn {
    display: inline-block;
    background: #0f3d63;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    transition: .25s;
}

    .ch_link_btn:hover {
        background: #16a34a;
    }

/* =========================================
RESPONSIVE
========================================= */

@media(max-width:900px) {

    .ch_form {
        width: 100%;
    }

        .ch_header {
            height: 60px;
            padding: 0 15px;
        }

        .ch_logo img {
            height: 34px;
        }

        .ch_main {
            margin-top: 60px;
            height: calc(100vh - 60px);
        }

        .ch_portada_grid {
            grid-template-columns: 1fr;
        }

        .ch_slide_titulo {
            font-size: 28px;
        }

        .ch_form {
            grid-template-columns: 1fr;
        }

        .ch_accion_texto {
            display: none;
        }
    }
/* =========================================
RESPONSIVE ADMIN MENU
========================================= */

@media(max-width:900px) {

    /* ADMIN LAYOUT */

    .ch_admin {
        flex-direction: column;
    }



    /* BOTON MENU */

    .ch_btn_menu {
        display: block;
    }



    /* MENU LATERAL */

    .ch_menu_admin {
        position: fixed;
        top: 60px;
        left: -220px;
        width: 220px;
        height: calc(100vh - 60px);
        z-index: 2000;
        transition: left .3s;
    }



        /* MENU ABIERTO */

        .ch_menu_admin.activo {
            left: 0;
        }



    /* CONTENIDO */

    .ch_admin_contenido {
        padding: 15px;
        width: 100%;
    }
}
/* ========================= */
/* MODAL GLOBAL CHADMINSPORT */
/* ========================= */

/* FONDO */

#modalGlobal {
    position: fixed;
    color:var(--ch_azul_oscuro);
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

    /* CAJA */

    #modalGlobal .modal-box {
        background: #ffffff;
        width: 650px;
        max-width: 95%;
        height: auto;
        max-height: 90vh; /* evita que crezca más que la pantalla */
        border-radius: 8px;
        box-shadow: 0 12px 35px rgba(0,0,0,0.35);
        display: flex;
        flex-direction: column;
    }

    /* HEADER */

    #modalGlobal .modal-header {
        padding: 14px 18px;
        font-size: 18px;
        font-weight: 600;
        border-bottom: 1px solid #e5e5e5;
        display: flex;
        justify-content: space-between;
        background: #f4f6f9;
    }

/* BOTON CERRAR */

.modal-close {
    border: none;
    background: none;
    font-size: 22px;
    cursor: pointer;
}

/* CUERPO (IMPORTANTE) */

#modalGlobal .modal-body {
    padding: 20px;
    overflow-y: auto; /* SCROLL */
    flex: 1; /* ocupa espacio disponible */
    line-height: 1.6;
    white-space: pre-line;
}

/* FOOTER */

#modalGlobal .modal-footer {
    padding: 14px 18px;
    border-top: 1px solid #e5e5e5;
    text-align: right;
}

/* RESPONSIVE */

@media (max-width:768px) {

    #modalGlobal {
        align-items: flex-end;
    }

        #modalGlobal .modal-box {
            width: 100%;
            border-radius: 12px 12px 0 0;
            max-height: 85vh;
        }
}
.ch_msg_error {
    background: #fff4f4;
    border: 1px solid #ff4d4f;
    border-left: 5px solid #ff4d4f;
    padding: 12px 16px;
    border-radius: 6px;
    color: #8b0000;
    font-size: 14px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .ch_msg_error i {
        color: #ff4d4f;
        font-size: 16px;
    }

    /*=========================*/
    /*CHAT*/
    /*=========================*/

.ch_chat {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ch_chat_body {
    flex: 1;
    overflow: auto;
    padding: 10px;
}

.ch_msg {
    padding: 8px;
    margin: 5px 0;
    border-radius: 10px;
    max-width: 70%;
}

    .ch_msg.bot {
        background: #1e293b;
        color: #fff;
    }

    .ch_msg.user {
        background: #22c55e;
        color: #fff;
        margin-left: auto;
    }

.ch_chat_input {
    padding: 10px;
    border-top: 1px solid #ccc;
}

.ch_input {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
}

.ch_btn {
    margin-top: 5px;
    padding: 8px 12px;
}

/* =========================
   🔹 LAYOUT GENERAL
========================= */
.chat_layout {
    display: flex;
    gap: 20px;
    width: 100%;
    height: 100%;
}

/* COLUMNAS */
.chat_col {
    background: #0f172a;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

/* CHAT (IZQUIERDA) */
.chat_chat_col {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
}

/* GRID (DERECHA) */
.chat_grid_col {
    flex: 2;
    min-width: 0; /* 🔥 CLAVE */
    overflow: hidden; /* evita que empuje */
}

/* =========================
   🔹 CHAT UI
========================= */
.chat_box {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* HISTORIAL */
.chat_body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

/* MENSAJES */
.chat_msg {
    padding: 10px 14px;
    margin: 6px 0;
    border-radius: 12px;
    max-width: 75%;
    font-size: 14px;
}

/* BOT */
.chat_msg_bot {
    background: #1e293b;
    color: #fff;
}

/* USER */
.chat_msg_user {
    background: #22c55e;
    color: #fff;
    margin-left: auto;
}

/* INPUT */
.chat_input_box {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 10px;
}

/* INPUT */
.chat_input {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: none;
    outline: none;
    margin-top: 5px;
    background: #1e293b;
    color: #fff;
}

/* BOTON */
.chat_btn {
    margin-top: 8px;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: #22c55e;
    color: #fff;
    cursor: pointer;
    width: 100%;
    transition: 0.2s;
}

    .chat_btn:hover {
        background: #16a34a;
    }

/* =========================
   🔹 AUTOCOMPLETE
========================= */
.chat_suggest {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #1e293b;
    background: #020617;
    color: #fff;
    margin-top: 5px;
    max-height: 120px;
    overflow-y: auto;
}

    .chat_suggest option {
        padding: 8px;
    }

        .chat_suggest option:hover {
            background: #1e293b;
        }

/* =========================
   🔹 GRID / CARDS
========================= */
.chat_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

/* CARD */
.chat_card {
    background: #1e293b;
    border-radius: 12px;
    padding: 15px;
    color: #fff;
    transition: 0.2s;
}

    .chat_card:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    }

/* =========================
   🔹 RESPONSIVE
========================= */
@media (max-width: 768px) {

    .chat_layout {
        flex-direction: column;
    }

    .chat_chat_col {
        order: 1;
    }

    .chat_grid_col {
        order: 2;
    }
}
/* =========================================
   🔥 RENDER LATERAL NOVEDADES
========================================= */

/* CONTENEDOR GENERAL */
.trp_layout {
    display: flex;
    width: 100%;
}

/* PANEL (NOVEDADES) */
.trp_render_panel {
    background: #0f172a;
    /*color: #fff;*/
    color: inherit;
    padding: 20px;
    overflow-y: auto;
}

/* =========================
   DESKTOP
========================= */
@media (min-width: 1024px) {

    .trp_render_panel {
        position: fixed;
        top: 65px; /* 🔥 respeta tu header fijo */
        left: 0;
        width: 25%;
        height: calc(100vh - 65px);
        z-index: 900;
    }

    .trp_main_content {
        margin-left: 25%;
        width: 75%;
    }
}

/* =========================
   MOBILE
========================= */
@media (max-width: 1023px) {

    .trp_layout {
        display: block;
    }

    .trp_render_panel {
        position: relative;
        width: 100%;
        height: auto;
    }

    .trp_main_content {
        margin-left: 0;
        width: 100%;
    }
}
/* =========================
   🔥 MOBILE SWIPE CARDS
========================= */
@media (max-width: 768px) {

    .ch_carousel_mobile {
        height: auto;
        overflow: hidden;
        background: transparent;
        padding: 10px 0;
    }

        .ch_carousel_mobile .ch_slide {
            position: relative !important;
            opacity: 1 !important;
            width: 85%;
            min-width: 85%;
            height: 180px;
            border-radius: 12px;
            overflow: hidden;
            flex-shrink: 0;
            transition: transform .3s;
        }

    .ch_carousel_mobile {
        display: flex;
        gap: 12px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-left: 12px;
    }

        .ch_carousel_mobile .ch_slide {
            scroll-snap-align: start;
        }

            /* IMAGEN */
            .ch_carousel_mobile .ch_slide img {
                height: 100%;
                object-fit: cover;
            }

        /* OVERLAY SIMPLIFICADO */
        .ch_carousel_mobile .ch_slide_overlay {
            position: absolute;
            bottom: 0;
            top: auto;
            left: 0;
            transform: none;
            padding: 10px;
            background: linear-gradient(transparent, rgba(0,0,0,.8));
        }

        .ch_carousel_mobile .ch_slide_titulo {
            font-size: 16px;
            color: #fff;
        }

        /* BOTÓN */
        .ch_carousel_mobile .ch_slide_btn {
            position: static;
            transform: none;
            margin-top: 5px;
        }

    .ch_btn_slide {
        font-size: 12px;
        padding: 6px 12px;
    }

    /* 🔥 OCULTAR DOTS Y FLECHAS */
    .ch_carousel_nav,
    .ch_arrow {
        display: none !important;
    }
}