/* ==========================================================
   PORTAFOLIO MEJORADO CON EFECTOS MODERNOS Y RESPONSIVE
   ========================================================== */
:root {
    --primary-green: #133021;
    --accent-yellow: #d4af37;
    --accent-green-glow: rgba(20, 94, 40, 0.25);
    --bg-light-v2: #f4f7f5;
    --card-bg: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --radius-xl: 20px;
    --radius-full: 50px;
    --transition-smooth: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}


.portfolio-section {
    padding: 100px 5%;
    background: linear-gradient(180deg, var(--bg-light) 0%, #edf2ef 100%);
}

.portfolio-grid {
    max-width: 1300px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 35px;
    justify-items: center;
}

.portfolio-item {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 360px;
    width: 100%;
    max-width: 380px;
    background: var(--slate-dark);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 2px solid rgba(20, 94, 40, 0.08);
}

.portfolio-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(20, 94, 40, 0.2);
    border-color: var(--yellow-accent);
}

.square-frame {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.square-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.portfolio-item:hover .square-frame img {
    transform: scale(1.1);
}

.portfolio-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 25px 20px;
    background: linear-gradient(to top, rgba(19, 48, 33, 0.95), rgba(27,38,36,0.4));
    backdrop-filter: blur(4px);
    color: var(--white);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 5;
    text-align: left;
}

.portfolio-item:hover .portfolio-overlay {
    transform: translateY(0);
}

.portfolio-overlay h4 {
    font-size: 1.35rem;
    font-weight: 400;
    color: var(--yellow-accent);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.portfolio-overlay p {
    font-size: 0.9rem;
    color: #e2e8f0;
}

.titulo-portfolio {
    text-align: center;
    font-size: 2.2rem;
    color: var(--slate-dark);
    padding-top: 50px;
    padding-bottom: 30px;
    letter-spacing: 1px;
}

/* ==========================================================
   BOTONES DE FILTRO INTERACTIVO
   ========================================================== */
.portfolio-filters {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 50px;
}

.filter-btn {
    background: var(--card-bg);
    border: 1px solid rgba(19, 48, 33, 0.12);
    color: var(--primary-green);
    padding: 12px 22px;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.filter-btn i {
    font-size: 0.9rem;
    color: var(--accent-yellow);
    transition: var(--transition-smooth);
}

.filter-btn:hover {
    background: var(--primary-green);
    color: #ffffff;
    border-color: var(--primary-green);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(19, 48, 33, 0.2);
}

.filter-btn:hover i {
    color: #ffffff;
}

.filter-btn.active {
    background: var(--primary-green);
    color: #ffffff;
    border-color: var(--primary-green);
    box-shadow: 0 8px 25px rgba(19, 48, 33, 0.25);
}

.filter-btn.active i {
    color: var(--accent-yellow);
}

/* Estado Vacío */
.portfolio-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.portfolio-empty i {
    font-size: 3rem;
    color: var(--accent-yellow);
    margin-bottom: 15px;
}

.portfolio-empty h3 {
    font-size: 1.5rem;
    color: var(--primary-green);
    margin-bottom: 10px;
}



/* ==========================================================
   ESTILOS DEL LIGHTBOX (PANTALLA COMPLETA)
   ========================================================== */
.portfolio-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(11, 17, 15, 0.92);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.portfolio-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: scaleUp 0.3s ease;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.lightbox-caption {
    text-align: center;
    margin-top: 20px;
    color: var(--white);
}

.lightbox-caption h3 {
    font-size: 1.8rem;
    color: var(--yellow-accent);
    font-weight: 400;
    margin-bottom: 5px;
}

.lightbox-caption p {
    font-size: 1rem;
    color: #cbd5e1;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--white);
    font-size: 40px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    z-index: 10000;
}

.lightbox-close:hover {
    background: var(--yellow-accent);
    color: var(--slate-dark);
    transform: scale(1.1);
}

@keyframes scaleUp {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Media Queries para Responsive Ajustado */
@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        padding: 0 15px;
    }
    .portfolio-item {
        max-width: 100%;
        height: 320px;
    }
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 30px;
    }
}