<style>
    /* Estilos de la galería (tus estilos originales mejorados) */
    .galeria {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 25px;
        padding: 30px;
        max-width: 1400px;
        margin: 0 auto;
    }
    
    .item-galeria {
        border: none;
        border-radius: 12px;
        padding: 15px;
        cursor: pointer;
        background: white;
        box-shadow: 0 5px 15px rgba(0,0,0,0.08);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    
    .item-galeria:hover {
        transform: translateY(-5px);
        box-shadow: 0 15px 30px rgba(0,0,0,0.15);
    }
    
    .item-galeria img {
        width: 100%;
        height: 220px;
        object-fit: cover;
        border-radius: 8px;
    }
    
    .resumen {
        margin-top: 12px;
        font-size: 14px;
        color: #555;
        line-height: 1.5;
        font-family: 'Segoe UI', Roboto, sans-serif;
    }
    
    
    /* ===== MODAL ELEGANTE ===== */

    /* ===== MODAL ELEGANTE V2 - CON LÍMITES INTELIGENTES ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: block;
    opacity: 1;
}

.modal-contenido {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1000px;
    
    /* ALTURA INTELIGENTE - MÁXIMO 75% DEL VIEWPORT */
    max-height: 75vh;
    height: auto;
    
    background: white;
    border-radius: 24px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: modalApertura 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalApertura {
    0% {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Botón de cerrar elegante */
.cerrar-modal {
    position: absolute;
    top: 20px;
    right: 25px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    color: #333;
    font-size: 24px;
    line-height: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    font-family: 'Arial', sans-serif;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cerrar-modal:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
    color: #000;
}

.cerrar-modal::before {
    content: "X";              /* ← Esto lo ven todos */
    content: "\2715" / "X";     /* ← Esto solo lo ven los modernos */
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
}

/* Contenedor interno con flexbox */
.modal-grid {
    display: flex;
    height: 100%;
    max-height: 75vh;
}

/* Lado izquierdo - Imagen (1/3 en desktop) */
.modal-imagen-container {
    flex: 1;
    max-width: 33.333%;
    background: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px;
}

.modal-imagen {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Lado derecho - Texto (2/3 en desktop) CON SCROLL */
.modal-texto-container {
    flex: 2;
    padding: 35px 30px;
    overflow-y: auto;
    max-height: 75vh;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f5f5f5;
}

/* Scroll personalizado */
.modal-texto-container::-webkit-scrollbar {
    width: 6px;
}

.modal-texto-container::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 10px;
}

.modal-texto-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.modal-texto-container::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Título elegante */
.modal-titulo {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 15px;
    font-family: 'Playfair Display', 'Times New Roman', serif;
    letter-spacing: -0.5px;
    line-height: 1.2;
    position: relative;
    padding-bottom: 15px;
}

.modal-titulo::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #0077be, #00a8e8);
    border-radius: 3px;
}

.modal-detalle {
    margin-top: 25px;
    font-size: 16px;
    line-height: 1.8;
    color: #333;
    font-family: 'Segoe UI', Roboto, sans-serif;
}

/* ===== RESPONSIVE MEJORADO ===== */
@media screen and (max-width: 1024px) {
    .modal-contenido {
        width: 95%;
        max-width: 900px;
    }
    
    .modal-titulo {
        font-size: 28px;
    }
}

@media screen and (max-width: 768px) {
    .modal-contenido {
        max-height: 85vh;
    }
    
    .modal-grid {
        flex-direction: column;
        max-height: 85vh;
    }
    
    .modal-imagen-container {
        max-width: 100%;
        padding: 20px;
        max-height: 30vh;
    }
    
    .modal-imagen {
        max-height: 25vh;
        width: auto;
        max-width: 100%;
    }
    
    .modal-texto-container {
        padding: 25px 20px;
        max-height: 55vh;
    }
    
    .modal-titulo {
        font-size: 24px;
        text-align: center;
    }
    
    .modal-titulo::after {
        left: 50%;
        transform: translateX(-50%);
        width: 80px;
    }
    
    .modal-detalle {
        text-align: justify;
        font-size: 15px;
    }
    
    .cerrar-modal {
        top: 15px;
        right: 15px;
        background: rgba(255, 255, 255, 0.9);
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
}

@media screen and (max-width: 480px) {
    .modal-contenido {
        max-height: 90vh;
    }
    
    .modal-imagen-container {
        max-height: 25vh;
        padding: 15px;
    }
    
    .modal-imagen {
        max-height: 20vh;
    }
    
    .modal-texto-container {
        padding: 20px 15px;
        max-height: 65vh;
    }
    
    .modal-titulo {
        font-size: 22px;
    }
    
    .modal-detalle {
        font-size: 14px;
        line-height: 1.6;
    }
}

@media screen and (min-width: 1600px) {
    .modal-contenido {
        max-width: 1200px;
        max-height: 70vh;
    }
    
    .modal-titulo {
        font-size: 38px;
    }
    
    .modal-detalle {
        font-size: 18px;
    }
    
    .modal-texto-container {
        max-height: 70vh;
    }
}


/************** FIN MODAL **************/

/**** solo para css de pagina conergy ***/
/* Estilo base */
.item-galeria,
.single-project-style-three {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}

/* Efecto hover */
.item-galeria:hover,
.single-project-style-three:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,119,190,0.15);
}

/* La imagen también reacciona */
.item-galeria:hover img,
.single-project-style-three:hover img {
    transform: scale(1.05);
    transition: transform 0.5s ease;
}

/* Texto de resumen cambia de color */
.item-galeria:hover .resumen,
.single-project-style-three:hover .resumen {
    color: #0077be;
}

/********** CELULARES ************/

/* ===== AJUSTES SOLO PARA MÓVIL ===== */
/* ===== MÓVIL: AJUSTES FINOS ===== */

@media screen and (max-width: 768px) {
    
    /* Contenedor principal */
    .galeria {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        padding: 15px !important;
    }
    
    /* Columnas de Conergy */
    .col-lg-6 {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 25px !important;
    }
    
    /* Items de galería - ambas clases */
    .item-galeria,
    .single-project-style-three {
        display: flex !important;
        flex-direction: column !important;
        padding: 10px !important;
        height: auto !important;
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 8px !important;  /* Esquinas más pequeñas */
    }
    
    /* Imágenes - ambas versiones */
    .item-galeria img,
    .single-project-style-three .thumbnail img {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        max-height: 260px !important;
        object-fit: cover !important;
        border-radius: 6px !important;  /* Esquinas más pequeñas */
        margin-bottom: 10px !important;
    }
    
    /* Contenedor del texto en Conergy */
    .single-project-style-three .inner-content {
        display: block !important;
        padding: 2px !important;
        margin-left: 0px;
        text-align: left !important;
        border-radius: 15px !important; 
        background-color: rgba(255, 0, 0, 0.50) !important; /* 0.5 es 50% de transparencia */
    }
    
    /* Título en Conergy */
    .single-project-style-three .inner-content .title {
        font-size: 17px !important;
        font-weight: bold !important;
        margin: 0 0 6px 0 !important;
        line-height: 1.2 !important;
        text-align: left !important;
        padding-left: 0 !important;
    }
    
    /* Resumen en Conergy (span) */
    .single-project-style-three .inner-content span {
        display: block !important;
        font-size: 14px !important;
        line-height: 1.3 !important;        /* Reducido 30% */
        color: #555 !important;
        text-align: left !important;
        padding-left: 0 !important;
        margin-left: 0 !important;
        word-break: break-word !important;
        hyphens: auto !important;
    }
    
    /* Resumen en tu versión futura */
    .item-galeria .resumen {
        display: block !important;
        margin-top: 0 !important;
        padding: 0 !important;
        font-size: 14px !important;
        line-height: 1.3 !important;        /* Reducido 30% */
        color: #555 !important;
        text-align: left !important;
        word-break: break-word !important;
        hyphens: auto !important;
    }
    
    /* Links de Conergy */
    .single-project-style-three a {
        text-decoration: none !important;
        color: inherit !important;
    }
    
    /* Thumbnail link */
    .single-project-style-three .thumbnail {
        display: block !important;
        margin-bottom: 0 !important;
    }
}

/* ===== MÓVILES MUY PEQUEÑOS ===== */
@media screen and (max-width: 480px) {
    
    /* Imágenes - ambas */
    .item-galeria img,
    .single-project-style-three .thumbnail img {
        max-height: 220px !important;
    }
    
    /* Títulos */
    .single-project-style-three .inner-content .title {
        font-size: 16px !important;
        margin-bottom: 4px !important;
    }
    
    /* Resúmenes - ambas versiones */
    .item-galeria .resumen,
    .single-project-style-three .inner-content span {
        font-size: 13px !important;
        line-height: 1.25 !important;       /* Aún más compacto */
    }
}
</style>