/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--branco);
    border-radius: 16px;
    width: 100%;
    max-width: 1100px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal.active {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: var(--branco);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--verde-primario);
    color: var(--branco);
    transform: rotate(90deg);
}

.modal-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-gallery {
    background: #f8f9fa;
    padding: 30px;
}

.main-image-container {
    position: relative;
    width: 100%;
    height: 350px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    margin-bottom: 20px;
}

.main-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--verde-primario);
    transition: all 0.3s ease;
    z-index: 20;
}

.gallery-nav-prev { left: 15px; }
.gallery-nav-next { right: 15px; }

.gallery-counter {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
}

.thumbnail {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.thumbnail:hover,
.thumbnail.active {
    opacity: 1;
    border-color: var(--verde-primario);
}

.modal-details {
    padding: 30px;
    overflow-y: auto;
}

.modal-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.modal-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--verde-primario);
    margin: 20px 0;
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
}

.spec-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--verde-primario), var(--verde-secundario));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.property-description {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid var(--verde-primario);
}

.modal-cta {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.modal-btn {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.modal-btn-primary {
    background: var(--verde-primario);
    color: white;
}

.modal-btn-primary:hover {
    background: var(--verde-secundario);
}

.modal-btn-secondary {
    background: transparent;
    color: var(--verde-primario);
    border: 2px solid var(--verde-primario);
}

@media (max-width: 992px) {
    .modal-content {
        grid-template-columns: 1fr;
    }
    .main-image-container {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .modal-title {
        font-size: 1.5rem;
    }
    .modal-price {
        font-size: 1.8rem;
    }
    .specs-grid {
        grid-template-columns: 1fr;
    }
    .modal-cta {
        flex-direction: column;
    }
}