/* Portfolio Gallery - Frontend Styles */
.portfolio-gallery-container
{
    padding: 2rem 0;
    width: 100%;
}

/* Category Filter Styles */
.portfolio-categories
{
    text-align: center;
    margin-bottom: 2rem;
}

.portfolio-categories .btn-group
{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.portfolio-categories .portfolio-filter-btn
{
    border-radius: 20px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(245, 36, 95, 0.9);
    background-color: transparent;
    color: rgba(245, 36, 95, 0.9);
}

.portfolio-categories .portfolio-filter-btn:hover
{
    background-color: rgba(245, 36, 95, 0.9);
    color: white;
    transform: translateY(-2px);
}

.portfolio-categories .portfolio-filter-btn.active
{
    background-color: rgba(245, 36, 95, 0.9);
    color: white;
    border-color: rgba(245, 36, 95, 0.9);
}

/* Loading Spinner */
.portfolio-loading
{
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

/* Portfolio Grid - CSS Grid para items del mismo tamaño */
.portfolio-grid
{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Items del mismo tamaño */
.portfolio-item
{
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    background: transparent;
}

.portfolio-item:hover
{
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.portfolio-item.hidden
{
    display: none;
}

.portfolio-item-inner
{
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    width: 100%;
    overflow: hidden;
}

.portfolio-image-wrapper
{
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.portfolio-image
{
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    transition: transform 0.3s ease;
    image-rendering: auto;
    -ms-interpolation-mode: bicubic;
    backface-visibility: hidden;
    transform: translateZ(0);
    will-change: transform;
    /* Mejor renderizado para imágenes grandes */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.portfolio-item:hover .portfolio-image
{
    transform: scale(1.05) translateZ(0);
}

/* Mejorar calidad de imagen al hacer zoom */
.portfolio-item:hover .portfolio-image-wrapper
{
    will-change: transform;
}

.portfolio-overlay
{
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.portfolio-image-wrapper:hover .portfolio-overlay
{
    opacity: 1;
}

.overlay-content
{
    text-align: center;
    color: white;
}

.lightbox-icon
{
    width: 60px;
    height: 60px;
    margin: 0 auto 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.portfolio-image-wrapper:hover .lightbox-icon
{
    background: rgba(245, 36, 95, 0.9);
    border-color: rgba(245, 36, 95, 0.9);
    transform: scale(1.1);
}

.lightbox-icon svg
{
    color: white;
}

.lightbox-hint
{
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.portfolio-item-content
{
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: transparent;
}

.portfolio-title
{
    margin: 0 0 0.75rem 0;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.3;
    color: #1d2327;
}

.portfolio-category-badges
{
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.portfolio-category-badges .badge
{
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 12px;
    font-weight: 500;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

/* Botón de visita */
.portfolio-visit-btn
{
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, rgba(245, 36, 95, 0.9), rgba(245, 36, 95, 0.8));
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    margin-top: auto;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(245, 36, 95, 0.3);
}

.portfolio-visit-btn:hover
{
    background: linear-gradient(135deg, rgba(245, 36, 95, 1), rgba(245, 36, 95, 0.9));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 36, 95, 0.4);
    color: white;
    text-decoration: none;
}

.portfolio-visit-btn:active
{
    transform: translateY(0);
}

.btn-icon
{
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.portfolio-visit-btn:hover .btn-icon
{
    transform: translateX(3px);
}

.btn-text
{
    font-weight: 500;
}

/* Pagination Styles */
.portfolio-pagination
{
    margin-top: 2rem;
}

.portfolio-pagination .pagination
{
    margin: 0;
}

.portfolio-pagination .page-link
{
    color: rgba(245, 36, 95, 0.9);
    border: none;
    margin: 0 0.2rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
}

.portfolio-pagination .page-item.active .page-link
{
    background-color: rgba(245, 36, 95, 0.9);
    color: white;
}

.portfolio-pagination .page-link:hover
{
    background-color: rgba(245, 36, 95, 0.9);
    color: white;
    transform: translateY(-2px);
}

.portfolio-pagination .page-item.disabled .page-link
{
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.portfolio-pagination .page-numbers
{
    display: flex;
    gap: 0.2rem;
}

.portfolio-pagination .page-numbers .page-link
{
    min-width: 40px;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 1200px)
{
    .portfolio-grid
    {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
}

@media (max-width: 768px)
{
    .portfolio-gallery-container
    {
        padding: 1rem 0;
    }

    .portfolio-grid
    {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .portfolio-categories .portfolio-filter-btn
    {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }

    .portfolio-overlay
    {
        padding: 1rem;
    }

    .portfolio-title
    {
        font-size: 1rem;
    }

    .portfolio-pagination .page-link
    {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
}

/* Configuración dinámica de columnas */
.portfolio-grid[data-columns="2"]
{
    grid-template-columns: repeat(2, 1fr);
}

.portfolio-grid[data-columns="4"]
{
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1200px)
{
    .portfolio-grid[data-columns="4"]
    {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px)
{
    .portfolio-grid[data-columns="2"],
    .portfolio-grid[data-columns="4"]
    {
        grid-template-columns: 1fr;
    }
}

/* ========== LIGHTBOX STYLES ========== */
.portfolio-lightbox
{
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.portfolio-lightbox.active
{
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.lightbox-overlay
{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
}

.lightbox-container
{
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 10000;
}

.lightbox-content
{
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img
{
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: lightboxFadeIn 0.3s ease;
}

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

.lightbox-info
{
    margin-top: 1.5rem;
    text-align: center;
    color: white;
}

.lightbox-info h3
{
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next
{
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10001;
    backdrop-filter: blur(10px);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover
{
    background: rgba(245, 36, 95, 0.9);
    border-color: rgba(245, 36, 95, 0.9);
    transform: scale(1.1);
}

.lightbox-close
{
    top: 2rem;
    right: 2rem;
}

.lightbox-prev,
.lightbox-next
{
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev
{
    left: 2rem;
}

.lightbox-next
{
    right: 2rem;
}

.lightbox-close svg,
.lightbox-prev svg,
.lightbox-next svg
{
    width: 24px;
    height: 24px;
}

@media (max-width: 768px)
{
    .lightbox-container
    {
        padding: 1rem;
    }

    .lightbox-close,
    .lightbox-prev,
    .lightbox-next
    {
        width: 40px;
        height: 40px;
    }

    .lightbox-close
    {
        top: 1rem;
        right: 1rem;
    }

    .lightbox-prev
    {
        left: 0.5rem;
    }

    .lightbox-next
    {
        right: 0.5rem;
    }

    .lightbox-info h3
    {
        font-size: 1.2rem;
    }
}

