/* ZEST GALLERY FRONTEND STYLES */

.zest-galeria * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.zest-galeria {
    padding: 100px 20px;
    background: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.zest-container {
    max-width: 1200px;
    margin: 0 auto;
}

.zest-section-title {
    text-align: center;
    font-size: 2.5rem;
    color: #162447;
    margin-bottom: 15px;
    font-weight: 700;
}

.zest-section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: #6b8e5f;
    margin-bottom: 60px;
}

.zest-galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.zest-galeria-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.4s ease;
}

.zest-galeria-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.zest-galeria-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.zest-galeria-item:hover img {
    transform: scale(1.15);
}

.zest-galeria-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(22, 36, 71, 0.95), transparent);
    padding: 30px 20px;
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.zest-galeria-item:hover .zest-galeria-overlay {
    transform: translateY(0);
}

.zest-galeria-overlay h3 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.zest-galeria-overlay p {
    color: #b8d4a8;
    font-size: 0.9rem;
    line-height: 1.6;
}

.zest-galeria-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(107, 142, 95, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 2;
}

.zest-galeria-item:hover .zest-galeria-icon {
    opacity: 1;
    animation: zest-pulse 1.5s infinite;
}

@keyframes zest-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* BOTÃO VER MAIS */
.zest-btn-ver-mais {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(135deg, #6b8e5f, #5a7850);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(107, 142, 95, 0.3);
    margin: 0 auto;
    display: block;
    width: fit-content;
    border: none;
    cursor: pointer;
}

.zest-btn-ver-mais:hover {
    background: linear-gradient(135deg, #162447, #43613c);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(107, 142, 95, 0.5);
}

.zest-btn-ver-mais:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.zest-btn-ver-mais.zest-loading {
    position: relative;
    pointer-events: none;
}

.zest-btn-ver-mais.zest-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    right: 15px;
    margin-top: -10px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: zest-spinner 0.8s linear infinite;
}

@keyframes zest-spinner {
    to { transform: rotate(360deg); }
}

/* MODAL */
.zest-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    align-items: center;
    justify-content: center;
}

.zest-modal.zest-active {
    display: flex;
}

.zest-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: zest-zoomIn 0.3s ease;
}

@keyframes zest-zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.zest-modal-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 10px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
}

.zest-modal-caption {
    color: white;
    padding: 20px;
    text-align: center;
    max-width: 800px;
    margin: 20px auto;
}

.zest-modal-caption h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.zest-modal-caption p {
    font-size: 1rem;
    line-height: 1.8;
    color: #b8d4a8;
}

.zest-modal-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100000;
    background: none;
    border: none;
    padding: 0;
    width: 50px;
    height: 50px;
    line-height: 1;
}

.zest-modal-close:hover {
    color: #6b8e5f;
    transform: rotate(90deg);
}

/* ANIMAÇÕES DE SCROLL */
.zest-fade-in {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s ease;
}

.zest-fade-in.zest-visible {
    opacity: 1;
    transform: translateY(0);
}

/* LOADING STATE */
.zest-galeria-item.zest-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .zest-galeria {
        padding: 60px 20px;
    }
    
    .zest-galeria-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .zest-section-title {
        font-size: 2rem;
    }
    
    .zest-section-subtitle {
        font-size: 1rem;
        margin-bottom: 40px;
    }
    
    .zest-galeria-item img {
        height: 250px;
    }
    
    .zest-btn-ver-mais {
        width: 100%;
        text-align: center;
    }
    
    .zest-modal-content {
        max-width: 95%;
    }
    
    .zest-modal-close {
        right: 20px;
        font-size: 2rem;
        top: 10px;
    }
    
    .zest-modal-caption {
        padding: 15px;
    }
    
    .zest-modal-caption h3 {
        font-size: 1.2rem;
    }
    
    .zest-modal-caption p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .zest-section-title {
        font-size: 1.6rem;
    }
    
    .zest-galeria-overlay h3 {
        font-size: 1rem;
    }
    
    .zest-galeria-overlay p {
        font-size: 0.85rem;
    }
    
    .zest-btn-ver-mais {
        padding: 12px 30px;
        font-size: 1rem;
    }
}

/* PREVENÇÃO DE CONFLITOS */
.zest-galeria a {
    text-decoration: none;
}

.zest-galeria img {
    border: none;
    max-width: 100%;
    height: auto;
}

/* NAVEGAÇÃO DO MODAL */
.zest-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(107, 142, 95, 0.8);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zest-modal-nav:hover {
    background: rgba(107, 142, 95, 1);
    transform: translateY(-50%) scale(1.1);
}

.zest-modal-prev {
    left: 20px;
}

.zest-modal-next {
    right: 20px;
}

.zest-modal-counter {
    background: rgba(22, 36, 71, 0.8);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 15px;
    display: inline-block;
}

/* ACESSIBILIDADE */
.zest-galeria-item:focus {
    outline: 3px solid #6b8e5f;
    outline-offset: 3px;
}

.zest-btn-ver-mais:focus {
    outline: 3px solid #6b8e5f;
    outline-offset: 3px;
}

.zest-modal-close:focus,
.zest-modal-nav:focus {
    outline: 3px solid #6b8e5f;
}

/* ESTADOS DE CARREGAMENTO */
.zest-galeria-item.zest-new-item {
    animation: zest-slideUp 0.5s ease forwards;
}

@keyframes zest-slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}