/* ========================================================== */
/* CSS PROYECTOS ACORDEÓN Y LIGHTBOX - VILANOVA PINTURAS      */
/* Manteniendo la paleta oscura y neones/glowing de la marca   */
/* Versión Mejorada: Más llamativa, interactiva y pulida       */
/* ========================================================== */

:root {
    --ig: #E1306C;
    --fb: #4267B2;
    --wa: #25D366;
    --tg: #0088cc;
    
    /* Paleta Principal renovada */
    --green-main: #145e28;
    --green-hover: #1b8238;
    --green-light: #e8f5ec;
    --yellow-accent: #f0e41f;
    --yellow-dark: #ccb800;
    --slate-dark: #1b2624;
    --slate-gray: #718084;
    --bg-light: #f7faf8;
    --white: #ffffff;
    --text-main: #232d29;
    --shadow-soft: 0 10px 30px rgba(20, 94, 40, 0.08);
    --shadow-hover: 0 20px 40px rgba(20, 94, 40, 0.25);
    --radius-lg: 16px;
    --radius-pill: 50px;
}

/* --- SOLUCIÓN DE IMÁGENES PRINCIPALES (NO ESTIRADAS) --- */
.image-frame-fixed {
    position: relative;
    width: 100%;
    height: 420px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.12);
    background-color: var(--slate-dark);
}

.image-frame-fixed img,
.card-img-wrapper img,
.frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-img-wrapper {
    width: 100%;
    height: 220px;
    overflow: hidden;
    border-radius: 12px;
    background-color: var(--slate-dark);
}

.movie-card:hover .card-img-wrapper img {
    transform: scale(1.08);
}

/* --- BARRA DE FILTROS INTERACTIVOS --- */
.proyectos-filter-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 35px;
    padding: 0 15px;
}

.filter-btn {
    background: rgba(27, 38, 36, 0.05);
    border: 2px solid transparent;
    color: var(--slate-dark);
    padding: 10px 22px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.filter-btn:hover {
    background: var(--green-light);
    color: var(--green-main);
    transform: translateY(-2px);
    border-color: rgba(20, 94, 40, 0.2);
}

.filter-btn.active {
    background: var(--green-main);
    color: var(--white);
    box-shadow: 0 6px 20px rgba(20, 94, 40, 0.3);
    border-color: var(--green-main);
}

/* --- GRID DE PROYECTOS --- */
.proyectos-section {
    padding: 60px 20px;
    background: linear-gradient(135deg, #f7faf8 0%, #edf4ef 100%);
}

.proyectos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 30px;
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px 0;
}

.proyectos-group {
    background: var(--white);
    border-radius: 24px;
    padding: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(20, 94, 40, 0.08);
    position: relative;
    overflow: hidden;
}

.proyectos-group:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-6px);
    border-color: rgba(20, 94, 40, 0.25);
}

.proyectos-group.active {
    border-color: var(--green-main);
    grid-column: 1 / -1;
    background: linear-gradient(145deg, #ffffff 0%, #f4f9f5 100%);
    box-shadow: 0 25px 60px rgba(20, 94, 40, 0.18);
}

@media (min-width: 768px) {
    .proyectos-group.span-full {
        grid-column: 1 / -1;
    }
}

/* --- TARJETA PRINCIPAL Y FRAME --- */
.main-proyectos-trigger {
    cursor: pointer;
    position: relative;
    border-radius: 18px;
    overflow: hidden;
}

.frame {
    position: relative;
    width: 420px;
    height: 320px;
    background-color: var(--slate-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    transition: all 0.5s ease;
}

.frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-proyectos-trigger:hover .frame img {
    transform: scale(1.08);
}

/* --- OVERLAY LLAMATIVO --- */
.proyectos-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 420px;
    
    padding: 25px 20px 15px 20px;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.6) 60%, transparent 100%);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    transition: padding 0.3s ease;
}

.proyectos-overlay h4 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.proyectos-overlay p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--yellow-accent);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.main-proyectos-trigger .toggle-icon {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--yellow-accent);
    background: rgba(255, 255, 255, 0.1);
    padding: 8px;
    border-radius: 50%;
}

.proyectos-group.active .toggle-icon {
    transform: rotate(180deg);
    background: var(--green-main);
    color: var(--white);
}

/* --- ACORDEÓN DESPLEGABLE --- */
.proyectos-accordion {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.7s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease, padding 0.5s ease;
    opacity: 0;
    padding: 0 10px;
}

.proyectos-group.active .proyectos-accordion {
    max-height: 900px;
    opacity: 1;
    padding: 25px 10px 10px 10px;
}

.accordion-track {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
}

.accordion-item {
    cursor: pointer;
    text-align: center;
    border-radius: 16px;
    padding: 12px;
    background: var(--white);
    border: 2px solid rgba(20, 94, 40, 0.1);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.04);
}

.accordion-item:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--green-main);
    box-shadow: 0 12px 30px rgba(20, 94, 40, 0.15);
    background: var(--green-light);
}

.accordion-item .frame {
    width: 100%;
    height: 140px;
    border-radius: 12px;
    margin-bottom: 10px;
}

.accordion-item .frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
}

.accordion-item:hover .frame img {
    transform: scale(1.1);
}

.accordion-item span {
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 600;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- LIGHTBOX MODAL --- */
.proyectos-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 19, 17, 0.95);
    backdrop-filter: blur(16px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.proyectos-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 85%;
    max-height: 85vh;
    text-align: center;
    animation: zoomInLight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes zoomInLight {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lightbox-content img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
    border: 3px solid rgba(240, 228, 31, 0.4);
    object-fit: contain;
}

.lightbox-content p {
    color: var(--white);
    margin-top: 20px;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: var(--green-main);
    color: var(--yellow-accent);
    transform: rotate(90deg);
}

/* --- ANIMACIÓN ENTRADA GRUPOS --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.proyectos-group {
    animation: fadeInUp 0.6s ease both;
}

.proyectos-group:nth-child(1) { animation-delay: 0.1s; }
.proyectos-group:nth-child(2) { animation-delay: 0.2s; }
.proyectos-group:nth-child(3) { animation-delay: 0.3s; }
.proyectos-group:nth-child(4) { animation-delay: 0.4s; }
.proyectos-group:nth-child(5) { animation-delay: 0.5s; }
.proyectos-group:nth-child(6) { animation-delay: 0.6s; }
